Questions tagged [lsmeans]

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.

111 questions
0
votes
1 answer

Lsmeans producing identical p values when controlling for two other factors

Previously I have had no issues when using lsmeans to identify significant differences between groups while controlling for other factors using lme4 models. However, with the following dataset looking at fluoresence lsmeans produces identical p…
0
votes
1 answer

How to get means in LSMEANS in SAS 9.3

I am trying to get mean from the LSMEANS statement in SAS 9.3 but from the documentation on SAS website, it seams they have removed the means from default in the LSMEANS statement. Per the documentation i am using ILINK option which is giving me…
0
votes
1 answer

How to run post-hoc test (pairwise comparison) with lsmeans on a polynomial lmer model?

Now I have a quadratic polynomial linear mixed-effects model using lme4 package with four fixed factors: Time (10 time points: 1-10, the poly factor), Age_Group1 (adults and children), Type (two semantic types of words: reduplicative and possessive…
Ping Tang
  • 415
  • 1
  • 9
  • 20
0
votes
1 answer

lsmeans averages over moderator--want separate estimates

how do you force lsmeans to report a separate estimate for each value of a constant moderator? for instance, i want three estimates of the gear difference at separate levels for disp library(magrittr) library(lsmeans) data(mtcars) lm(mpg ~ disp *…
tomw
  • 3,114
  • 4
  • 29
  • 51
0
votes
0 answers

Trying to use lsmeans without package "lmerTest"

I am running the following mixed model using the package lme4: moms.rest.lmer <- lmer(rest ~ habitat + (1|year) + (1|ID)) where rest is a numeric value, and habitat is a factor variable with 3 levels. I am trying to get pairwise comparisons of the…
0
votes
0 answers

Plotting backtransformed data with LS means plot

I have used the package lsmeans in R to get the average estimate for all observations for my treatment factor (across the levels of a block factor in the experimental design that has been included with systematic effect because it only had 3…
0
votes
1 answer

Inflated DF in lsmeans results for an lmer model

I used lmer from the lme4 package to run a linear mixed effects model. I have 3 years of temperature data for untreated (5) and treated plots (10). The model: modela<-lmer(ave~yr*tr+(1|pl), REML=FALSE, data=mydata) Model checked for normality of…
S.Dietz
  • 1
  • 1
0
votes
1 answer

Cannot get adjusted means for glmer using lsmeans

I have a glm that I would like to get adjusted means for using lsmeans. The following code makes the model (and seems to be doing it correctly): library(lmerTest) data$group <- as.factor(data$grp) data$site <- as.factor(data$site) data$stimulus <-…
user5826447
  • 357
  • 1
  • 5
  • 13
0
votes
1 answer

Mac versus PC differences with lsmeans/nlme in R?

I am having two problems, that are apparently related: Firstly, lsmeans in R is giving me two different outputs when run on Mac versus PC. Secondly, the script works outside of a function on both PC and Mac. However, it will not work inside a…
Nic George
  • 121
  • 6
0
votes
1 answer

Least Square Means problems in R

My data looks like this with plots as rows and with different Ellenberg values as columns together with Year, Forest (Skov) and Forest type (Skovtype). My data are from 4 different years (1993, 1998, 2005 and 2016). I have some problems with the…
Diana
  • 1
  • 1
0
votes
1 answer

Lsmeans library error installing estimability

I am trying to load the lsmeans library. Get this message: library(lsmeans) # for lsmeans Loading required package: estimability I then installed install.packages("estimability") but even after done, when I run this library I get the same…
Natacha
  • 1
  • 1
  • 3
0
votes
1 answer

Getting p-values for the comparisons by cld in R

The code and output below give me the interpretation that I want - i.e. the bottom two contrasts aren't significantly different but the third is different than the other two. How can I find the comparisons and p-values used for this comparison?…
user1329307
  • 117
  • 2
  • 16
0
votes
0 answers

Does "lsmeans" post hoc test include the random factor when doing comparison?

If I perform a linear-mixed effects model using lsmeans, like this: model <- lmer (variable ~ A * B + (1|C), data = data) Where I found a significant main effect of "A", which has three levels. Then I performed a post-hoc test to compare the three…
Ping Tang
  • 415
  • 1
  • 9
  • 20
0
votes
2 answers

R-multiple comparison with unbalanced design output differs from Anova

For my experiment, I clipped plants and measured their responses, such as leaf mass produced, at the end of the season. I manipulated both clipping intensity and clipping time and crossed these two treatments. I also included a control clipped…
Angela P
  • 111
  • 5
0
votes
1 answer

Back-transforming contrast lstrends results

I calculated a linear mixed model using the packages lme4 and lsmeans with the lmer-function, where I have one dependent variable rv and the interacting factors treatment, time, age, and race. I'm interested in the response variable change over…