Skip to main content

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.

Filter by
Sorted by
Tagged with
21 votes
2 answers
25k views

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 <...
schvaba986's user avatar
14 votes
1 answer
5k views

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 ...
Joe King's user avatar
  • 3,865
11 votes
1 answer
20k views

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 ...
Ashley Asmus's user avatar
10 votes
1 answer
7k views

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), ...
Marcus Morrisey's user avatar
9 votes
1 answer
2k views

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. ...
jaminday's user avatar
  • 101
9 votes
0 answers
2k views

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 ...
Natalie's user avatar
  • 195
8 votes
2 answers
28k views

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 ...
Sam's user avatar
  • 83
8 votes
1 answer
8k views

Addressing "NOTE: Results may be misleading due to involvement in interactions" warning with Tukey post-hoc comparisons in lsmeans R package

Background: I am using linear mixed-effects models (LMMs) in order to determine how the interaction between two fixed effects influences measures of a response variable. Since I am working with a ...
skawano's user avatar
  • 83
7 votes
1 answer
444 views

Is the emmeans R package performing causal inference G-computation?

So I am trying to get an understanding of causal inference and how it differs from the usual contrasts. I regularly use the emmeans package in R, and I am wondering when the function emmeans() ...
Vattaka's user avatar
  • 232
7 votes
1 answer
887 views

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 ...
Marcus Morrisey's user avatar
7 votes
1 answer
7k views

Interpreting the standard error from emmeans - R

I am using the emmeans package to run post-hoc analysis on linear mixed models. The results provide what I would expect except for the standard error. I run the ...
J.Con's user avatar
  • 207
7 votes
2 answers
174 views

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, ...
user926321's user avatar
7 votes
1 answer
3k views

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, ...
Richard Hardy's user avatar
7 votes
1 answer
4k views

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 ...
Andrey Chetverikov's user avatar
6 votes
1 answer
331 views

multicomp package and emmeans package produce different adjust pvalues for Dunnett procedure [closed]

For Dunnett adjustment, multicomp package and emmeans package in R give different results. Anyone knows why? Thanks. Please see ...
user13154's user avatar
  • 1,173
6 votes
1 answer
2k views

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 ...
Finn's user avatar
  • 61
6 votes
1 answer
9k views

Pairwise comparisons via emmeans

I have a question about emmeans and mixed effect model. I fit a complex model using lmer() with the following variables: A: a binary categorical predictor, between-subject B: a binary categorical ...
Sarah's user avatar
  • 61
6 votes
1 answer
98 views
+50

Mean change scores analysis for studying natural course of disease

I investigating how vision (amongst other outcomes) changes over time, assessed at time 0, week 12 and week 24 in an observational cohort, and wanted to obtain the mean change values at each time ...
s.stats's user avatar
  • 467
5 votes
2 answers
210 views

Confidence interval in logistic regression when probability of success is 1

I have a dataset in which I measure some probability of success using a logistic regression approach. In one of the levels of the predictor variable, all observations were a success (or 1). When I ...
Stefan's user avatar
  • 6,491
5 votes
2 answers
1k views

SE for estimated marginal means

...
locus's user avatar
  • 1,623
5 votes
2 answers
3k views

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 ...
Vattaka's user avatar
  • 232
5 votes
1 answer
5k views

How are the degrees of freedom in the emmeans package calculated? - R

Let us look at some sample data for 5 hypothetical subjects. ...
Joshua's user avatar
  • 145
5 votes
1 answer
383 views

Does the P value adjustment for Tukey method in emmeans differ between "between group" and "within group"

This is the emmeans output of my lmer() model. I want to report this in a written format. I have two groups, where each did a pre and posttest, as well as ...
Simen Leithe Tajet's user avatar
5 votes
1 answer
6k views

How to calculate Tukey-adjusted p-values for emmeans pairwise comparisons?

I would like to calculate Tukey-adjusted p-values for emmeans pairwise comparisons. I know that these can be obtained directly with functions like pairs() and CLD(). However, when there are three ...
ecoagronomist's user avatar
5 votes
1 answer
1k views

compare differences between conditions with emmeans

With the following model ...
locus's user avatar
  • 1,623
5 votes
1 answer
4k views

Standard error all the same in lsmeans on a mixed model [duplicate]

I am running lsmeans to determine the means and standard error for each group within a 4x3 experiment, consisting of three subject types and four treatments. When I run the following it does display ...
choppedpete's user avatar
5 votes
2 answers
173 views

No variance in binomial glmer yields problematic CI

I have a glmer with a binomial response variable and two binary predictor variables, where there are no observations for one of the four groups. I used ...
Raoul Van Oosten's user avatar
5 votes
1 answer
3k views

When to correct for multiple comparisons (with specific reference to emmeans in R)?

I notice that emmeans::emmeans() will only correct for multiple comparisons within groups and not between groups. This means that if you perform a series of ...
pomodoro's user avatar
  • 803
5 votes
0 answers
186 views

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 ...
Stefan's user avatar
  • 6,491
5 votes
0 answers
750 views

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 ...
Beth's user avatar
  • 51
4 votes
2 answers
7k views

Units of emmeans output?

I have values of relative humidity on a scale of 0 to 1 (e.g., 0.9 = 90% RH). I also have two cities (A or B). My model is as follows: ...
Noraa Zamliy's user avatar
4 votes
2 answers
1k views

