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
2 votes
2 answers
37 views

Test for interaction effect when contrasting specific timepoints in mixed-model

I'm having a mixed model (lmer in R) with 5 repeated measurements (time is categorical), and 6 groups, and several covariates. I'm mainly interested in seeing whether there is a significant difference ...
user avatar
  • 25
1 vote
1 answer
13 views

What is the scaling applied to Helmert contrasts in emmeans?

I'm trying to understand why the values under 'estimate' from an emmeans contrast function differ from those of the default 'Estimate' values from, say, 'summary.lm()' in R. As an example, let's use ...
user avatar
  • 113
2 votes
0 answers
43 views

Reconciling differences in CI calculated between SAS and R on same dataset

I have been given a brief of replicating statistical analysis which was done previously to verify results. Data being collected are body weights of male and female mice over 20 weeks, given a ...
user avatar
  • 555
0 votes
1 answer
26 views

Estimated marginal means against raw mean when only one predictor

I'm learning about estimated marginal means and I found this very interesting tutorial about it. I get almost all of it, especially the fact that with a multivariate analysis we can extract modelled ...
user avatar
3 votes
1 answer
56 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 ...
user avatar
1 vote
1 answer
21 views

What exactly is the test being done when running cld on emmeans, but there's only two means being compared?

Or is that not necessarily a reasonable approach? For example, my model is a linear mixed-effects model with only one explanatory variable, such that ...
user avatar
0 votes
1 answer
38 views

Blocking Binomial Data (Bernoulli Trials)

