design | R Documentation |
Designed to be used by cpg.assoc
and cpg.perm
. Creates a full and reduced design matrices.
design(covariates, indep, chip.id, random)
covariates |
A data frame consisting of the covariates of interest. covariates can also be a matrix if it is a model matrix minus the intercept column.
It can also be a vector if there is only one covariate of interest.
If no covariates must be specified as |
indep |
A vector containing the main variable of interest. |
chip.id |
An optional vector containing chip or batch identities. If specified, |
random |
Is the model going to be a mixed effects. If so, |
Returns a list containing the full and reduced design matrices.
full |
The full design matrix. |
reduced |
The reduced design matrix. |
The design
function is designed to be used exclusively by the cpg.assoc
and cpg.perm
functions.
Barfield, R.; Kilaru,V.; Conneely, K.
Maintainer: R. Barfield: <barfieldrichard8@gmail.com>
cpg.assoc
cpg.perm
cpg.work
plot.cpg
scatterplot
cpg.combine
manhattan
plot.cpg.perm
data(samplecpg,samplepheno,package="CpGassoc")
#Example where there are covariates:
covar<-data.frame(samplepheno$weight,samplepheno$Distance)
test<-design(covar,samplepheno$SBP,samplepheno$chip,FALSE)
dim(test$full)
dim(test$reduced)
test$reduced[1:5,1:5]
test$full[1:5,1:5]
#When no covariates or chip.id:
test2<-design(NULL,samplepheno$SBP,NULL,FALSE)
dim(test2$full)
dim(test2$reduced)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.