Description Usage Arguments Value Examples
View source: R/KnockoffScreen.R
This function does the preliminary data management and fit the model under null hypothesis. The output will be passed to the other functions.
1 |
Y |
The outcome variable, an n*1 matrix where n is the total number of observations |
X |
An n*d covariates matrix where d is the total number of covariates. |
id |
The subject id. This is used to match phenotype with genotype. The default is NULL, where the matched phenotype and genotype matrices are assumed. |
out_type |
Type of outcome variable. Can be either "C" for continuous or "D" for dichotomous. The default is "C". |
It returns a list that will be passed to function KS.chr().
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(KnockoffScreen)
# load example vcf file from package "seqminer"
vcf.filename = system.file("vcf/1000g.phase1.20110521.CFH.var.anno.vcf.gz", package = "seqminer")
## this is how the actual genotype matrix from package "seqminer" looks like
example.G <- t(readVCFToMatrixByRange(vcf.filename, "1:196621007-196716634",annoType='')[[1]])
# simulated outcomes, covariates and inidividual id.
Y<-as.matrix(rnorm(nrow(example.G),0,1))
X<-as.matrix(rnorm(nrow(example.G),0,1))
id<-rownames(example.G)
# fit null model
result.prelim<-KS.prelim(Y,X=X,id=id,out_type="C")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.