0

I have specified a mixed effect linear model with lmer and I don't know how to specify the contrasts for it. In my data I have a Condition with two levels, while in each Condition I have 20-20 Players. In each condition I present 7 Scenarios which can be evaluated 7 times in Trials. Thus Condition and Scenario are fixed effects, with random effects Player and Trial, where Trials are nested inside each Scenario.

My model looks like this:

my_null.model <- lmer(value ~ Condition+Scenario+ (1+Scenario|Player) + 
                              (1|Scenario/Trial),   data = mydata, REML=FALSE, 
                      control=lmerControl(optCtrl=list(maxfun=50000))         )
my.model      <- lmer(value ~ Scenario*Condition + (1+Scenario|Player) + 
                              (1|Scenario/Trial), data = mydata, REML=FALSE, 
                      control=lmerControl(optCtrl=list(maxfun=50000))       )
anova(my_null.model, my.model)

I get significant ANOVA results, but I would like to know which Scenarios are different and which Trials as well.

I tried to use lsmeans from lmerTest, which outputs the Least Squares Means but I am not sure how to interpret the result.

Least Squares Means table:
        Scenario Est. Standard Err.  DF    t-value Lower CI Upper CI p-value
Scenario  1    1.0      47.46       3.44   38.1    13.79     40.5    54.4  <2e-16
Scenario  2    2.0      42.04       3.14   38.1    13.39     35.7    48.4  <2e-16
Scenario  3    3.0      61.22       3.63   38.4    16.85     53.9    68.6  <2e-16
Scenario  4    4.0      68.35       3.27   38.4    20.93     61.7    75.0  <2e-16
Scenario  5    5.0      24.81       3.11   38.0     7.97     18.5    31.1  <2e-16
Scenario  6    6.0      41.59       4.12   38.2    10.11     33.3    49.9  <2e-16
Scenario  7    7.0      78.65       3.28   38.4    23.97     72.0    85.3  <2e-16

And how do I compare the individual Trials?

Pio
  • 4,044
  • 11
  • 46
  • 81
  • You want to compare `Trials`? But you only have them set as random effects? Usually you don't make inferences on random effects. – MrFlick May 26 '14 at 02:09
  • Ohh, I see your point. I did analyze my data in the "traditional" way as well, by collapsing it through `Scenario` or `Trial` -- depending on what I wanted show. So I am not sure but I think that the p-values given by `lsmeans` mean that I got significant difference between the `Condition`s right? – Pio May 26 '14 at 10:33
  • 1
    According to the documentation of `lsmeans` from `lmerTest` they try to reproduce the results of `SAS PROC MIXED`. So looking at the [SAS documentation](http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_mixed_sect014.htm) it seems that the p-value there is from "an approximate t test to test the null hypothesis that the associated population quantity equals zero" – MrFlick May 26 '14 at 19:27
  • Thanks. Then I think this does not do what I wanted. – Pio May 27 '14 at 10:18

0 Answers0