projcov: Calculate the Projected Covariance of Two Vectors

Description Usage Arguments Value See Also Examples

View source: R/projcov.R

Description

projcov calculate the projected distance covariance of two vectors given common factors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
projcov(
  x,
  y,
  b,
  method = c("lasso", "sam", "ols"),
  one.SE = TRUE,
  refit = TRUE,
  R = 199,
  randSeed = 0,
  normalized = FALSE
)

Arguments

x

first vector

y

second vector

b

factor matrix

method

projection method. Default = 'lasso'.

one.SE

whether to use the 1se rule for glmnet. Default = TRUE.

refit

whether to refit the selected model. Default = TRUE.

R

number of random permutations for the test.

randSeed

the random seed for the program. Default = 0.

normalized

whether to normalized by S2. Default = FALSE.

Value

a list.

test.pearson

pearson correlection test statistic

test.dcov

distance covariance test statistic

xeps

residual of projection of x on b

yeps

residual of projection of y on b

See Also

greg, roc, pgraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(splines)
set.seed(0)
K = 3
n = 100
b = matrix(rnorm(K*n),n,K)
bx = 1:3
by = c(1,2,2)
x = b%*%bx+rnorm(n)
y = b%*%by+rnorm(n)
fit1 = projcov(x, y, b, method = 'lasso')
fit2 = projcov(x, y, b, method = 'sam')

pgraph documentation built on Jan. 21, 2020, 5:07 p.m.

Related to projcov in pgraph...