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
0
votes
0answers
10 views

Getting estimated marginal means from imputed pooled estimates from linear mixed models and marginal models in R [closed]

I'm running multilevel multiple imputation through the package mitml (using the panimpute() function) and am fitting linear mixed models and marginal models through the packages nlme and geepack and ...
1
vote
0answers
18 views

Standard error in estimated marginal means are all the same

I use the package emmeans to calculate estimated marginal means and I don't know why the standard errors are equal within the factors: ...
2
votes
0answers
47 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 margin command from Stata. I ...
2
votes
0answers
19 views

Pairwise Comparisons for Rank Based rfit Models in emmeans

I recently found this package: https://journal.r-project.org/archive/2012-2/RJournal_2012-2_Kloke+McKean.pdf. I am utilizing this package for Robust Regression without having to resort to M or MM-...
2
votes
1answer
39 views

Why do the calculated means in lm() differ from emmeans()?

Let's assume we have the data: ...
0
votes
0answers
14 views

LSMeans for repeated measures using GLM in SAS

I would like to obtain LSMeans comparisons for the within-subject factors of a repeated measures model using GLM. Here is an example ...
1
vote
1answer
75 views

Obtaining valid win probabilities from contest data using a binomial model

I conducted an enclosure experiment on lizards where I recorded contest outcome for every male-male combat. We had three morphs of lizards (o, w, y) in each enclosure. I am interested in obtaining ...
0
votes
0answers
8 views

Why Does emmeans add_grouping average over the levels of the reference factor?

I've implemented a learning technology to reduce the gender gap(the difference between male and female student grades) in CS education. I conducted a quasi-experiment across six semesters, with ~200 ...
1
vote
2answers
40 views

Slopes with opposing signs provided by two methods

I have come across a situation where I am estimating trends in two different ways and the results have opposite signs. Specifically, the R functions emtrends and <...
0
votes
0answers
34 views

Differences in LSMEANS in R vs SPSS

I am trying to replicate results from SPSS in R. The model is a repeated measure ANCOVA. Funny enough: all the estimated parameter are the same (beta-coefficients, mean differences for contrasts) but ...
1
vote
0answers
18 views

Fit one model or several models to maximize power for significance testing of slopes in a factorial design?

Problem I need to perform a power analysis for a set of statistical tests. Each test is about a regression slope computed in a cell of a factorial experiment design. To minimize the required sample ...
1
vote
0answers
23 views

Pairwise Contrast on relative change emmeans package

So I have it a Generalized Linear Mixed Model and am looking to do contrasts. However, in this case, the biochemically relevant contrast is not a simple difference of differences. It is the difference ...
1
vote
1answer
36 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 ...
3
votes
2answers
186 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 ...
0
votes
0answers
52 views

Are the posthoc results of the Linear Mixed Effect model valid?

I'm running a linear mixed model on a data frame that consists of 3 variables: ID (n=11), region (n=3) and ...
1
vote
2answers
115 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 ...
1
vote
0answers
39 views

How can I compute a confidence interval on Cohen's d derived from a Tukey HSD contrast?

Question Background Consider for example that I have some data arrayed as a 1-way (Group: A, B, C, D) between groups ANOVA. Consider further that I am interested in all possible pairwise contrasts ...
0
votes
1answer
64 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 ...
0
votes
0answers
11 views

lsmeans diff of a variable involved in an interaction

I have a variable that is a simple 0-1 variable in a class statement. It is also involved in interactions. In the model this class variable is not significant and I understand that I shouldn't ...
0
votes
0answers
35 views

Z ratio in lsmeans of a glmer

