1
$\begingroup$

I am currently trying to fit a model for some reaction time data from an experiment with four consecutive blocks of the same task. I am interested whether there is something like an effect of practice (linear trend) over time or even something like a quadratic trend given the possibility that subjects' performance increases in the beginning of the experiment due to practice, and decreases towards the end of the experiment when they start to get bored/ tired/ whatever.

Thus, I have specified three contrasts for the block factor of my experiment (consisting of four levels): one linear contrast, one quadratic contrast and one "null" contrast since I did not want to analyze a cubic trend, which, given the four blocks, is possible:

contrasts(df$block) = cbind(linear = c(-3,-1,1,3), quadratic=c(1,-1,-1,1), null = c(0,0,0,0))

model = lmer(rt ~ somewithinsubjectsfactor+block +(1|subject), data = df, REML = FALSE)

However, this gives me the following warning:

fixed-effect model matrix is rank deficient so dropping 2 columns / coefficients

which disappears when in addition to the linear and quadratic contrast I specify a cubic contrasts such as

contrasts(df$block) = cbind(linear = c(-3,-1,1,3), quadratic=c(1,-1,-1,1), cubic= c(-1,3,-3,1))

thus defining all possible polynomial contrasts for the four levels of the block factor.

My questions are:

  1. What does rank deficiency mean in this case? I have read that I might have too little data to estimate all the coefficients I am interested in, which does not seem to make sense to me here, since I do not get the warning when I specify the cubic contrast (i.e. an additional coefficient that has to be estimated).

  2. Does the warning imply a serious threat to the reliability of the parameter estimation, meaning that I need to specify all possible contrasts for a given factor in order "to be safe"? Or is it just fine the way I do it.

(Of course, one might ask: "Why don't you just go ahead and specify all three contrasts? After all, in that case you do not get a warning and furthermore you might get results about some cubic trend that you didn't expect but might be highly interesting." Yet, this question is of a more general interest to me, in the sense that I would like to learn about the definition of polynomial trend analysis and rank deficiency, and that is why I am asking.

Thanks in advance for any answers provided!

$\endgroup$

1 Answer 1

2
$\begingroup$

Adding your null contrast is the same as including a predictor that is equal to zero for all observations. It gets thrown out because it can't help predict anything. The contrasts specs really tell lmer how to parameterize the four levels of the factor, so it needs a way of defining three degrees of freedom for your block effect.

I suggest that you leave the contrasts unspecified (so it just uses the default) and use the lsmeans package on the fitted model to get the results for contrasts.

library(lsmeans)
model.lsm <- lsmeans(model, "block")
contrast(model.lsm, "poly", degree = 2)
$\endgroup$
3
  • $\begingroup$ Thanks, rvl, for the comment. I did not know the function lsmeans() before and it seems nice for factors the effects of which do not depend on other factors. However, I'm additionally interested in interactions of "block" with personality traits, and for these analyses, lsmeans() gives me a warning that contrast estimates might be unreliable. However, I was aware before that specifying a null contrast was the same as using a factor with four equal factor levels and that it cannot predict anything. Alas, I remain confused about the term "rank deficiency". Perhaps, it only means the above said? $\endgroup$
    – bunsenbaer
    Commented Sep 17, 2014 at 10:20
  • $\begingroup$ You get the warning because you are averaging over the levels of a factor that interacts with the one in question. You should look at (e.g., plot) the LS means for the combinations of those factors, and make sure that makes sense. Actually, I am a bit concerned about what you're doing with 'block'. Is it really a blocking factor? Usually, blocking factors are nuisance variables that we are not interested in - and usually, interactions with blocking factors are somewhat problematic. $\endgroup$
    – Russ Lenth
    Commented Sep 17, 2014 at 13:25
  • $\begingroup$ Excuse me for responding so late. In which (statistical) sense are interactions with blocking factors problematic? In my case, it is a reasonable assumption that persons scoring high on the trait I am interested in might "get bored/ lose motivation" faster than persons scoring only very weakly on that trait, hence showing a different profile of performance as the task proceeds. $\endgroup$
    – bunsenbaer
    Commented Sep 29, 2014 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.