corr.matrix
calculates the correlation between all column pairs of a
given data frame, and thresholds the resultant correlation matrix based on a
given density (e.g., 0.1
if you want to keep only the 10% strongest
correlations). If you want to threshold by a specific correlation coefficient
(via the thresholds
argument), then the densities
argument is
ignored.
corr.matrix(resids, densities, thresholds = NULL, what = c("resids",
"raw"), exclude.reg = NULL, type = c("pearson", "spearman"),
rand = FALSE)
An object of class brainGraph_resids
(the output from
get.resid
)
Numeric vector indicating the resultant network density(ies); keeps the top X% of correlations
Numeric; absolute correlation value to threshold by
(default: NULL
)
Character string indicating whether to correlate the residuals or
the raw structural MRI values (default: 'resids'
)
Character vector of regions to exclude (default:
NULL
)
Character string indicating which type of correlation coefficient
to calculate (default: 'pearson'
)
Logical indicating whether the function is being called for
permutation testing; not intended for general use (default: FALSE
)
A nested list containing a list for all subject groups; each of these has the following components:
Numeric matrix of correlation coefficients.
Numeric matrix of p-values.
A 3-d binary array indicating correlations that are above a certain threshold. The length of the 3rd dimension equals the number of thresholds/densities supplied.
Numeric vector; the thresholds supplied.
Numeric vector; the densities supplied.
Residuals or raw values
Excluded regions (if any)
Pearson or Spearman
If you wish to exclude regions from your analysis, you can give the indices
of their columns with the exclude.reg
argument.
By default, the Pearson correlation coefficients are calculated, but you can
return Spearman by changing the type
argument.
Other Structural covariance network functions: Bootstrapping
,
IndividualContributions
,
Residuals
,
brainGraph_permute
,
import_scn
, plot_volumetric
# NOT RUN {
myResids <- get.resid(lhrh, covars)
corrs <- corr.matrix(myResids, densities=densities)))
# }
Run the code above in your browser using DataLab