
Last chance! 50% off unlimited learning
Sale ends in
NullModel
assocTest
methodnullModel
.nullModel
function.
Direct modification of object slots is strongly discouraged!NullModel
object x
and an index vector i
that is a permutation of 1:length(x)
,
x[i]
returns a new NullModel
object in which the samples
have been rearranged according to the permutation i
. This is
meant for applications in which the order of the samples in a subsequent
association test is different from the order of the samples when the
null model was trained/created.nullModel
## read phenotype data from CSV file (continuous trait + covariates)
phenoFile <- system.file("examples/example1lin.csv", package="podkat")
pheno <-read.table(phenoFile, header=TRUE, sep=",")
## train null model with all covariates in data frame 'pheno'
model <- nullModel(y ~ ., pheno)
model
length(model)
residuals(model)
## read phenotype data from CSV file (binary trait + covariates)
phenoFile <- system.file("examples/example1log.csv", package="podkat")
pheno <-read.table(phenoFile, header=TRUE, sep=",")
## train null model with all covariates in data frame 'pheno'
model <- nullModel(y ~ ., pheno)
model
length(model)
residuals(model)
## "train" simple Bernoulli model on a subset of 100 samples
model <- nullModel(y ~ 0, pheno[1:100, ])
model
length(model)
residuals(model)
Run the code above in your browser using DataLab