[R-sig-ME] Assessing linearity

Mike Lawrence Mike.Lawrence at dal.ca
Sat Oct 23 23:19:49 CEST 2010

Hi folks,

I have developmental data collected across several grades (1-6). I
would like to be able to assess whether there are any linear or
non-linear trends across grade. Does it make sense to run a first lmer
treating grade as continuous, obtain the residuals, then run a second
lmer treating grade as a factor? That is:

fit1 = lmer(
    formula = response ~ (1|individual)+grade_as_numeric
    , data = my_data
    , family = gaussian
my_data$resid = residuals(fit1)
fit2 = lmer(
    formula = resid ~ (1|individual)+grade_as_factor
    , data = my_data
    , family = gaussian

As I understand it, fit1 will tell me if there are any linear trends
in the data, while fit2 will tell me if there are any non-linear
trends in the data in addition to the linear trends obtained in fit1.

If this is sensible, how might I apply it to a second binomial
response variable given that the residuals from a binomial model are
not 0/1?



Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University

Looking to arrange a meeting? Check my public calendar:

~ Certainty is folly... I think. ~

More information about the R-sig-mixed-models mailing list