Why does GLM with Gaussian family give different results to LM in R?

From what I understand GLM with a gaussian family should give the same results as LM in R, because they're essentially the same thing (from reading other posts). When I run both on my data I get ...
Jessica Harvey-Carroll's user avatar
4 votes
2 answers
668 views

Is it preferable to subset data to test specific hypotheses or specify a full model and run contrasts?

Let's say I have a 2x2 design where participants are either in condition A or condition B and, within each condition, either get exposed to exposure C or exposure D. First, I want to test whether ...
Parseltongue's user avatar
  • 1,010
4 votes
1 answer
693 views

Contradiction between emmeans and t.test in R

I am analyzing two within-subject categorical variables (Factor A and Factor B) in R. Using linear mixed effects, I got a significant interaction. When I start to analyze the simple effect, I firstly ...
Buffoon's user avatar
  • 143
4 votes
2 answers
595 views

Why are p-values in clinical trials often based off of LSmeans

Very often I see clinical trials quoting p-values based upon the differences in treatment effects using the LSmeans. To improve my understanding of this I attempted to learn how to calculate LSmeans ...
gowerc's user avatar
  • 800
4 votes
2 answers
2k views

Difference between confidence intervals and comparison arrows

I am using the R package lsmeans. On page 10 of the vignette (pdf), a way to show the comparisons between groups is described using: ...
gabboshow's user avatar
  • 683
4 votes
1 answer
319 views

Is it appropriate to present predicted probabilities from emmeans for a mixed-effects binomial logistic regression?

I am trying to understand how to analyze data for a generalized mixed model (GLMM) with a binary response. I am interested in visualizing the predicted probabilities, as well as a measure of effect ...
user398696's user avatar
4 votes
1 answer
849 views

R pairs function, adjust, tukey/tukey-kramer?

In the 'pairs' function when doing pairwise comparisons after emmeans, tukey is set as default for adjustment of p-values. But what type of tukey is used, is it tukey-kramer? How can I know this? If ...
user11916948's user avatar
4 votes
1 answer
4k views

In emmeans package, how to exclude certain uninteresting contrasts from pairwise comparisons

Let's say I run the following contrast: ...
Parseltongue's user avatar
  • 1,010
4 votes
1 answer
938 views

Different ways to include pre-test performance as a covariate in a linear mixed-effect regression. Which is correct?

I have a pre-post experimental design, where I have measured participants' performance in three courses (tasks; A, B, C) at both pre and post-test. The study is a learning experiment. 60 elite alpine ...
Cmagelssen's user avatar
4 votes
1 answer
4k views

Unclear why "adjust = "tukey" was changed to "sidak""

I noticed a strange behavior for cld function when making multiple comparisons. When I use cld(EMM, adjust = "tukey") ...
Diego Pujoni's user avatar
4 votes
1 answer
316 views

Why are emmip( "response") y axis numbers not probabilities for ordinal regression?

I used emmeans functions (with help from this site) to obtain pairwise comparisons for different levels of variables in a model with interactions. Interpreting an ...
Milo's user avatar
  • 315
4 votes
1 answer
524 views

Reproducing output from emmeans R package

I'm trying to better understand estimated marginal means for relatively simple linear models. To do so, I'm using the very nice emmeans as a reference but also ...
Zoë Clark's user avatar
4 votes
1 answer
283 views

Adjustment for multiple comparisons in complex cases

I use the emmeans package for post-hoc pairwise comparisons with different types of models. Standard contrast families are e.g. ...
jkd's user avatar
  • 384
4 votes
1 answer
263 views

How to do post-hoc analysis with contrasts of a TOBIT model (censReg package)?

I have 4 groups of animals that did a task on four consecutive days. The variable of interest was latency, which was censored at 60 seconds. I fit a mixed effects linear censored regression model as ...
Uki Buki's user avatar
  • 101
4 votes
0 answers
1k views

Seeking a post-hoc test for zero-inflated glmmTMB [closed]

I am attempting to use glmmTMB modelling zero-inflated count data following the example in Mollie Brooks' and Ben Bolker's paper: https://www.biorxiv.org/content/biorxiv/suppl/2017/05/01/132753.DC1/...
user230075's user avatar
4 votes
0 answers
5k views

How to interpret lsmeans output for my lmer model?

I've defined an lmer model in R with 2 fixed effects, 2 random intercepts and a random slope: ...
jo81's user avatar
  • 41
3 votes
1 answer
5k views

Default pairwise test in emmeans

What test for pairwise comparisons does emmeans uses by default, when executing emmeans(model, pairwise~predictor)? As far as I can understand the Tukey method ...
Paul Bobyrev's user avatar
3 votes
2 answers
4k views

Is it appropriate to use estimated marginal means when model estimates are not significant but data is unbalanced?

Is it appropriate to use estimated marginal means when estimates (either interaction or main effects) are not significant but the data is unbalanced? I've come across variations of this question on ...
 S.Bird's user avatar
3 votes
2 answers
3k views

Analysis of interaction with multiple levels in each factor (emmeans in mixed model)

I ran an experiment with treatment (3 levels: ctrl, A, B) as a between-subject factor and environment (4 levels: 1, 2, 3, 4) as ...
Cuenco's user avatar
  • 77

1
2 3 4 5
7