acPCA: Perform AC-PCA for simultaneous dimension reduction and...

Description Usage Arguments Value

View source: R/acPCA.R

Description

Perform AC-PCA for simultaneous dimension reduction and adjustment for confounding variation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
acPCA(
  X,
  Y,
  nPC,
  lambda,
  eval = F,
  numPerm = 100,
  alpha = 0.05,
  plot = T,
  centerX = T,
  centerY = T,
  scaleX = F,
  scaleY = F,
  kernel = c("linear", "gaussian"),
  bandwidth = 1
)

Arguments

X

the n by p data matrix, where n is the number of samples, p is the number of variables. Missing values in X should be labeled as NA. If a whole sample in X is missing, it should be removed.

Y

the n by q confounder matrix, where n is the number of samples, q is the number of confounding factors. Missing values in Y should be labeled as NA.

nPC

number of principal components to compute

lambda

the tuning parameter, non-negative.

eval

True or False. eval=T evaluates the significance of the PCs. Default is F.

numPerm

the number of permutations to evaluate the significance of the PCs. Default is 100.

alpha

the significance level. Default is 0.05. If the kth PC is not significant, we don't consider the PCs after it. If the eigenvalue and variance explained by the PCs give inconsistent results, we choose the maximum number of significant PCs.

plot

True or False. plot=T generates the plots. Default is True.

centerX

center the columns in X. Default is True.

centerY

center the columns in Y. Default is True.

scaleX

scale the columns in X to unit standard deviation. Default is False.

scaleY

scale the columns in Y to unit standard deviation. Default is False.

kernel

the kernel to use: "linear", "gaussian".

bandwidth

bandwidth h for Gaussian kernel. Optional.

Value

The principal components and the projected data

v

the principal components, p by nPC matrix

Xv

the projected data, i.e. X times v

eigenvalueX

eigenvalues for the PCs

varianceX

variance explained by the PCs

varianceX_perc

percentage of total variance in X explained by the PCs. If eval=F, NA is returned.

eigenvalueXperm

eigenvalues for the PCs, permutation. If eval=F, NA is returned.

varianceXperm

variance explained by the PCs, permutation. If eval=F, NA is returned.

sigPC

the significant PCs. If eval=F, NA is returned.

...

Input parameters for the function


YuWang28/acPCoA documentation built on Dec. 18, 2021, 8:20 p.m.