R: Calculates Least Squares Means and Confidence Intervals for...

lsmeansLT {lmerTest} | R Documentation

## Calculates Least Squares Means and Confidence Intervals for the factors of a fixed part of mixed effects model of lmer object.

### Description

Produces a data frame which resembles to what SAS software gives in proc mixed statement. The approximation of degrees of freedom is Satterthwate's.

### Usage

    lsmeansLT(model, test.effs = NULL, ddf="Satterthwaite",  ...)

### Arguments

`model` | linear mixed effects model (lmer object).
`test.effs` | charachter vector specyfying the names of terms to be tested. If NULL all the terms are tested.
`ddf` | By default the Satterthwaite's approximation to degrees of freedom is calculated. If ddf="Kenward-Roger", then the Kenward-Roger's approximation is calculated using `KRmodcomp` function from pbkrtest package. If ddf="lme4" then the anova table that comes from lme4 package is returned
`...` | other potential arguments.

### Value

Produces Least Squares Means (population means) table with p-values and Confidence intervals.

### Note

This is a new name of the old function `lsmeans`. Reason for creating a new name is to not have conflicts with the `lsmeans` function of lsmeans package. For construction of the contrast matrix popMatrix function from doBy package was used.

### Author(s)

Alexandra Kuznetsova, Per Bruun Brockhoff, Rune Haubo Bojesen Christensen

### References

doBy package, gplots package

### See Also

`step`, `rand`, `difflsmeans`

### Examples

    ## import lme4 package and lmerTest package
    library(lmerTest)

    ## specify lmer model
    m1 <- lmer(Informed.liking ~ Gender*Information +(1|Consumer), data=ham)

    ## calculate least squares means for interaction Gender:Information
    lsmeansLT(m1, test.effs="Gender:Information")

    m <- lmer(Coloursaturation ~ TVset*Picture + (1|Assessor), data=TVbo)
    plot(lsmeansLT(m))
    lsmeansLT(m, test.effs="TVset")

[Package lmerTest version 2.0-33 Index]