CPTloading: Correlation based Permutation Test (CPT) for canonical...

View source: R/CPTloading.R

CPTloadingR Documentation

Correlation based Permutation Test (CPT) for canonical loadings (singular vectors)

Description

This function performs Correlation based Permutation Test on singular vectors of cross-covariance matrix between data matrices X and Y (or say canonical loadings in SCCA) .

Usage

CPTloading(
  X,
  Y,
  side = c("X", "Y"),
  K,
  r,
  penalty = c("Fixed", "CV"),
  rho_x,
  rho_y,
  permutation_no
)

Arguments

X

Data matrix, each row is one sample, each column is one feature.

Y

Data matrix, each row is one sample, each column is one feature.

side

Test singular vector with respect to X or Y, choose from "X", "Y".

K

The index of singular vector to be tested.

r

Number of components to be computed, r>=K.

penalty

"Fixed" or "CV": how to choose the penalty parameter, using fixed value or through cross validation.

rho_x

Penalty parameter used for PMD estimation of data X. If penalty = "Fixed", rho should be a single value, if penalty = "CV", rho_x should be a vector containing candidate penalty parameters for cross validation.

rho_y

Penalty parameter used for PMD estimation of data Y. If penalty = "Fixed", rho should be a single value, if penalty = "CV", rho_y should be a vector containing candidate penalty parameters for cross validation.

permutation_no

Integer: number of permutations for each test.

Value

A vector of p-values for K th singular vector with respect to side.

Examples

library(TestPMD)
data("covid")
CPTloading(X = covid$metabolite, Y = covid$protein, side = "X", K = 1, r = 10,
 penalty = "Fixed", rho_x = 0.5, rho_y = 0.5, permutation_no = 100)

YunhuiQi/TestPMD documentation built on May 5, 2022, 8:23 p.m.