emmeans

How to add annotation over line plot to mark percent change in y-values between discrete x-values

房东的猫 提交于 2021-02-08 10:38:28
问题 I want to visualize the results of a linear model where dependent variable values change as a function of discrete x-values. Since my x-values represent consecutive days, I want to annotate the change from day to day, in percents. How can I do this in a line plot? My Data I want to measure people's mood. Every day I collect responses from 1000 different people on how they feel. I therefore get a daily average for mood, and I want to see how it changes from one day to another. library

How to add annotation over line plot to mark percent change in y-values between discrete x-values

狂风中的少年 提交于 2021-02-08 10:36:14
问题 I want to visualize the results of a linear model where dependent variable values change as a function of discrete x-values. Since my x-values represent consecutive days, I want to annotate the change from day to day, in percents. How can I do this in a line plot? My Data I want to measure people's mood. Every day I collect responses from 1000 different people on how they feel. I therefore get a daily average for mood, and I want to see how it changes from one day to another. library

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

can't use emmeans inside map

£可爱£侵袭症+ 提交于 2021-01-24 08:12:29
问题 This works: testmodel=glm(breaks~wool,data=warpbreaks) emmeans::emmeans(testmodel,"wool") This works: warpbreaks %>% group_by(tension) %>% do(models=glm(breaks~wool,data=.)) %>% ungroup() %>% mutate(means=map(models,~emmeans::emmeans(.x,"wool"))) This doesn't: warpbreaks %>% group_by(tension) %>% nest() %>% mutate(models=map(data,~glm(breaks~wool,data=.x))) %>% mutate(means=map(models,~emmeans::emmeans(.x,"wool"))) Error in is.data.frame(data) : object '.x' not found Error in mutate_impl(

Map `joint_tests` to a list after fitting a `gls` model

二次信任 提交于 2021-01-07 02:27:16
问题 I am trying to get the type 3 ANOVA table with emmeans::joint_tests() from a list with the following code. I don't fully understand the error message. The code that tutors me came from http://pages.stat.wisc.edu/~yandell/R_for_data_sciences/curate/tidyverse.html library(dplyr) library(nlme) library(emmeans) data("diamonds") diamonds %>% split(.$cut) %>% map(~ gls(price ~ x + y + z, weights = varIdent(form = ~ 1|color), data = .))%>% map(summary) The error message seems to suggest that I save