Description Usage Arguments Value Note Author(s) References See Also Examples
PBmap
calculates the proposed transformations (see reference), i.e. B-map and P-map.
PBtest
conducts the PB-transformed parametric or nonparametric test (see reference).
1 2 |
YY |
Vector or matrix of response values. If gene expression matrix, genes in columns and subjects in rows. |
xx |
Vector of covariate values. |
Sigma |
Vairance-covariance matrix. |
test |
Parametric or nonparametric test. Options: |
id |
Vector of subject IDs (for repeated measurements). |
weights |
Vector of a priori weights. |
debug |
Logical value. If |
A list of testing results:
p.value |
P-value(s) of two-sided test. |
statistic |
Test statistic(s). |
df |
Adjusted degrees of freedom by |
If debug=TRUE
, the following intermediate results are also returned.
YY.tilde |
PB-transformed data. |
Sigma |
Variance-covariance matrix. |
sigma.sq |
A scalar value. Dcompose the covariance matrix into a scale parameter and a shape parameter, such that |
SS.inv |
Inverse of |
SS.tilde |
Shape parameter after centering, i.e. |
LL |
Diagnal matrix of non-zero eigen-values of |
TT |
Matrix of corresponding eigen-vectors of |
BB |
B-map. |
zz |
Transformed covariate. |
QQ |
Q matrix of the QR decomposition. |
RR |
R matrix of the QR decomposition. |
Rot |
Rotation matrix by construction. |
PP |
P-map. |
Depending on different levels of a priori information, the following options are available.
1. If Sigma
is known, set Sigma=Sigma
and leave id=NULL, weights=NULL
.
2. If Sigma
is unknown, estimate using getSigma
. In the arguments here, set Sigma=NULL, id=id, weights=weights
or NULL
. If weights=NULL
, equal weights of 1 will be assigned.
3. If Sigma=NULL, id=NULL, weights=NULL
, the identity matrix will be used for Sigma
.
Yun Zhang, Xing Qiu
Zhang et al. (2019) Highly efficient hypothesis testing methods for regression-type tests with correlated observations and heterogeneous variance structure. BMC Bioinformatics, 20:185.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | library(PBtest)
data(sim1)
## attach list elements to the global environment
list2env(sim1,globalenv())
## the PB-transformed t-test, with Sigma estimation
out.PB <- PBtest(YY=simdat, xx=Grp, test="t", id=Subj, weights=ww)
## p-values
pvec.PB <- out.PB$p.value
## degrees of freedom
df.PB <- out.PB$df
## estimated correlation
rho.hat.PB <- getRho(YY=simdat, xx=Grp, id=Subj, weights=ww)
## Sigma matrix
Sigma <- getSigma(YY=simdat, xx=Grp, id=Subj, weights=ww)
## or
Sigma <- PBtest(YY=simdat, xx=Grp, id=Subj, weights=ww, debug=TRUE)$Sigma
## the estimated correlation is also the off-diagonal non-zero value of the following matrix
cor.mat <- diag(sqrt(ww)) %*% Sigma %*% diag(sqrt(ww))
## the transformation maps
mymap <- PBmap(xx=Grp, Sigma)
Bmap <- mymap$BB
Pmap <- mymap$PP
## the PB-transformed data
simdat.PB <- PBtest(YY=simdat, xx=Grp, id=Subj, weights=ww, debug=TRUE)$YY.tilde
dim(simdat.PB) #this should have one less row than the original data dim(simdat)
## PBtest for two-sample t-test
out1.PB <- PBtest(YY=simdat, xx=Grp)
pvec1.PB <- out1.PB$p.value
df1.PB <- out1.PB$df
## two-sample t-test
pvec.t <- genefilter::colttests(simdat, Grp)$p.value
summary(pvec1.PB-pvec.t) #numerially same
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.