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
1answer
16 views

Regresion Coeffients and Estimated Marginal Means in Glmm

What is the relationship between regression coefficients for categorical variables and their estimated marginal means?
0
votes
1answer
15 views

Can I compare emmeans for a linear model at any given value of covariate?

I have the following model: ABC<-lmer(A~Ta+MR+mb+group*Acl + (1|ID), data=groups) where Ta, MR and mb are linear covariates. I want to do a pairwise ...
0
votes
1answer
28 views

Large standard error when variance equals zero

The function ggemmeans() is producing very large standard errors when the within-group variance equals zero. I'm using ggemmeans() to extract estimated marginal means from a binomial GLM. The GLM ...
0
votes
1answer
36 views

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

Let's say I run the following contrast: ...
0
votes
1answer
31 views

Can SAS Least Squares Means estimation algorithm be translated for a design matrix in Reference coding?

My question is whether it’s possible to compute lsmeans defined in this SAS algorithm if the design matrix is not in GLM form. In particular, in R, if one feeds that design to model.matrix(), then ...
0
votes
0answers
33 views

Confusing result from post-hoc analysis using mixed linear model

I am fitting a mixed model: ...
3
votes
1answer
33 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 ...
0
votes
1answer
58 views

Confusing results from lsmeans and pairwise tests

Experiment: I collected data from N participants, each was shown 50 photos and asked to provide sharing likelihood (dependent ...
1
vote
1answer
55 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
81 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
28 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
45 views

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

Let's assume we have the data: ...
0
votes
0answers
20 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
79 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
9 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
46 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
41 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
19 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
31 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
53 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
217 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
75 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
172 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
64 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 ...
1
vote
1answer
112 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
12 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
45 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
86 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
31 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
61 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
65 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
44 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
37 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
66 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
224 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
48 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
232 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
158 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
27 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
217 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
65 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
73 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
103 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
158 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
564 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
1k 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
211 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
464 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
582 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/...