Refers to estimated marginal means. These are means predicted by statistical models. A package in R called emmeans is dedicated to predicting these estimates.
Questions tagged [emmeans]
303 questions
3
votes
1 answer
Is using 'adjust = "tukey"' in emmeans equivalent to a Tukey HSD test?
I have been looking around and I am quite confused about Tukey adjustment in emmeans.
The documentation of emmeans doesn't mention Tukey HSD at all, but in here it is said that "For most contrast() results, adjust is often something else, depending…

jordi
- 91
- 1
- 7
3
votes
0 answers
Standardized effect sizes interpretation using emmeans
I used eff_size() function to calculate effect sized of conditions of a lmer object.
However, I can't find a rule of thumb for interpreting the effect size. Any guidelines or suggestions?
Many thanks!
> eff_size(post, sigma = sigma(fit), edf =…

atnplab
- 107
- 1
- 7
3
votes
1 answer
Does emmeans use lm_robust cluster-robust standard errors when calculating confidence intervals for transformed outcome variables?
I'm examining interactions between two continuous predictor variables using the emmeans package. I'm using lm_robust() from the estimatr package to perform the linear regression and obtain cluster-robust standard errors. The outcome variable is…

Paul
- 115
- 2
- 11
3
votes
2 answers
R: Run multiple post hoc tests at once, using emmeans package
I'm working on a dataset with several different types of proteins as columns. It kinds of looks like this This is simplified, the original dataset contains over 100 types of proteins. I wanted to see if the concentration of a protein differs by…

Daisy Chang
- 78
- 6
3
votes
1 answer
map emmeans from a list of linear models in R
I have a list of over ~100 linear models and I want to take the estimated means and standard errors for each model.
Let's use mtcars as an example.
library(tidyverse); library(magrittr); library(emmeans)
mtcars %<>%
mutate(
cyl =…

Juan Pablo Ospina
- 35
- 4
3
votes
1 answer
Emmeans continuous independant variable
I want to explan Type_f with Type_space of the experiment and the rate of Exhaustion_product and quantitative variable Age.
Here is my data :
res=structure(list(Type_space = structure(c(2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,…

ranell
- 683
- 13
- 29
3
votes
1 answer
How to set confidence intervals in "emmeans"
I am have been working with the emmeans package to create an estimated marginal means for my data at .95% confidence level. Although I cannot seem to change it to .99% confidence level. Any help would be much appreciated. Usually I would use the…

Nathan
- 67
- 1
- 7
3
votes
0 answers
emmeans error with glmer - variable not recognised in reference grid
I'm having trouble using emmeans with a glmer object. I have an ordinal response that doesn't satisfy the proportional odds assumption and I thought to produce a binary model at each cut point as an alternative approach. I ultimately want to plot…

LucaS
- 887
- 1
- 9
- 22
3
votes
1 answer
Custom function to compute contrasts in emmeans
I want to create a custom contrast function in emmeans which could remove a given list of levels from the input vector and apply the built-in contrast method ("trt.vs.ctrl") on the remaining levels. An example dataset is available here. I am using…

Shakir
- 343
- 5
- 23
2
votes
0 answers
Confidence intervals computed by ggpredict() and emmeans() for a mixed-effect model differ: why?
I used function ggpredict() from package ggeffects 1.3.0 and function emmeans() from package emmeans to calculate estimates and confidence intervals (hereafter: CI) for a mixed-effect model. The CI estimated by the two functions differ. Why?
The…

Marco Plebani
- 436
- 2
- 14
2
votes
1 answer
Backtranform lsmeans in R
I have created a simple linear regression model in R where I have log transformed the response. The independent variable is categorical with 80 levels. Then I use emmeans for pairwise tests. How can I backtransform the emmeans to have the same scale…

les2004
- 105
- 7
2
votes
1 answer
Get confidence interval from emmeans contrast function
I am looking to get a confidence interval from the contrast funciotn from the emmeans package.
Taking an example model:
model <- lm(mpg ~ factor(cyl) + hp, data = mtcars)
emmeans(model, specs = ~ cyl) %>%
contrast()
gives:
contrast estimate…

jackahall
- 400
- 1
- 7
2
votes
0 answers
cld() function does not work anymore with emmGrid class object from emmeans package
My previous code that worked with the cld() function from the multcomp package and the emmGrid class objects obtained from the emmeans() function from the emmeans package no longer works. Now I get this error message:
Error in UseMethod("cld") : …

Taurinatorex
- 21
- 2
2
votes
2 answers
Output from Linear Mixed Models differs from Estimated Marginal Means
I have a query about the output statistics gained from linear mixed models (using the lmer function) relative to the output statistics taken from the estimated marginal means gained from this model
Essentially, I am running an LMM comparing the…

Samedi
- 23
- 4
2
votes
3 answers
Edit emmeans' arrow plot's facet text
I'm trying to edit the facet label's text produced by emmean's arrow plot using ggplot2's syntax to override the default.
pigs.lm <- lm(log(conc) ~ source + as.factor(percent),
data = pigs)
pigs.plot <- plot(emmeans(pigs.lm , specs =…

hnguyen
- 772
- 6
- 17