get.resid
runs linear models across brain regions listed in a
data.table
(e.g. cortical thickness), adjusting for variables in
covars
(e.g. age, sex, etc.), and calculates the
externally Studentized (or leave-one-out) residuals.
The [
method will let you reorder or subset residuals based on a given
numeric vector. However, this is used in bootstrap and permutation analysis
and should generally not be called directly by the user.
The summary
method prints the number of outliers per region, and the
number of times a given subject was an outlier (i.e., across regions).
The plot
method lets you check the model residuals for each brain
region in a structural covariance analysis. It shows a qqplot of the
studentized residuals, as output from get.resid
.
get.resid(dt.vol, covars, method = c("comb.groups", "sep.groups"),
use.mean = FALSE, exclude.cov = NULL, ...)# S3 method for brainGraph_resids
[(x, i, g = NULL)
# S3 method for brainGraph_resids
summary(object, regions = NULL, ...)
# S3 method for brainGraph_resids
plot(x, regions = NULL, cols = FALSE, ...)
A data.table
containing all the volumetric measure of
interest (i.e., the object lhrh
as ouptut by
import_scn
)
A data.table
of the covariates of interest
Character string indicating whether to test models for subject
groups separately or combined (default: comb.groups
)
Logical should we control for the mean hemispheric brain
value (e.g. mean LH/RH cortical thickness) (default: FALSE
)
Character vector of covariates to exclude (default:
NULL
)
Arguments passed to brainGraph_GLM_design
(optional)
A brainGraph_resids
object
Numeric vector of the indices
Character string indicating the group (default: NULL
)
A brainGraph_resids
object
Character vector of region(s) to focus on; default behavior is to show summary for all regions
Logical indicating whether to color by group (default: FALSE)
get.resid
- an object of class brainGraph_resids
with
elements:
The design matrix
The input argument method
The input argument use.mean
The tidied data.table
of volumetric data (e.g.,
mean regional cortical thickness) and covariates, along with
resids column added
The "wide" data.table
of residuals
Group names
summary.brainGraph_resids returns a list with two data tables, one of the residuals, and one of only the outlier regions
The plot method returns a list of ggplot objects
You can choose to run models for each of your subject groups separately or
combined (the default) via the method
argument. You may also choose
whether or not to include the mean, per-hemisphere structural measure in the
models. Finally, you can specify variables that are present in covars
but you would like to exclude from the models.
Other Structural covariance network functions: Bootstrapping
,
IndividualContributions
,
brainGraph_permute
,
corr.matrix
, import_scn
,
plot_volumetric
# NOT RUN {
myresids <- get.resids(lhrh, covars)
residPlots <- plot(myresids, cols=TRUE)
## Save as a multi-page PDF
ml <- marrangeGrob(residPlots, nrow=3, ncol=3)
ggsave('residuals.pdf', ml)
# }
Run the code above in your browser using DataLab