Entering edit mode
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)
Thanks a lot!