dot-cca: Canonical Correlations

Description Usage Arguments Value

Description

Sightly quicker than stats::cancor, and allows you to easily fit cca models in one dataset and find predicted variates/canonical correlations in another dataset.

The number of predictor (X) and outcome (Y) variables are denoted by P1 and P2 below, and N is sample size.

The function also allows the user to rotate the raw coefficients using Procrustes Analyses to target matrices (ProcrustX & ProcrustY), prior to estimating variates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
.cca(
  X_FIT,
  Y_FIT,
  X_PRED = NULL,
  Y_PRED = NULL,
  ncomp = 10,
  ProcrustX = NULL,
  ProcrustY = NULL,
  SafetyChecks = TRUE
)

Arguments

X_FIT

Numeric Matrix [N, P1] containing the training dataset predictor variables.

Y_FIT

Numeric Matrix [N, P2] containing the training dataset outcome variables.

X_PRED

Numeric Matrix [N, P1] containing the testing dataset predictor variables. Variables should be ordered in the same way as for X_FIT.

Y_PRED

Numeric Matrix [N, P2] containing the testing dataset outcome variables. Variables should be ordered in the same way as for Y_FIT.

ncomp

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

ProcrustX

Numeric Matrix [ncomp, P1] containing target matrix for Procrustes Analysis. Will align raw coefficient matrix to ProcrustX target matrix.

ProcrustY

Numeric Matrix [ncomp, P2] containing target matrix for Procrustes Analysis. Will align raw coefficient matrix to ProcrustY target matrix.

SafetyChecks

Checks the input provided for mistakes (default = FALSE).

Value

A list containing the following components


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