Questions tagged [lsmeans]

Least-Squares means are predictions from a model over a regular grid, possibly averaged over other dimensions. Also use this tag for the R packages emmeans and lsmeans.

Least-Squares means are the means of predictions from a model over a regular grid, averaged over zero or more additional dimensions. In some contexts these are called "predicted marginal means", "covariate adjusted means", or "estimated marginal means", among other names.

The term originated with the work of Walt Harvey in the 1970s, and was adopted by SAS and later by other software. See this post for several references.

227 questions
17
votes
2 answers

Which multiple comparison method to use for a lmer model: lsmeans or glht?

I'm analyzing a data set using a mixed effects model with one fixed effect (condition) and two random effects (participant due to the within subject design and pair). The model was generated with the lme4 package:…
11
votes
1 answer

Post-hoc testing in multcomp::glht for mixed-effects models (lme4) with interactions

I am performing post-hoc tests on a linear mixed-effects model in R (lme4 package). I am using multcomp package (glht() function) to perform the post-hoc tests. My experimental design is repeated-measures, with a random block effect. The models are…
Ashley Asmus
  • 113
  • 1
  • 1
  • 5
10
votes
1 answer

Is least squares means (lsmeans) statistical nonsense?

I recently came accross this quote from Brian Ripley, who seems to be well-regarded as a statistician. "Some of us feel that type III sum of squares and so-called ls-means are statistical nonsense which should have been left in SAS" Brian…
Joe King
  • 3,024
  • 6
  • 32
  • 58
10
votes
1 answer

What does lsmeans report for a generalized linear model, such as Poisson mixed model (fit with glmer)?

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 …
Marcus Morrisey
  • 1,056
  • 8
  • 20
8
votes
0 answers

How to pool results from post hoc lsmeans analysis across multiple imputations with MICE

I have five imputed datasets created with MICE in R, and am running run some post hoc analyses using the lsmeans package. Although MICE has great functions to easily pool and compare models (e.g. pool() and pool.compare()), they won't work…
jaminday
  • 91
  • 2
7
votes
0 answers

Marginal means vs. marginal effects. What is the difference?

In R, there are two packages: emmeans and margins. The first implements the LS-means known from SAS, here called estimated marginal means, the second implements the margins command from Stata. I understand the idea of the LS-means (prediction on a…
7
votes
2 answers

huge difference between estimates of binomial regresssion when including random effect vs when not

I'm trying to estimate the average score for two groups of students. I use a binomial regression model. The total_ans is the total question they've have answered, which may be different for different students. Model 1 directly estimates model <-…
7
votes
1 answer

Setting custom three-way interaction contrasts in R

I have a lmer model with three-way interaction and I want to set up a specific contrast testing for the significance of two-way interaction on each level of the third variable. I can do it by hand with a simple model, but I was hoping that there…
7
votes
2 answers

lsmeans (R): Adjust for multiple comparisons with interaction terms

I have a lsmeans problem in R. I want to do a post-hoc analysis of an interaction, similar to examples provided in the lsmeans documentation. I am puzzled by the fact that the p-values are the same whether I use warp.lm <- lm(breaks ~ wool *…
Sam
  • 73
  • 1
  • 1
  • 5
7
votes
1 answer

Can anyone provide a peer reviewed reference for the calculation of least squares means as implemented in the R package lsmeans?

I am using the lsmeans package from the R programming language for follow up analyses of a linear mixed model. However, my target journal does not generally use these methods and I would like to have strong references to back my general approach as…
Marcus Morrisey
  • 1,056
  • 8
  • 20
6
votes
1 answer

What are LS means useful for?

I have recently learned about LS means (estimated marginal means, predicted marginal means) and I am trying to understand what they could be used for and under what circumstances. For concreteness, consider a dependent variable $y$ and two…
Richard Hardy
  • 54,375
  • 10
  • 95
  • 219
5
votes
1 answer

Distinct results between "emmeans" and "multcomp" - package in multi level model

I have calculated a multi-level model with a biomarker as dependent variable (which was measured three time), a 5-level factor variable called „module“ as predictor (which is an intervention including a control group) and several other…
Finn
  • 51
  • 1
5
votes
0 answers

data visualization following glmm in lmer

Everything I know about glmms is from the internet, and after extensive searching, I haven't come across a good clearcut guide for how to visualize your data in a way that is relevant to hypotheses and fits the model results. Essentially, if you…
Beth
  • 51
  • 2
4
votes
2 answers

Why are emmeans package means different than regular means?

I am analyzing a dataset with missing data using the lme4 package for fitting mixed models and calculating fitted means from it using package emmeans. I have a feeling it relates to the missing data but why are the means that emmeans displays…
Vattaka
  • 115
  • 7
4
votes
0 answers

Negative lower confidence limit in beta regression?

I fitted a beta regression on some proportion data using the betareg() function from the betareg package. The proportion was scaled using the ad-hoc scaling procedure recommended in the betareg vignette (Section 2; 1st…
Stefan
  • 4,977
  • 1
  • 18
  • 38
1
2 3
15 16