Principal Component of Explained Variance

Share:

Description

computePCEV computes the first PCEV and tests its significance.

Usage

1
2
3
computePCEV(response, covariate, confounder = NULL, estimation = "all",
  inference = "exact", index = NULL, shrink = FALSE, nperm = 1000,
  Wilks = FALSE)

Arguments

response

A matrix of response variables.

covariate

An array or a data frame of covariates.

confounder

An array or data frame of confounders.

estimation

Character string specifying which estimation method to use: "all" or "block". Default value is "all".

inference

Character string specifying which inference method to use: "exact" or "permutation". Default value is "exact".

index

If estimation = "block", index is a vector describing the block to which individual response variables correspond.

shrink

Should we use a shrinkage estimate of the residual variance? Default value is FALSE..

nperm

The number of permutations to perform if inference = "permutation"

Wilks

Should we use a Wilks test instead of Roy's largest test? This is only implemented for a single covariates.

Details

This is the main function. It computes the PCEV using either the classical method or the block approach. A p-value is also computed, testing the significance of the PCEV.

The p-value is computed using either a permutation approach or an exact test. The implemented exact tests use Wilks' Lambda (only for a single covariate) or Roy's Largest Root. The latter uses Johnstone's approximation to the null distribution. Note that this test is also available for the block approach, but there is no theoretical guarantee that it works, and the resulting p-value should therefore be compared to that obtained using a permutation procedure.

Value

An object of class Pcev containing the first PCEV, the p-value, the estimate of the shrinkage factor, etc.

See Also

estimatePcev

Examples

1
2
3
4
5
set.seed(12345)
Y <- matrix(rnorm(100*20), nrow=100)
X <- rnorm(100)
pcev_out <- computePCEV(Y, X)
pcev_out2 <- computePCEV(Y, X, shrink = TRUE)