QPCorr.pval: P-values of the "QPCorr.matrix" obtained using a permutation...

View source: R/QPCorr.pval.R

QPCorr.pvalR Documentation

P-values of the "QPCorr.matrix" obtained using a permutation approach

Description

P-values of the "QPCorr.matrix " obtained using a permutation approach, the interactions with smaller p-values are regarded as more important.

Usage

QPCorr.pval(
  G,
  E,
  Y,
  tau,
  w = NULL,
  permutation_t = 1000,
  family = c("continuous", "survival")
)

Arguments

G

Input matrix of p genetic (G) measurements consisting of n rows. Each row is an observation vector.

E

Input matrix of q environmental (E) risk factors, each row is an observation vector.

Y

Response variable. A quantitative vector for family="continuous". For family="survival", Y should be a two-column matrix with the first column being the log(survival time) and the second column being the censoring indicator. The indicator is a binary variable, with "1" indicating dead, and "0" indicating right censored.

tau

Quantile.

w

Weight for accommodating censoring if family="survival". Default is NULL and a Kaplan-Meier estimator-based weight is used.

permutation_t

Number of permutation.

family

Response type of Y (see above).

Value

Matrix of p-value, with the element in the ith row and the j column represents the p-value of the (censored) quantile partial correlation corresponding to the ith E and the jth G.

References

Yaqing Xu, Mengyun Wu, Qingzhao Zhang, and Shuangge Ma. Robust identification of gene-environment interactions for prognosis using a quantile partial correlation approach. Genomics, 111(5):1115-1123, 2019.

See Also

QPCorr.matrix method.

Examples

n=50
alpha=matrix(0,5,1)
alpha[1:2]=1
beta=matrix(0,6,20)
beta[1,1:4]=1
beta[2:3,1:4]=2
sigmaG<-AR(rho=0.3,20)
sigmaE<-AR(rho=0.3,5)
G<-MASS::mvrnorm(n,rep(0,20),sigmaG)
E<-MASS::mvrnorm(n,rep(0,5),sigmaE)
e1<-rnorm(n*.05,50,1);e2<-rnorm(n*.05,-50,1);e3<-rnorm((n-length(e1)-length(e2)))
e<-c(e1,e2,e3)


# continuous
y1=simulated_data(G=G,E=E,alpha=alpha,beta=beta,error=e,family="continuous")
cpqcorr_pvalue1<-QPCorr.pval(G,E,y1,tau=0.5,permutation_t=500,family="continuous")

# survival
y2=simulated_data(G,E,alpha,beta,rnorm(n,0,1),family="survival",0.7,0.9)
cpqcorr_pvalue2<-QPCorr.pval(G,E,y2,tau=0.5,permutation_t=500,family="survival")


GEInter documentation built on May 20, 2022, 1:17 a.m.

Related to QPCorr.pval in GEInter...