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
Multiple comparisons of groups with emmeans of a clm: Error in UseMethod("vcoc"): no applicable methos for 'vcov' applied to an object of class "clm"
I'm trying to make a post-hoc tests with emmean/lsmeans for multiple comparisons of groups. In fact, I'm trying to recreate an example found here: https://rcompanion.org/handbook/G_11.html.
Thus, I have a model which looks like…

Fabian
- 51
- 1
- 10
0
votes
0 answers
Least-square means do not match with interaction plot point coordinates
From a fitted lmer model. Note: not transformation of the predictors was done.
lmer.model=lmer(share ~ gender+ age_group + overall_photo_share_freq_group+
affiliative_score_group*valence_group*condition+
…

Rakib
- 7,435
- 7
- 29
- 45
0
votes
0 answers
R pairwise post-hoc to get contrasts of contrasts for interaction?
I'm running a mixed-effects model in R and I want to know if there is code I can run to get contrasts of contrasts for an interaction for post-hoc testing.
A. Ie. the tukey test I'm running at the moment is this:
There are 2 regions (ML and HG) and…

Roseanna
- 133
- 1
- 1
- 7
0
votes
1 answer
R: How to display mean-separation letters for 2-way ANOVA when interactions are not significant?
I am comparing a fertilizer experiment where I have a response variable (growth rate) with two independent variables (genotype and rate). I ran a 2-way ANOVA using the lsmeans, car, and multcompView packages in R. My interaction effects are not…

ihb
- 292
- 9
- 27
0
votes
0 answers
glmmadmb no longer supported in lsmeans. Alternative packages?
My data is zero inflated so I'm running a zero-inflated model using glmmamdb:
Model3z <- glmmadmb(Count3 ~ Light3 + (1|Site3), zeroInflation = T, family= "poisson", data = dframe3)
However, when I try and do pairwise comparisons of the different…

Help
- 101
0
votes
0 answers
How to successfully download the old version of lsmeans package
I'd like to download version 2.26-3 of lsmeans package.
An error occurs when I try to download an old version of the lsmeans package.
I've tried two options for downloading the old versions of lsmeans.
Option 1)
path<-…

SkipT
- 1
0
votes
1 answer
Specific within group comparisons for lsmeans
I would like to limit the post-hoc contrasts calculated using the package 'lsmeans' in R.
library(nlme) #for gls
model<-gls(time~ benchmark*gc*opt, method="REML",data=d)
lsmeans.d<-lsmeans(model, ~benchmark:gc:opt)
pairs(lsmeans.d)
This outputs…

LiveLongandProsper
- 281
- 2
- 8
0
votes
1 answer
Post hoc for binary GLMM (lme4) and plot
So I'm an R novice attempting a GLMM and post hoc analysis... help! I've collected binary data on 9 damselflys under 6 light levels, 1=response to movement of optomotor drum, 0=no response. My data was imported into R with the headings 'Animal_ID,…

Lois Flounders
- 1
- 2
0
votes
1 answer
Invalid argument in the lsmeans model?
I am getting the error saying
lsmDrugs=lsmeans(model1, -drug)
Error in -drug : invalid argument to unary operator"
Any help please?
library(knitr)
library(lsmeans)
drug <- c(rep("A", 2),rep("B", 2),rep("C", 2))
drugDiff <- c(-14, -4, 5, -1,…
user8826976
0
votes
1 answer
"Contrast Error" message with lsmeans Tukey Test on GLM
I have defined a generalised linear model as follows:
glm(formula = ParticleCount ~ ParticlePresent + AlgaePresent +
ParticleTypeSize + ParticlePresent:ParticleTypeSize + AlgaePresent:ParticleTypeSize,
family = poisson(link = "log"), data =…
0
votes
1 answer
Constructing repeated measures ANOVA in R and extracting ls means.
I am trying to properly construct a repeated measures ANOVA in R and extract the associated lsmeans. My data consists of a dependent variable (rSWC) and a predictor (Geno). The full dataset is as below:
> str(mydata)
'data.frame': 153 obs. of 5…

C24
- 45
- 6
0
votes
1 answer
lsmeans and continuous time
I would like to have your help on this problem.
I wish to express the evolution of a quality of life score over the time with adjustment on clinical factors.
I work on a cohort of more than 1000 patients and a quality of life form was delivered…
0
votes
0 answers
How to obtain absolute differences after predictions (with lsmeans) from a logistic model
I am using a logistic model for a binary outcome with three independent predictors. After adjusting the model, I want to estimate predictions of my outcome (y) using marginal means (lsmeans) and contrast such predictions. However, I noticed that the…

Luis Segura
- 11
- 3
0
votes
1 answer
error message lsmeans for beta mixed regression model with glmmTMB
I am analyzing the ratio of (biomass of one part of a plant community) vs. (total plant community biomass) across different treatments in time (i.e. repeated measures) in R. Hence, it seems natural to use beta regression with a mixed component…

Guillaume A2
- 11
- 2
0
votes
0 answers
R: Obtaining lsmeans for each row of data
I am currently attempting to use lsmeans on a negative binomial model to obtain least squared means for each participant in my dataset. I am able to ascertain lsmeans by my exposure of interest, but not adjusted means for each participant. My code…

Sirtaj Singh
- 1
- 1