I am running a glmer (1 dependent variable and 2 independent variables (where each independent variable has 3 categories)). I am trying to look at the pairwise differences for the treatments (to see ...
1
vote
1answer
59 views

Incoherent post hoc pairwise Tukey test using beta binomial distribution and betareg()

I am fitting a beta binomial regression to my data, which is proportion data (lifetime reproductive success ratio) ranging [0,1]. I transformed the 0s and 1s following Smithson and Verkuilen 2006 (y.(...
1
vote
0answers
22 views

Reporting RESULTS of least square means as post-hoc test for linear mixed model- Best practice

Anybody have good example of how to report the results of a least square means result of a Linear mixed model?- I welcome any guidance on good practices to report this kind of result. I posted below ...
0
votes
0answers
59 views

On how to interpret paired comparisons for model-adjusted means in GLMM

I have been trying to learn how to obtain the model-adjusted means (or least-square means) from GLMM, and come across some counterintuitive results. Below is the data I am currently using. It's the ...
1
vote
2answers
56 views

Model simplification

I am currently looking at a linear mixed model of with the formula x ~ y * z I'm struggling with simplifying the model. When I run an ANOVA of my model it said ...
0
votes
1answer
36 views

R contradiction between lmer and emmeans results

In order to determine how herbivorous fish biomass varies between the two study sites (Waikiki and Hanauma Bay) and experimental shelter treatments (low and high), I used lmer() with a random effect ...
1
vote
1answer
31 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. ...
1
vote
1answer
51 views

How are contrasts tested when using estimated marginal means?

Forgive me for this, but I just can't work it out. Some dummy data : ...
1
vote
1answer
173 views

interactions involving two continuous predictors with emtrends

Let's say I have a model with two continuous predictors (nitrogen and temperature) and one categorical variable (variety). <...
0
votes
0answers
41 views

Why are the confidence intervals so large for the difference of differences?

I have run a generalized linear mixed effects model with the glmmTMB package to determine if there is an interaction between two categorical predictors, treatment and location, in predicting the ...
1
vote
2answers
146 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: ...
0
votes
1answer
87 views

How to address a detected nesting structure using emmeans

I'm analysing the results of a M BACI experiment. When trying to estimate means using emmeans, I'm getting this message: NOTE: A nesting structure was detected in the fitted model: BurnType %...
2
votes
1answer
42 views
0
votes
0answers
18 views

Why are my emmeans SE so large, but pairwise comparison SE are modest?

I constructed a glm logistic regression model for a binary response with two categorical predictors. I am calculating the emmeans for one of the two predictors, ...
0
votes
2answers
160 views

Understanding cov.reduce argument in emmeans function

I would appreciate any help regarding emmeans package. I am fitting dummy-variable regression model (ANCOVA) with follow-up post hoc test in ...
0
votes
1answer
53 views

Using pairwise comparision on gls object [closed]

I have one factor (tree genotype) and I analyse its influence on soil content. I used gls to aply weights on my data because it's a better fitted model. Here is an exemple of my data with one ...
2
votes
1answer
61 views

Which emmeans to choose between full and main effect mixed effect models with heteroscedasticity corrected

I have a split splot full factorial design : 3 blocks, each block contains 4 plots for factor E and each plot is divided into 3 subplots for factor F. I use a mixed effect model with random effects on ...
1
vote
0answers
77 views

How to interpret Emmeans results

I have used the emmeans() package to calculated the difference between the difference of estimated marginal means. I did this by first calculating the EMMs of location|treatment, and then the ...
0
votes
0answers
128 views

Getting marginal means for ANCOVA in R (effect vs emmeans)

I'm a bit new to running GLM models in R, so forgive me is this is a silly question. Context: I'm running an ANCOVA with the goal to control for multiple covariates while understanding the ...
2
votes
2answers
454 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 ...
1
vote
1answer
737 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 ...
1
vote
1answer
167 views

Using emmeans with clmm to look at joint effects

I am running an ordinal model on rating data, with 1 random effect (subject) and 2 fixed effects (condition with 3 levels, probe.position with 6). I use the clmm function from the ordinal package. I ...
0
votes
0answers
374 views

Using pairwise comparison on gls object with heterogeneity of variances?

I'm comparing total yield from fields under 5 different treatments. As you can see, the variance differed between the treatments (diagnostics from lm() fit): So I ...
2
votes
0answers
499 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/...
4
votes
0answers
65 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 ...
0
votes
1answer
55 views

Post-hoc comparison using lsmeans paired vs unpaired

I am doing a linear mixed model in R (lmer) to investigate the difference in activity levels (AL) between two disease groups and two kinds of therapy. Additionally, it is repeated measures data, each ...
0
votes
1answer
95 views

Model validity and specific contrasts in mixed model

I have a design where mice are distributed in a two-way anova setup. With genotype (WT and KO) and treatment (Ctrl and Treat). From each mouse 5 different tissues have been extracted and the number of ...
0
votes
2answers
117 views

Multiple comparisons repeated measures group by time interactions, with several time categories

I cannot understand how to analyse a really simple randomised controlled trial in R. I have two groups: Control and Intervention. Say there are 10 subjects in each group. These two groups are ...
1
vote
1answer
287 views

compare differences between conditions with emmeans

With the following model ...
2
votes
2answers
331 views

SE for estimated marginal means

...
7
votes
2answers
106 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, ...