Using limma for controlling age variable
1
0
Entering edit mode
Matej • 0
@100b9d49
Last seen 7 months ago
Germany

Hi,

I have some DNA methylation data of patients and their families, which are confounded by age. Thus, I'd like to adjust the model with age as a covariate to see the disease effect not influenced by age. I used the following design matrix: design<-model.matrix(~ factor+age) Is this a correct design matrix format? The rest of the analysis code bellow. Cheers! Matt

factor           <- factor(anno$Subject_group) 
age <- as.numeric(anno$Epigenetic_clock_Horvath)

design<-model.matrix(~ factor+age) 
colnames(design) <- c("Patient", "Parent", "Sibling", "Age")


fit             <- lmFit(mval, design)

contrast_matrix <- makeContrasts(Patient - Parent,
                                 Patient - Sibling,
                                 Parent - Sibling,
                                 levels = design)

fit_contrast <- contrasts.fit(fit, contrast_matrix) 
fit_ebayes   <- eBayes(fit_contrast)
linearmodeling limma • 801 views
ADD COMMENT
2
Entering edit mode
@gordon-smyth
Last seen 33 minutes ago
WEHI, Melbourne, Australia

Yes, that is the standard way to add age as a covariate.

ADD COMMENT
0
Entering edit mode

Thanks a lot!

ADD REPLY

Login before adding your answer.

Traffic: 965 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6