cca_cv_boot: Cross-Validtation Bootstrap CCA

Description Usage Arguments

View source: R/analysis_functions.R

Description

Algorithm for using cross-validation & bootstrap resampling to find unbiased canonical correlation and their sampling error. On each iteration, N-fold (default is 10 fold) cross-validation is used to generated predicted canonical variates for the complete sample. Following this, the predicted variates are bootstrap resampled and canonical correlations are estimated from them. Because bootstrap resampling can change the order of canonical variates that are extracted, or sign flipping can occur in some cases (i.e. a very similar latent variable is extracted but on some occasions the loadings are mostly positive or negative), we rotate the loadings in each during cross-validation to map onto the loadings generated from a smaller dataset (ProcrustX & ProcrustY)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cca_cv_boot(
  X_FIT,
  Y_FIT,
  ncomp = 10,
  Nboot = 30,
  Nfolds = 10,
  ProcrustX = NULL,
  ProcrustY = NULL,
  UseProgressBar = TRUE,
  UseProcrustes = TRUE
)

Arguments

X_FIT

Numeric Matrix or Data Frame [N, P1] containing the predictor variables.

Y_FIT

Numeric Matrix or Data Frame [N, P2] containing the outcome variables.

ncomp

Numeric Scalar. Number of CCA components to keep in analyses. Must be equal to or less than min(P1,P2).

Nboot

Numeric Scalar. Number of times to repeat k-fold cross-validation (yes its confusing it says "boot").

Nfolds

Numeric Scalar. Number of

ProcrustX

Numeric Matrix [ncomp, P1] containing target matrix for Procrustes Analysis. All CCA predictor raw coefficients obtained during the bootstrap resampling will be rotated to this target matrix.

ProcrustY

Numeric Matrix [ncomp, P2] containing target matrix for Procrustes Analysis. All CCA outcome raw coefficients obtained during the bootstrap resampling will be rotated to this target matrix.

UseProgressBar

Logical. Whether to show progress bar.

UseProcrustes

Logical. Whether to use procrustes analysis.


giac01/ccatools documentation built on July 15, 2021, 4:33 a.m.