design {CpGassoc}R Documentation

Create full and reduced design matrices for the cpg.assoc function.

Description

Designed to be used by cpg.assoc and cpg.perm. Creates a full and reduced design matrices.

Usage

design(covariates, indep, chip.id, random)

Arguments

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 NULL.

indep

A vector containing the main variable of interest. cpg.assoc will evaluate the association between indep and the beta values.

chip.id

An optional vector containing chip or batch identities. If specified, chip.id will be included as a factor in the model.

random

Is the model going to be a mixed effects. If so, chip.id will not be included in the design matrices.

Value

Returns a list containing the full and reduced design matrices.

full

The full design matrix.

reduced

The reduced design matrix.

Note

The design function is designed to be used exclusively by the cpg.assoc and cpg.perm functions.

Author(s)

Barfield, R.; Kilaru,V.; Conneely, K.
Maintainer: R. Barfield: <rbarfield01@fas.harvard.edu>

See Also

cpg.assoc cpg.perm cpg.work plot.cpg scatterplot cpg.combine manhattan plot.cpg.perm

Examples

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)

[Package CpGassoc version 2.60 Index]