Imagine you have a colony of roaches and you want to compare the efficacies of two insecticides. On one day you apply insecticide A to 50 insects and record your "outcome" as "1" (...
user avatar
0 votes
0 answers
14 views

emmeans, should I use ML or REML fitted models [duplicate]

I see a lot of examples out there which use ML or REML fitted models as an input for emmeans. If I understand correctly for model comparison of fixed effects for "fixed effects nested models"...
user avatar
0 votes
1 answer
18 views

How to take a contrast of a contrast from an MMRM (least-squares means of a constrast)

I have an MMRM model of the form: ...
user avatar
0 votes
0 answers
11 views

How to compute Cohen's d and p-value for comparison of least squares mean from two different mixed models?

I have two randomly assigned treatment interventions (A and B), and two subgroups of individuals (X and Y). This is a longitudinal study with dropout. I want to test whether the outcomes of ...
user avatar
  • 21
1 vote
1 answer
34 views

huge degrees of freedom for post-hoc tests of lmer model using emmeans

I have a trial-wise linear mixed model with a categorial between-subjects factor group (A vs B) and two categorical within-subjects factors itemEmotion (neutral vs. negative) and neuralArea (frontal ...
user avatar
  • 45
1 vote
2 answers
65 views

How to do a follow-up comparisons/contrasts for a 3-way interaction with 2 numeric predictors?

I am having a hard time doing follow-up (post-hoc) comparisons for a 3-way interaction of 2 numeric predictors and one factor in a linear mixed model. It’s a longitudinal study where we have patients ...
user avatar
0 votes
0 answers
76 views

How to obtain contrasts for constrained longitudinal data analysis?

I would like to apply a constrained longitudinal data analysis (cLDA) with a linear response variable of the form, y ~ Time + Treatment:Time + (1 | ID). I am using &...
user avatar
  • 165
0 votes
1 answer
78 views

emmeans properly conducts multiple comparison for one glmmTMB model but not the other

I have two datasets from different years. They are structured almost identically. One is substantially larger than the other and has more time points. When I prepare a negative binomial generalized ...
user avatar
0 votes
0 answers
85 views

Differing confidence intervals between ggpredict() and ggemmeans() when REML = TRUE in glmmTMB beta regression

I am using the package ggeffects to estimate marginal effects and confidence intervals for a beta regression model fit with glmmTMB. I notice the estimates differ ...
user avatar
  • 77
1 vote
1 answer
16 views

ANCOVA with common zero level

There is a similar, if not duplicate, question from 9 years ago on this but it never got answered so I'm hoping to get some clarity on this. Let's say we have N ...
user avatar
  • 123
0 votes
0 answers
19 views

Df calculations seem off in lmer with 3-level categorical predictor comparison

This is a MLM analysis of a physiological variable (so big dataset) with a time x condition fixed effect, where condition has 3 levels. Model code is: ...
user avatar
0 votes
1 answer
83 views

Probing categorical (3 levels) x continuous var with emmeans

I am trying to probe the following significant interaction between Condition (categorical, three levels) and time (continuous) using R emmeans package: Original formula for the model was: ...
user avatar
0 votes
0 answers
59 views

Error in post-hoc analysis on gamlss model with emmeans: "Error in V[idx, idx, drop = FALSE] : subscript out of bounds"

I am utilizing gamlss currently because of its flexibility in specifying 'rarer' data families but run into an error when trying to compare 2-by-2 differences in mu effects for my fixed model factors. ...
user avatar
0 votes
0 answers
42 views

pairwise comparisons, emmeans or by hand

I have an lmer model with one categorical variable and several continuous variables. The results are as follows: ...
user avatar
  • 35
0 votes
0 answers
84 views

exploring interactions with multiple factors using lmer and emmeans

...
user avatar
  • 905
0 votes
0 answers
10 views

Running contrast after a contrast in emmeans

I've been using emmeans for quite some time, read all the vignettes, and still can't wrap my head around it at times. Let's say I have the following: ...
user avatar
0 votes
1 answer
45 views

Linear mixed models - interaction between scenario and group with four levels - how to inspect

I have data with which I inspect if there is a difference between two scenarios in experienced temporal demands. In addition, there are four different roles (AO, RO, TO, VP) participants are assigned. ...
user avatar
  • 87
0 votes
1 answer
32 views

emmip() - what does the y-axis represent when an offset was included

I used emmip() to create a graph showing an interaction-style plot. In the model (GLMM, poisson distribution) that I fed into the graph the dependent variable (number of visits, count) was adjusted by ...
user avatar
  • 51
1 vote
0 answers
71 views

Pairwise comparison of survival curves

I'm working with data on the effect of different diets and disease ratios in the survival of ant colonies, and I'm looking for a good way to compare the different treatments to the control (no ...
user avatar
0 votes
1 answer
53 views

Different p-values for simple slope analysis after dummy coding and contrast coding using robust lmer

I want to average the effect of some continuous predictors on the outcome variable and so I used contrast coding as here (https://towardsdatascience.com/how-to-correctly-interpret-your-continuous-and-...
user avatar
  • 11
0 votes
1 answer
12 views

percentage of difference with estimated marginal means

I am calculating the difference between concentration of different metabolites according to the factor sex (male/female) and age group (<55 / >=55) from this linear model: ...
user avatar
  • 1
0 votes
0 answers
135 views

Interpreting p-value from GLMMTMB model

I'm analyzing count data from an experiment, where I want to study whether colonies of ants with different ratios (0, 50 100) of infected workers have different foraging activities. I am using the ...
user avatar
3 votes
2 answers
302 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 ...
user avatar
0 votes
0 answers
69 views

lsmeans for a piecewise linear mixed-effects model on r

I am trying to figure out how to obtain lsmeans for a piecewise linear mixed-effects model (fitted with the nlme package) with random intercepts and slopes. My data represent math scores from a group ...
user avatar
  • 1
0 votes
1 answer
36 views

ANCOVA by SPSS with outliers and non-homogeneity

I’m working on ANCOVA to compare post- vs. pre-treatment percentage change of a blood test value, L, between 10 groups (10 dosages from 3 drugs all of which can lower L), with the pre-treatment (...
user avatar
1 vote
1 answer
84 views

How to calculate percentage difference of geometric means with emmeans?

I want to estimate the estimated marginal means (EMMs) of a log-normal variable across different groups. Let’s take the dataset of pigs from ...
user avatar
  • 11
0 votes
0 answers
18 views

How to get adjusted means?

I noticed that some authors reported adjusted means of the outcomes in RCT results. I know that the adjusted means can be obtained using the package emmeans, but I still have some concerns about how ...
user avatar
  • 11
0 votes
1 answer
14 views

nlme model specification and estimation of empty cells using emmeans

I have a data set with 20 users who were exposed to three levels and two variants (except the low level was only exposed to one variant). There are two measurements for each combination. Below are ...
user avatar
  • 6,360
0 votes
0 answers
163 views

Emmeans and 95% confidence intervals for linear mixed models (two center study)

I am having problems estimating emmeans and 95% CI per group with linear mixed models. I have put my questions at the end of my post. In short, I want to compare a continuous outcome between 7 groups ...
user avatar
  • 1
0 votes
0 answers
9 views

Reading tables containing least-square means and their differential Pairwise comparisons

How should Mixed Procedure output tables called least-square means and their differential Pairwise comparisons be read, interpreted, and reported? Please guide me by giving an example and introducing ...
user avatar
0 votes
1 answer
49 views

Obtaining log-odds coefficients instead of proportions in output of post-hoc tests in emmeans package

I got in trouble for posting this on Stack Overflow a few days ago. It seemed to me more of a coding question than a statistical question (i.e. what argument to use in the ...
user avatar
  • 1,461
0 votes
1 answer
105 views

emmeans ignoring `adjust`

I am running a gls on a repeated measures design. I am trying to check if my contrasts are being adjusted but I am failing to get any adjustment using either ...
user avatar
3 votes
1 answer
259 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 ...
user avatar
0 votes
1 answer
34 views

doubts about emmeans and post hoc comparison in a nesting variable

Good day, I have a doubt about emmeans, Im doing research in two parks, in each park I have a county and in each county, I have three habitats and on each habitat, I have collected beetles (Count ...
user avatar
1 vote
1 answer
617 views

Interpretation of emmeans table

I have a question about emmeans Variables are A = {a1, a2, a3}, B= {b1, b2}, C = {c1, c2} Model ~ A+B+C+A * B+A * C+C * B One of research questions: Is there an effect of C on a1, a2 und a3 (A)? And ...
user avatar
  • 49
0 votes
0 answers
82 views

Estimated marginal means with emmeans

I have a mixed linear model, for example, Model <- Values ~ A + B + C + (1 | id) + A:B + A:C + B:C I wanted to do analysis with "emmeans" a.k.a estimated marginal means, so I used these ...
user avatar
  • 49
3 votes
1 answer
63 views

Difference in slope in longitudinal study

I have a longitudinal study where subjects are measured at given time points and a response is recorded. Each subject belongs to one of three groups (A, B, C) and I'm interested in whether the slope ...
user avatar
  • 3,110
0 votes
0 answers
191 views

Estimated marginal means for repeated measures ANOVA in r

I am trying to extract estimated marginal means for a repeated measures ANOVA. But I get a warning and can't /don't know how to extract the time factor. ...
user avatar
0 votes
0 answers
132 views

emmeans post-hoc comparison of model with interaction and control variables

I am using this mixed model including fixed effects and random intercepts and slopes: ...
user avatar
  • 1
0 votes
0 answers
91 views

Obtain confidence interval for the mean in gamlss using emmeans?

In many distributions available in gamlss, the mu parameter does not correspond to the mean of the distribution. Would it be ...
user avatar
0 votes
0 answers
37 views

Interpretation of discrepancies between contrasts comparisons in lmer and emmeans

I have the following model with 4 levels under the Group factor variable and 3 levels under Cue_Type. ...
user avatar
  • 1
1 vote
0 answers
69 views

Fixed effects and contrasts in MGCV with factor smooths

I was planning on running a Negative Binomial GAM as follows using various factor smooths: $$ log(\mu_i)=s(D,by=Group)+s(Longitude,Latitude,by=Group)+x_0+x_1+x_2+Group+Treatment $$ If I run a GAM ...
user avatar
0 votes
0 answers
29 views

post-hoc tests for a GLMM with polynomial term

I have count data (winter bud production) from a greenhouse experiment in which 48 plant genotypes were subjected to 4 salinity treatments ranging from low to high salinity. For optimal model fitting ...
user avatar
1 vote
0 answers
167 views

emmeans: compare treatment effect across two levels of a category

I want to compare the difference between treatment and placebo across two levels of a factor, lets say gender. This, to answer the question whether there is a significant difference in treatment ...
user avatar
  • 121

1
2 3 4 5