Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
13 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 ...
0
votes
0answers
5 views

Fail to get the reference grid for the model via the ref_grid function [closed]

After the model selection was done, I tried to use emmeans to do estimated marginal means of predictors. But it failed and the error warning is: "Error in (function (..., degree = 1, coefs = NULL, ...
2
votes
2answers
59 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
69 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
49 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
108 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 ...
1
vote
0answers
261 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/...
3
votes
0answers
44 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
29 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
54 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
56 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
117 views

compare differences between conditions with emmeans

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

SE for estimated marginal means

...
7
votes
2answers
104 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, ...
1
vote
1answer
697 views

emmeans pairwise contrasts result in same output values for all?

First of all, I am a beginner at mixed models, so I beg your patience and advice if this post could be improved. The structure of the data: ...
2
votes
1answer
296 views

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

Let us look at some sample data for 5 hypothetical subjects. ...
1
vote
1answer
577 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 ...
1
vote
1answer
56 views

Log response ratio of means not agreeing with linear mixed model output

I have a linear mixed model structured like so: Richness~Time*Treatment+(1|Site) Time has two levels (Pre and Post) as does Treatment (Treatment and Control). ...
0
votes
1answer
221 views

Lsmeans output for clmm models (R)

I've fitted a cumulative logit model, where the IV is categorical (different animation models being compared), the DV is ordinal (points on a 1-9 scale), and there are some random effects (subject, ...
0
votes
1answer
178 views

Analysing Repeated Measures RCT study. emmeans / lsmeans estimate and back-transform problems. Approach doubts

Background I am writing a project on a big multicenter RCT study, where subjects are following different dietary patterns for 2 years. I have access to their dietary intakes and I am grouping them in ...
3
votes
2answers
84 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 ...
0
votes
1answer
97 views

Different results from poisson glmer and glmmadmb when using emmeans (lsmeans)

Why would I be getting drastically different results from glmer and glmmadmbM for the same model when using emmeans? The results from summary() are the same. EMmeans glmer: ...
0
votes
1answer
110 views

Which test does the lsmeans package use to compare the means in pairwise tests and what are its assumptions?

I'm currently using lsmeans to compare the means of various groups using the contrast argument. I'm using data that follows a Gaussian distribution. Would an unbalanced data structure affect the rate ...
0
votes
1answer
61 views

Why the degree of freedom is NA ? And why the p value is calculated when the df is NA?

I used R to do the statistical analysis. After running a glm model, I used Anova function to look at the p value for each explanatory variable. So far, everything was normal. However, when I used ...
0
votes
0answers
188 views

Specifying nested random factor in emmeans from a gamlss object

I am trying to use the package emmeans with a gamlss object with a mixed model using a beta distribution. I am unsure as to the best way to use the emmeans function to include my nested random effects....
0
votes
2answers
220 views

Test for effects of categorical variables on a binary response variable considering their interactions?

