lsmeans

How to do specific, custom contrasts in EMMEANs with multiple nested factor levels but without subsetting data

假装没事ソ 提交于 2021-02-05 09:23:06
问题 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") runway.temp<-c("40","20","40","20","40","20","40","20") velocity<-c("2.3", "2.1", "1.9", "1.9", "2.3", "2.2", "2.3", "2.0") snail<-data.frame(rearing.temp, source, runway.temp, velocity) Here is my model: mod <- lmer(velocity ~ runway.temp*source*rearing.temp + (1|family) + (1|collection

I can't get lsmeans output in glmer

江枫思渺然 提交于 2019-12-13 07:15:41
问题 List. I have a generalized mixed model using lmer.test package and calling glmer. I can get a good model, however I can't get the output of the LSMEANS and Diff means. Here's what I have library(plyr) library(lubridate) library(chron) library(reshape) library(lattice) library(car) library(lmerTest) fm17<-glmer(I(Steps+1)~Treatment + treatdate +Weight + BF+ (1|Block) +(0+treatdate|exp.unit), family=poisson) summary(fm17,ddf="Kenward-Roger") qqnorm(resid(fm17),main="QQ Model 17") plot(fm17,main

R lsmeans adjust multiple comparison

不想你离开。 提交于 2019-12-11 04:19:13
问题 I used lme4 to run a mixed effects logistig regression (by calling glmer) in R and now I am trying to do post-hoc comparisons. As they are pairwise, Tukey should be OK,but I would like to manually adjust for how many tests the correction should be made - now it is made for 12 tests, but I am only intersted in 6 comparisons. My code looks like this so far for (i in seq_along(logmixed_ranks)) { print(lsmeans(logmixed_ranks[[i]], pairwise~rating_ranks*indicator_var, adjust="tukey")) } Somehow I