Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(lme4)
- lmem <- lmer(I(y - 100) ~ 0 + time + sin(2*pi*time/12) + (0 + time + sin(2*pi*time/12)|id), data = data30)
- summary(lmem)
- data30$pred <- 100 + fitted(lmem)
- ggplot(data=subset(data30, id < 10)) + geom_point(aes(x=time,y=y), color="red", size=2) +
- geom_line(aes(x=time,y=pred)) + facet_wrap(~id, ncol=3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement