This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Paired analysis with sex and age as covariates for SVA

Is it possible to add covariates such as age and sex as adjustment variables when building a model matrix for a paired subject dataset during surrogate variable analysis (SVA) and supervised normalization (SNM)? The below code throws an error, most likely because the age, sex, and subject IDs (since they are paired samples) become linearly correlated:

mod1 <- model.matrix(~age + sex + subjectID + condition, 
                     data = colData)
mod0 <- model.matrix(~1, data = colData)

Appreciate any help!

snm paired sva expression

1 answer

In a paired analysis the pairing compensates/adjusts for every covariate/attribute that can describe the subject, including age and sex. Hence and and sex are nested with the subject. You can drop age and sex.

Log in to answer this question.