0

I've fit a linear mixed effects model with the lme4 package in R. I'm predicting a continuous outcome variable with two categorical fixed factors, direction (upwards/downwards) and utility (positive/neutral/negative), and Participant as a random factor. I want to test for the effect of direction, utility, and an interaction of the two on outcome, so I've written a model like so:

model <- lmer(outcome ~ direction * utility + (1|Participant), data = DF)

And the output looks like this:

Linear mixed model fit by REML ['lmerMod']
Formula: outcome ~ direction * utility + (1 | Participant)
   Data: DF

REML criterion at convergence: 35381.7

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.5722 -0.5269 -0.2075  0.2518  5.8625 

Random effects:
 Groups      Name        Variance Std.Dev.
 Participant (Intercept)  5.832   2.415   
 Residual                96.155   9.806   
Number of obs: 4761, groups:  Participant, 100

Fixed effects:
                           Estimate Std. Error t value
(Intercept)                  8.9769     0.3189  28.153
directionUpwards            -6.1652     0.2912 -21.172
utility.L                   -4.1623     0.3577 -11.635
utility.Q                   -3.0612     0.3668  -8.346
directionUpwards:utility.L   4.2283     0.5000   8.456
directionUpwards:utility.Q   3.6176     0.5049   7.165

Correlation of Fixed Effects:
            (Intr) drctnU utlt.L utlt.Q drU:.L
drctnUpwrds -0.473                            
utility.L   -0.068  0.076                     
utility.Q   -0.019  0.019 -0.070              
drctnUpw:.L  0.051  0.008 -0.720  0.049       
drctnUpw:.Q  0.015 -0.020  0.052 -0.720  0.011

What does the L and Q attached to utility in the output mean? Since they don't correspond to the possible values of utility, I'm unsure how to interpret this.

user72716
  • 263
  • 3
  • 22

2 Answers2

2

This is not lme4-specific.

These terms are the linear (L) and quadratic (Q) coefficients from an orthogonal polynomial contrast; this happens because utility has been defined as an ordered factor. If you had more levels of the factor they would be labeled C (cubic), 4, (quartic/4th-order), 5, etc.

If you want to go back to the ordinary behaviour of factors (i.e. treatment contrasts) you could convert utility back to unordered (data <- transform(data,utility=factor(utility,ordered=FALSE))) or use one of the various methods for specifying that you want treatment contrasts.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
2

The L and Q stand for Linear and Quadratic contrasts. By default, R does treatment contrasts for un-ordered factors and polynomial contrasts for ordered factors.

You can view the R contrasts like this

> options('contrasts')
$contrasts
    unordered      ordered
"contr.treatment"   "contr.poly"

It sounds like you were expecting treatment contrasts. You can change R's contrasts for ordered factors like this

> options(contrasts=c('contr.treatment','contr.treatment'))

Another option is to convert your factors to unordered. For example,

DF$direction = factor(DF$direction, ordered = FALSE)
Callin
  • 744
  • 3
  • 11