order of covariates for GLM with edgeR
1
0
Entering edit mode
aec ▴ 70
@aec-9409
Last seen 13 months ago

Hi,

I would like to know if the order of the covariates when constructing the design matrix for edgeR software matters.

For example:

design = model.matrix (~0+sex+batch+condition)

is the same as :

design = model.matrix (~0+condition+sex+batch)

thanks,

2
Entering edit mode
Aaron Lun ★ 27k
@alun
Last seen 9 hours ago
The city by the bay

It won't affect dispersion estimation or fitting of the model, but it will affect how you parametrize your DE contrasts at the end. By default, glmLRT will drop the last coefficient; this will result in a different DE comparison between the two models, because the identity of the last term will be change when you mix up the order.

0
Entering edit mode

Ok, thanks for the clarification.