# NOT RUN {
## get genotype and covariate matrices
gno <- readRDS(system.file("extdata", 'rs208294_gno.rds', package="dotgen"))
cvr <- readRDS(system.file("extdata", 'rs208294_cvr.rds', package="dotgen"))
## estimate the correlation among association test statistics
sgm <- cst(gno, cvr)
## get the result of genetic association analysis (P-values and effects)
res <- readRDS(system.file("extdata", 'rs208294_res.rds', package="dotgen"))
## recover Z-score statistics
stt <- with(res, zsc(P, BETA))
## decorrelate Z-scores by DOT
result <- dot(stt, sgm)
print(result$X) # decorrelated statistics
print(result$H) # orthogonal transformation
## sum of squares of decorrelated statistics is a chi-square
ssq <- sum(result$X^2)
pvl <- 1 - pchisq(ssq, df=result$L)
print(ssq) # sum of squares = 35.76306
print(pvl) # chisq P-value = 0.001132132
# }
Run the code above in your browser using DataLab