i am looking for a test similar to a 2-way ANOVA that would work on a binary response variable. My response variable is presence/absence of plant species. My explanatory variables are Treatment (3 ...
0
votes
1answer
186 views

least square means for GLMM ANOVA

I'm using glm with family=Gamma(link=identity) for gamma distributed data, where I am comparing variance across groups and their ...
5
votes
1answer
189 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, ...
0
votes
1answer
699 views

Calculating Estimated Marginal Means from univariate data

I am trying to calculate the estimated marginal means (aka least squared means) in R in order to do statistical analysis for a univariate dataset and am struggling as all the examples are from ...
3
votes
2answers
191 views

How can I program correction for multiple comparisons using lsmeans in R while not correcting for more than necessary

I posted this question on stack overflow here enter link description here but did not get useful feedback. So, I'll post it again here, in the hopes that this is a better venue for it. I'm wondering ...
1
vote
1answer
279 views

Calculating ratios for contrasts after lmer model

I have performed lmer on my data and, to be generic, my model has 3 fixed effects (A,B,C) and 3 nested random effects (d,e,f) following the response variable y: <...
0
votes
1answer
230 views

Post-hoc test results from GLMM seem to contradict lsmeans estimates

I've conducted a GLMM on some zero-inflated pollinator count data using the glmmadmb() function. Here is the model, in which the counts are in the variable Total, fixed effects include mean ...
0
votes
1answer
145 views

How to provide CI for prediction for mixed model? lsmeans vs predictInterval

I have a linear mixed model, say: y ~ x1 + .. + xn + (1|person) I would like to have a Confidence interval for the prediction, so I would like to say: if x1=3 and x2=6, etc, and ignoring the random ...
3
votes
1answer
77 views

Why doesn't the confidence interval get wider in covariate adjusted pairwise comparisons?

Confidence intervals on means in regression widen as predictions approach the edges of model fit. My intuition then leads me to believe that if I do pairwise comparisons using my model, adjusting for ...
1
vote
1answer
247 views

Post hoc for a specific variable part of an interaction, linear mixed model, r

There are many posts about post hoc testing but I did not find an answer to my question. my model: mod<-lmer(T ~ A*B + C + (1|D), REML=TRUE, data=dat) <...
1
vote
1answer
87 views

Can I fit a linear model if the dependent variable is categorical and has only two values, instead of doing a t test?

Question Is it correct to test the difference of a measurement between groups using generalized least squares? Example My data looks like this: I perform a gls ...
2
votes
1answer
5k views

Pairwise comparisons of contrasts from lsmeans - p value adjustment

I need assistance with interpreting the outcome of my pairwise comparisons from my datasets. I've been running a glmer mixed models and selecting the best model using the AIC criteria. This is the ...
1
vote
1answer
1k 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 ...
0
votes
2answers
265 views

lsmeans R package: how to obtain exact pvalue question when doing a pairwise comparision

I'm using the lsmeans R package, and I'm doing a simple pairwise comparison between two groups. Is there a way to get the exact ...
2
votes
0answers
274 views

How to do GEE with LS means in R

I've done a GEE analysis for a dataset in SPSS and I want to replicate the analysis in R, but I'm fairly new to R so I'm not sure how to do it. Here's a list of all the things I included in SPSS: ...
0
votes
1answer
364 views

Are LSMeans calculated from Predicted Values?

I have a question which I can't find an answer online. When we ask a software (SAS, R,...) to calculate the LSMeans from a linear model, like regression, what is the procedure? Does the model find ...
1
vote
1answer
374 views

What's difference between SE and lsmean's SE?

Here's a link of the past question. Although I'm so beginner of statistic, I keep trying to understand statistic. The past question is about significantly unequal sample size. After that, I ...
1
vote
1answer
388 views

lsmeans pairwise contrasts not computing all comparisons

I performed mixed model ANOVAs using the lmer function from lme4. My model is as follows. ...
0
votes
1answer
273 views

Set the offset value in lsmeans

I'm using a negative binomial glmm for analysis. The y values of my samples are summed over 12 individual counts of insect mines on leaves of a tree. You can get the data (and session info) from here!...
0
votes
1answer
1k views

Pairwise comparison of interactions (factor*numerical variable)

--- Edit --- Let's take a very simple model, with Y and X numerical variables and Fact a categorical variable. mod = lm(Y~X*Fact) I want to: Check whether ...
2
votes
0answers
404 views

lsmeans for mixed lmer model - error estimates

I am curious as to why standard error estimates on lsmeans depend greatly on whether certain other factors in a model are treated as fixed or random effects. For example, I have measured the fish ...
0
votes
0answers
168 views

lsmeans output has identical p-values for different groups

I'm looking at some data with an lme4 model. My variables are sex, treatment with two levels, element with three levels (each of them a nutrient: carbs, fat, protein) and age (young, mature). looks ...
6
votes
1answer
2k 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 ...
0
votes
1answer
92 views

glmer intercept predicted probability and SE

I have the following model: mod = glmer(outcome ~ 1 + (1|ID), family = binomial(link="logit"), data = df) OR ...