An R package for obtaining least-squares means for many linear, generalized linear, and mixed models. Compute contrasts or linear functions of least-squares means, and comparisons of slopes. Plots and compact letter displays.
Questions tagged [lsmeans]
111 questions
0
votes
0 answers
how to plot multiple boxplots from emmeans output
How can I plot with ggplot2 multiple boxplots (in the same figure) to illustrate my model's pairwise comparisons?
my model and pairwise comparisons with emmeans:
mod1 <- lmer(CONT_Y ~ MY_GROUP * YEAR + (1|ID), data = dfModels)
group <-…

Larissa Cury
- 806
- 2
- 11
0
votes
1 answer
Is there a way to merge multiple variable valuses into one?
I am doing emmeans analysis for my bachelors thesis. I am analysing households incomes based on different variables like education, number of children, job sector, area ect.
The question is: Is there a way to merge eg. multiple living areas into…
0
votes
1 answer
Contrast emmeans: post-hoc t-test as the average differences of the differences between baseline and treatment periods
I am using the lme4 package in R to undertake linear mixed effect models (LMM). Essentially all participants received two interventions (an intervention treatment and a placebo (control)) and were separated by a washout period. However, the order or…

Jess H
- 39
- 7
0
votes
1 answer
Unequal variance in R linear mixed model post-hoc lsmeans issue
I fitted a linear mixed model to agricultural data, accounting for unequal variances across groups (cultivars) by passing weights = varIdent(...) to lme. lsmeans is showing standard errors that do not align with significant differences.
An example…
0
votes
1 answer
lsmeans for a piecewise linear mixed-effects model on r
I originally posted this question on Cross Validated Stackexchange, and got no answer. Therefore I decided to give it a go here.
I am trying to figure out how to obtain lsmeans for a piecewise linear mixed-effects model (fitted with the nlme…

Leo
- 1
- 1
0
votes
1 answer
Creation of table from lists elements containing lsmeans() statistics
I am trying to build some tables, each for every elemnt (13 in total) of a list containing statistics from an lsmeans statistics, computed via this commands lines
md <- out_long %>%
group_by(signals) %>%
do(fit = lmerTest::lmer(value ~ COND + (1…

12666727b9
- 1,133
- 1
- 8
- 22
0
votes
1 answer
When and how to apply error correction in emmeans package
I originally posted this on cross--validated but I think it might be more appropriate for SO since it's purely about software syntax.
This is a follow-up question to this post. I ran a multinomial logistic regression examining the difference in…

llewmills
- 2,959
- 3
- 31
- 58
0
votes
0 answers
Plotting a bar chart using lsmeans
I'm trying to plot a bar chart with standard error bars using lsmeans, but I keep getting the same error message:
Error in FUN(X[[i]], ...) : object 'lsmean' not found
I've tried all sorts of different codes to achieve this and never manage to do…

PMan
- 1
0
votes
1 answer
Repeated Measures ANOVA using PROC GLM but estimate statements give results by day and group
In SAS I am performing a repeated measures ANOVA of 8 different treatment groups that are measured (continuous) for 9 different times. The log shows no error code only "NOTE: The Huynh-Feldt epsilon and the corresponding adjusted p-value have been…

Priscy
- 49
- 4
0
votes
2 answers
Why do I get empty results with ls_means statement in lmerTest?
Here's my data:
subject arm treat bline change
'subject1' 'L' N 6.3597 4.9281
'subject1' 'R' T 10.3499 1.8915
'subject3' 'L' N 12.4108 -0.9008
'subject3' 'R' T 13.2422 -0.7357
'subject4' 'L' T 8.7383 2.756
'subject4' 'R' N …

Statbong
- 3
- 2
0
votes
2 answers
R - Least Squared Means Contrasts One Way ANOVA
I am reviewing one way ANOVAs and trying to integrate least squared means. Here is an example from mtcars.
mtcars.mod <- mutate(mtcars, cyl.chr = case_when(
cyl == 4 ~ "A",
cyl == 6 ~ "B",
cyl == 8 ~ "C"
))
library(lsmeans)
model <- lm(mpg…

Englishman Bob
- 377
- 2
- 13
0
votes
0 answers
Specific, custom contrasts in EMMEANs w/ multiple nested factor levels
Here is my data frame:
rearing.temp<-c("15", "15", "15", "15", "15", "15", "15", "15", "19", "19", "19", "19", "19", "19", "19", "19")
source<-c("field", "field", "woods", "woods", "field", "field", "woods", "woods", "field", "field", "woods",…

Ricardo Yomez
- 11
- 3
0
votes
1 answer
How to do specific, custom contrasts in EMMEANs with multiple nested factor levels but without subsetting data
Here is my data frame (my real DF has way more data points):
rearing.temp<-c("15", "15", "15", "15", "19", "19", "19", "19")
source<-c("field", "field", "woods", "woods", "field", "field", "woods", "woods")
…

Ricardo Yomez
- 11
- 3
0
votes
0 answers
How can I show significant comparisons from Tukey post-hoc test in ggplot2 bar plot?
I have a dataset with several variables that looks like this:
Competitor Disturbance Group MT CVt
1 M P A 17.416667 63.39274
2 M P A 11.055556 91.32450
3 M …

Ginevra B
- 23
- 4
0
votes
1 answer
How To Interpret Least Square Means and Standard Error
I am trying to understand the results I got for a fake dataset. I have two independent variables, hours, type and response pain.
First question: How was 82.46721 calculated as the lsmeans for the first type?
Second question: Why is the standard…

shsh
- 684
- 1
- 7
- 18