Description Usage Arguments Value Note Author(s) See Also Examples
Designed to be used by cpg.assoc
and cpg.perm
. Creates a full and reduced design matrices.
1 | 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: <rbarfield01@fas.harvard.edu>
cpg.assoc
cpg.perm
cpg.work
plot.cpg
scatterplot
cpg.combine
manhattan
plot.cpg.perm
1 2 3 4 5 6 7 8 9 10 11 12 | 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)
|
Loading required package: nlme
[1] 258 26
[1] 258 25
(Intercept) samplepheno.weight samplepheno.Distance factor(chip.id)3
1 1 31.02998 28.49084 0
2 1 20.83885 13.10059 0
3 1 21.47078 14.76703 0
4 1 23.95091 25.54482 0
5 1 34.12922 29.45997 0
factor(chip.id)4
1 0
2 0
3 0
4 0
5 0
(Intercept) indep samplepheno.weight samplepheno.Distance factor(chip.id)3
1 1 16.98629 31.02998 28.49084 0
2 1 34.90645 20.83885 13.10059 0
3 1 21.55838 21.47078 14.76703 0
4 1 20.90882 23.95091 25.54482 0
5 1 27.01004 34.12922 29.45997 0
[1] 258 2
[1] 258 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.