Second covariate
1
0
Entering edit mode
liberios ▴ 10
@17265709
Last seen 18 months ago
United States

How to add a second covariate in the analysis? age is the covariate in my design. I would also like to add sex to it. I looked at some of the answers but I am not sure they exactly explain what I am looking for? Would just adding it after age solve this?

Code should be placed in three backticks as shown below


dds <- DESeqDataSetFromTximport(txi, sampleTable, ~age +condition)
DESeq2 • 693 views
ADD COMMENT
1
Entering edit mode
Kevin Blighe ★ 3.9k
@kevin
Last seen 7 days ago
Republic of Ireland

The formula for DESeq2 works in the same way as any formula that we specify in R. The y variable is essentially the gene's expression, with predictors / covariates as x variables:

gene ~ age + condition

Thus, if you want to adjust for more covariates, just use something like:

~ age + sex + smoking + condition

Then, when deriving test statistics, check the coefficient names via resultsNames(dds) in order to ensure that you extrapolate the correct stats.

Kevin

ADD COMMENT
1
Entering edit mode

thank you! Will try that.

ADD REPLY

Login before adding your answer.

Traffic: 580 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