Hi list members,
I have recently e-mailed this list asking for some advice on how to
use mixed-effects models on ordinal responses (see posts entitled "How
to use mixed-effects models on multinomial data"). This query concerns
the same data set, but since the topic is a different one, I post the
query under a different header.
Following several list members advice, I'm using a linear
mixed-effects model to analyse the data described in the earlier
posts, so I'm still working within this model framework. But when
trying to decide on the best-fitting model, I have run into a problem:
In the data set, there is a curved relationship between one of the
explanatory variables (i.e., the serial position of items in a list)
and the response variable. A model that includes both a linear and a
quadratic term for this variable would most likely describe this
relationship better than a model that includes only a linear variable.
But when I try to include the quadratic term in the model, using the
formula "lmer(y ~ x + I(x^2)", I get the following error message:
"Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
contrasts can be applied only to factors with 2 or more levels"
And the following warnings:
"In addition: Warning messages:
1: In Ops.factor(cposition, 2) : ^ not meaningful for factors
2: In Ops.factor(cposition, 2) : ^ not meaningful for factors"
Judging from the error message, the problem seems to be that I have
coded the serial position variable using the (default) contrast coding
system.