Hello, I am performing DEG using edgeR. I am trying to design a matrix so that I can make comparisons control versus treated at different time points taking into account the baseline.
Replicates: 6 (i.e. 6 patients) Conditions: control(C) vs treated(F) Time: 0h (control: 6, which is the baseline(B)) #has only 6 2h (control: 6, treated: 6) 4h (control: 6, treated: 6) 6h (control: 6, treated: 6) 8h (control: 6, treated: 6)
patient= as.factor(rep(c(1:6),each=9))
treatment = factor(c( "B", "C", "F", "C", "F", "C", "F", "C", "F", "B", "C", "F", "C", "F", "C", "F", "C", "F", "B", "C", "F", "C", "F", "C", "F", "C", "F", "B", "C", "F", "C", "F", "C", "F", "C", "F", "B", "C", "F", "C", "F", "C", "F", "C", "F", "B", "C", "F", "C", "F", "C", "F", "C", "F"))
note- Basically B and C are both control. B just refers to something at 0h.
time = factor(c( "0h", "2h", "2h", "4h", "4h", "6h", "6h", "8h", "8h", "0h", "2h", "2h", "4h", "4h", "6h", "6h", "8h", "8h", "0h", "2h", "2h", "4h", "4h", "6h", "6h", "8h", "8h", "0h", "2h", "2h", "4h", "4h", "6h", "6h", "8h", "8h", "0h", "2h", "2h", "4h", "4h", "6h", "6h", "8h", "8h", "0h", "2h", "2h", "4h", "4h", "6h", "6h", "8h", "8h"))
design <- model.matrix(~treatment+treatment:time+patient)
y<-estimateGLMCommonDisp(y,design,verbose=TRUE)
error: Design matrix not of full rank. The following coefficients not estimable: treattypeF:8h
(To make sure if the error is because of 0h "B", I changed it to "C", making only 2 levels for treatments. I still get the same error.)
What am I doing wrong? -Thanks
Great! Thank you so much!