In my current research project, I am looking at the impact of different within-subject experimental manipulations on distance perception. The experiment comprised 40 subjects each providing 144 observations.
I have a 2(Condition)x4(Groups)x3(Delay)design.
I have converted each factor into a complete set of orthogonal contrasts as following :
Condition <- cond(-1, 1)
Groups <- gr34(0,0,-1,1) ; gr12(-1,1,0,0) ; grsq(-1,1,1,-1)
Delay <- D1(-1,0.5,0.5) ; D23(0,-1,1)
Since removing outliers resulted in unbalanced data, I opted for a mixed-effect approach using lmer
function :
lmemesr <- lmer(CoefVeryClean~Cond+Gr34+Gr12+Grsq+D1+D23+Cond*Gr34+
Cond*Gr12+Cond*Grsq+Cond*D1+Cond*D23+Gr34*D1+Gr34*D23+Gr12*D1+
Gr12*D23+Grsq*D1+Grsq*D23+Cond*Gr34*D1+Cond*Gr34*D23+Cond*Gr12*D1+
Cond*Gr12*D23+Cond*Grsq*D1+Cond*Grsq*D23 +
(Cond+Gr34+Gr12+Grsq+D1+D23+Cond*Gr34+Cond*Gr12+Cond*Grsq+
Cond*D1+Cond*D23+Gr34*D1+Gr34*D23+Gr12*D1+Gr12*D23+
Grsq*D1+Grsq*D23+Cond*Gr34*D1+Cond*Gr34*D23+
Cond*Gr12*D1+Cond*Gr12*D23+Cond*Grsq*D1+
Cond*Grsq*D23|Participant), data = DataMR,
na.action = na.exclude,
control = lmerControl(optimizer = "nloptwrap", calc.derivs = FALSE))
Calling the function returns
fixed-effect model matrix is rank deficient so dropping 6 columns / coefficients
And it appears that all predictors containing the Grsq
variable were dropped.
Could somebody explain why this is the case and how I can fix this issue since this particular contrast is of great interest to me ?
Here is my data frame
structure(list(Participant = c(1, 1, 1, 1), CoefVeryClean =
c(-0.333333333333333,
-0.4, -0.4, 0.142857142857143), Cond = structure(c(2L, 2L, 2L,
2L), .Label = c("-1", "1"), class = "factor"), Gr34 = structure(c(2L,
2L, 1L, 3L), .Label = c("-1", "0", "1"), class = "factor"), Gr12 = structure(c(3L,
1L, 2L, 2L), .Label = c("-1", "0", "1"), class = "factor"), Grsq = structure(c(2L,
1L, 2L, 1L), .Label = c("-1", "1"), class = "factor"), D1 = structure(c(1L,
1L, 1L, 1L), .Label = c("-1", "0.5"), class = "factor"), D23 = structure(c(2L,
2L, 2L, 2L), .Label = c("-1", "0", "1"), class = "factor"), ConGr34 = structure(c(2L,
2L, 1L, 3L), .Label = c("-1", "0", "1"), class = "factor"), ConGr12 = structure(c(3L,
1L, 2L, 2L), .Label = c("-1", "0", "1"), class = "factor"), ConGrsq = structure(c(2L,
1L, 2L, 1L), .Label = c("-1", "1"), class = "factor"), ConD1 = structure(c(1L,
1L, 1L, 1L), .Label = c("-1", "-0.5", "0.5", "1"), class = "factor"),
ConD23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1", "0",
"1"), class = "factor"), Gr34D1 = structure(c(3L, 3L, 5L,
1L), .Label = c("-1", "-0.5", "0", "0.5", "1"), class = "factor"),
Gr34D23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1", "0",
"1"), class = "factor"), Gr12D1 = structure(c(1L, 5L, 3L,
3L), .Label = c("-1", "-0.5", "0", "0.5", "1"), class = "factor"),
Gr12D23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1", "0",
"1"), class = "factor"), GrsqD1 = structure(c(1L, 4L, 1L,
4L), .Label = c("-1", "-0.5", "0.5", "1"), class = "factor"),
GrsqD23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1", "0",
"1"), class = "factor"), CondGr34D1 = structure(c(3L, 3L,
5L, 1L), .Label = c("-1", "-0.5", "0", "0.5", "1"), class = "factor"),
CondGr34D23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1",
"0", "1"), class = "factor"), CondGr12D1 = structure(c(1L,
5L, 3L, 3L), .Label = c("-1", "-0.5", "0", "0.5", "1"), class = "factor"),
CondGr12D23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1",
"0", "1"), class = "factor"), CondGrsqD1 = structure(c(1L,
4L, 1L, 4L), .Label = c("-1", "-0.5", "0.5", "1"), class = "factor"),
CondGrsqD23 = structure(c(2L, 2L, 2L, 2L), .Label = c("-1",
"0", "1"), class = "factor")), row.names = c(NA, 4L), class = "data.frame")