Learn R Programming

lmerTest (version 2.0-6)

difflsmeans: Calculates Differences of 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 for degrees of freedom is Satterthwaite's.

Usage

difflsmeans(model, test.effs=NULL, method.grad="simple",...)

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.
method.grad
approximation method for the grad function, which is used in calculation of denominator degrees of freedom. Could be "simple" or "Richardson". "simple" is the default and the faster one.
...
other potential arguments.

Value

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

See Also

lsmeans, step, rand

Examples

Run this code
#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
difflsmeans(m1, test.effs="Gender:Information")

#import TVbo data from lmerTest package
data(TVbo) 

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

Run the code above in your browser using DataLab