Can someone help with making this design full rank and thereby fix this error:
Coefficients not estimable: GroupPlacebo GenderMale
Does anyone know how to fix this so I can run as contrasts:
cont.matrix = makeContrasts(
ana1=GroupGroup1-GroupPlacebo,
ana2=(GroupGroup1-GenderFemale)-(GroupGroup1-GenderMale),
levels=m)
Many thanks for your time in advance
(Intercept) GroupGroup1 GroupGroup2 GroupGroup3 GroupPlacebo GenderFemale GenderMale
101_Day1 1 0 0 1 0 1 0
102_Day1 1 0 0 1 0 0 1
103_Day1 1 0 0 1 0 0 1
104_Day1 1 0 0 0 1 1 0
105_Day1 1 0 0 1 0 1 0
106_Day1 1 0 0 0 1 0 1
107_Day1 1 0 0 1 0 1 0
108_Day1 1 0 0 1 0 1 0
109_Day1 1 0 0 1 0 1 0
110_Day1 1 0 0 0 1 1 0
111_Day1 1 0 0 1 0 0 1
112_Day1 1 0 0 1 0 0 1
113_Day1 1 0 0 0 1 0 1
114_Day1 1 0 0 1 0 0 1
115_Day1 1 0 0 1 0 0 1
116_Day1 1 0 0 1 0 1 0
117_Day1 1 0 0 1 0 0 1
118_Day1 1 0 0 0 1 1 0
119_Day1 1 0 0 1 0 0 1
120_Day1 1 0 0 1 0 1 0
201_Day1 1 0 0 0 1 0 1
202_Day1 1 0 1 0 0 0 1
203_Day1 1 0 1 0 0 0 1
204_Day1 1 0 1 0 0 0 1
205_Day1 1 0 1 0 0 1 0
206_Day1 1 0 0 0 1 1 0
207_Day1 1 0 1 0 0 0 1
208_Day1 1 0 1 0 0 0 1
209_Day1 1 0 1 0 0 0 1
210_Day1 1 0 1 0 0 1 0
211_Day1 1 0 0 0 1 0 1
212_Day1 1 0 1 0 0 0 1
213_Day1 1 0 1 0 0 0 1
214_Day1 1 0 0 0 1 1 0
215_Day1 1 0 1 0 0 1 0
216_Day1 1 0 1 0 0 1 0
217_Day1 1 0 1 0 0 0 1
218_Day1 1 0 1 0 0 1 0
219_Day1 1 0 0 0 1 0 1
220_Day1 1 0 1 0 0 1 0
301_Day1 1 1 0 0 0 1 0
302_Day1 1 1 0 0 0 0 1
303_Day1 1 0 0 0 1 1 0
304_Day1 1 1 0 0 0 1 0
305_Day1 1 1 0 0 0 1 0
306_Day1 1 0 0 0 1 1 0
307_Day1 1 1 0 0 0 1 0
308_Day1 1 1 0 0 0 1 0
309_Day1 1 1 0 0 0 1 0
310_Day1 1 0 0 0 1 0 1
311_Day1 1 1 0 0 0 1 0
312_Day1 1 1 0 0 0 0 1
313_Day1 1 1 0 0 0 1 0
314_Day1 1 1 0 0 0 1 0
315_Day1 1 0 0 0 1 0 1
316_Day1 1 1 0 0 0 1 0
317_Day1 1 1 0 0 0 0 1
318_Day1 1 1 0 0 0 0 1
319_Day1 1 0 0 0 1 0 1
320_Day1 1 1 0 0 0 0 1
attr(,"assign")
[1] 0 1 1 1 1 2 2
attr(,"contrasts")
attr(,"contrasts")$Group
Group1 Group2 Group3 Placebo
Group1 1 0 0 0
Group2 0 1 0 0
Group3 0 0 1 0
Placebo 0 0 0 1
attr(,"contrasts")$Gender
Female Male
Female 1 0
Male 0 1
m<- model.matrix( ~ Group + Gender , data=X, contrasts.arg = lapply(data.frame(X[,sapply(data.frame(X), is.factor)]),
contrasts, contrasts = FALSE))
Thank you for your time
Please use the formatting bar (especially the
code
option) to present your post better. You can use backticks for inline code (`text` becomestext
), or select a chunk of text and use the highlighted button to format it as a code block. Like I said before, please avoid using<pre>
tags - they override the site's syntax highlighting features.