Questions tagged [emmeans]
Refers to estimated marginal means. These are means predicted by statistical models. A package in R called emmeans is dedicated to predicting these estimates.
emmeans
333
questions
0
votes
0
answers
16
views
The emmeans error: "'x' is not positive definite"
I am now running a linear mixed effects model and want to use emmeans() to do the post-hoc tests.
Here is my code:
mod.cog_engagement <- lmer(scale(cog_engagement) ~ Year_ID*Group + (1 | school) + ...
0
votes
0
answers
13
views
Obtaining mean effect size estimates and confidence intervals when a factor level combination is missing
I fitted a model using the metafor package with a moderator interaction for which there is no data for a combination of factor levels.
data(fish)
warm_dat <- fish
warm_dat$factor2<-as.factor(seq(...
2
votes
2
answers
57
views
Bug report when emmeans() is used along with fct_na_value_to_level()
This is an MRE that shows an inconsistency in the use of emmeans() along with fct_na_value_to_level().
It wasn't easy to get the why of the error from my initial code ;)
I prefer to put it here ...
0
votes
0
answers
28
views
Degrees of Freedom in Emmeans
I am using the 'emmeans' package in R to compute estimated marginal means for my (liner mixed-effects) model. However, I am enountering a warning message related to the number of observations ...
0
votes
0
answers
13
views
post-hoc test for multinomial logistic regression brm model (categorical responce) [migrated]
I apologise as I am very new to this package and I really appreciate any help I can get.
I have a brms model with a categorical response variable (Species) with the following formula, running a ...
2
votes
1
answer
64
views
Why do I need to hardcode the formula in emmeans() instead of dynamically extracting the formula from a dynamic linear model?
Edit: added a non-Shiny MRE, though that has a different error than the Shiny one...
Consider the following MRE (note that the app will not display correctly, this code is just to get it running for ...
2
votes
2
answers
56
views
How to back-transform inverse transformation in emmeans when using contrast function
I am trying to calculate pairwise comparisons using the {emmeans} package after fitting a linear model with an inverse-transformed response. Here is the data and fitted model. The data comes from the {...
0
votes
0
answers
21
views
R emmeans for outer nesting variable (unbalanced nested variables)
I have a model with a nested variable that is only meaningful within one level of another variable, i.e. the case described in this question and explanation on CrossValidated.
The reproducible example ...
0
votes
1
answer
45
views
How to change the order of terms on the x axis using emmip or emmip_ggplot?
I need some help. I am trying to change the x axis terms while using the emmip function. Both of the items in question have been coded as factors (Ploidy and P). x is my data.
x$Ploidy <- as.factor(...
0
votes
0
answers
44
views
How to create a function in R to add emmeans-contrasts output to a ggplot-graphic?
I hope someone can help me with this problem. I have no background in computer science or programing, which makes it hard to understand why my code doesn't work.
My goal is to create a number of plots,...
0
votes
2
answers
76
views
How do I produce a customizable interaction plot using the estimated marginal means? [closed]
I am currently looking at how the effect of two factors (temperature, species) on the duration of the egg stage in insects using a linear model and ANOVA analysis as follows:
## Model
type3.egg <- ...
1
vote
1
answer
63
views
Post-hoc comparisons of quasi-family glmer models with emmeans
Since "quasi" families cannot be used in glmer, there is an efficient approach to adjust the standard errors of the parameters and the associated statistics post-fitting (https://bbolker....
0
votes
0
answers
41
views
How is it possible for a glm and an emmeans on the same model to get different results?
I'm running a model comparing percent abnormality across two factors, mate pair and treatment. I ran the code:
model <- glm(Percent~Treatment+MatePair, data=sub_plut_abnorm) summary(model)
enter ...
0
votes
0
answers
15
views
How can I identify with letters differences between groups using emmeans
I have performed an anova and plot the differences between groups (YOB_tn) with emmeans. But I need to identify which levels arrange togheter (the letters netween contrasts) because it is impossible ...
0
votes
0
answers
19
views
Selecting contrasts in emmeans
So, I have this model of a dataset I've build with a lot of information and now I'm trying to compare some of the variables I have with some others, but not everything with everything as tukey does.
...