10

I am analyzing the eye-tracking data from a designed experiment. A simplified version of my data looks like this (You can get the dput() data here),

head(lookDATA)

  participant fixationImage fixationCount
1           9    Automobile            81
2           9          Bird            63
3           9         Chair            82
4           9           Dog            64
5           9          Face            90
6           9         Plant            75

where participant is a unique identifier for each subject, fixationImage is what picture category they fixated on, and fixationCount is the number of times they fixated on that picture category.

I fit a poisson model to the data using glmer() from the lme4 package.

model<-glmer(fixationCount ~ fixationImage + (1|participant), family = poisson, data = lookDATA)

I used lsmeans() from the lsmeans package to examine the differences among the factor levels,

cld(lsmeans(model,"fixationImage"))

which provides the following output:

fixationImage   lsmean         SE df asymp.LCL asymp.UCL .group
Chair         3.786022 0.05764923 NA  3.673018  3.899026  1    
Bird          3.866201 0.05750641 NA  3.753476  3.978925   2   
Dog           3.868768 0.05751010 NA  3.756037  3.981500   2   
Body          3.883644 0.06040952 NA  3.765230  4.002059   23  
Plant         3.893327 0.05746744 NA  3.780679  4.005975   23  
Automobile    3.901939 0.05745528 NA  3.789315  4.014563   23  
Face          3.946848 0.05832549 NA  3.832519  4.061178    3 

According to my (perhaps limited) understanding of the using lsmeans vignette the lsmean column should represent the average number of looks to a given category predicted by the model.

However, these values seem uncomfortably far from simple descriptive statistics for these numbers,

summaryBy(fixationCount ~ fixationImage, data = lookDATA)

  fixationImage fixationCount.mean
1    Automobile           55.18750
2          Bird           53.25000
3          Body           57.12821
4         Chair           50.39450
5           Dog           53.82883
6          Face           56.76389
7         Plant           54.71429

suggesting perhaps that I do not correctly understand what the lsmeans represent here, or perhaps that I've misspecified the model.

Any assistance would be greatly appreciated.

Marcus Morrisey
  • 1,056
  • 8
  • 20

1 Answers1

9

The output represents predictions from your model for each image. With the poison family, the default link function is the natural log - so those values are on the log scale. If you do lsmeans(..., type = "response"), it will back-transform the predictions to the original response scale.

Russ Lenth
  • 15,161
  • 20
  • 53
  • Thanks so much for the swift answer. I changed my syntax to cld(lsmeans(model,"fixationImage",type="response")) but got the following error: Error in `$ – Marcus Morrisey Apr 26 '15 at 21:59
  • Update: Error persisted upon update to R version 3.2.0 (2015-04-16), "Full of Ingredients" – Marcus Morrisey Apr 26 '15 at 22:24
  • 2
    I'm not sure why the error occurs but it looks like it comes from the `cld` side of things. Take it out and see if it works. And use `pairs` instead of cld to test the comparisons (in a separate call). That's a better route anyway because cld makes black-and-white decisions. – Russ Lenth Apr 26 '15 at 22:59
  • Thanks again. You were correct, functions fine outside of cld(). I agree with your assessment about the superiority of pairs(). I plan to use the cld() output for plotting and include a table with the more detailed information from pairs() in the supplementary materials. Awesome package, keep up the great work. – Marcus Morrisey Apr 26 '15 at 23:12
  • 3
    @MarcusMorrisey I have fixed the bug in `cld` that created the error. **Thanks for reporting it.** Send me an e-mail (see Maintainer field) if you want me to send the updated package. Else it'll be updated on CRAN in a few weeks. – Russ Lenth Apr 27 '15 at 16:01