Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created February 21, 2022 12:20
Show Gist options
  • Select an option

  • Save MJacobs1985/b47d76a06036c2a8cd9e5f8fce08eb66 to your computer and use it in GitHub Desktop.

Select an option

Save MJacobs1985/b47d76a06036c2a8cd9e5f8fce08eb66 to your computer and use it in GitHub Desktop.
dfnew2<-dfnew%>%dplyr::select(curve_day, ogn_id,
lcn_id, feed_provided,
feed_provided_cum, newField,
animals_actual)%>%na.omit
fit.1<-lmer(feed_provided_cum~ns(curve_day,3)+
(0+ns(curve_day,2)|newField/lcn_id),
data=dfnew2)
fit.2<-lmer(feed_provided_cum~ns(curve_day,3)+
animals_actual+
(0+ns(curve_day,2)|newField/lcn_id),
data=dfnew2)
fit.3<-lmer(feed_provided_cum~ns(curve_day,5)*newField+
(0+ns(curve_day,2)|lcn_id),
data=dfnew2)
fit.4<-lmer(feed_provided_cum~ns(curve_day,5)+
animals_actual+
(0+curve_day|newField/lcn_id/ogn_id),
data=dfnew2)
fit.5<-lmer(feed_provided_cum~curve_day+
animals_actual+
feed_provided+
ogn_id+
(0+curve_day|newField/lcn_id),
data=dfnew2)
anova(fit.5,
fit.4,
fit.3,
fit.2,
fit.1)
jtools::plot_summs(fit.1,
fit.2,
fit.3,
fit.4,
fit.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment