Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### Interaction Plot (Reference Age = 25) (!updated 20171002)
- ```{r, fig.width = 6, fig.height = 4}
- ##!new
- ##note to molly: our datadist up until now was called dd
- options(prType = NULL, grType = NULL, digits = 3)
- ddintplot <- datadist(alldata.dt); options(datadist = 'ddintplot')
- ddintplot$limits["Adjust to","age"] <- 25
- f1iAge <- update(f1iAge)
- f1iAge.log.ggplot <- ggplot(Predict(f1iAge, age, group, ref.zero = TRUE))
- f1iAge.exp.ggplot <- ggplot(Predict(f1iAge, age, group, ref.zero = TRUE, fun = exp))
- ggplot(Predict(f1iAge, age, group, ref.zero = TRUE), ggexpr = TRUE)
- f1iAge.log.ggplot +
- theme_bw() +
- labs(title = "Interaction Plot for Model 1",
- subtitle = expression(Age %*% Group~Effect),
- y = "log Odds",
- caption = "Reference: Age - 25, Group - Control")
- if (FALSE) ggsave("../output/f1iAge.log.ggplot.png", width = 6, height = 4)
- f1iAge.exp.ggplot +
- theme_bw() +
- labs(title = "Interaction Plot for Model 1",
- subtitle = expression(Age %*% Group~Effect),
- y = "Odds Ratio",
- caption = "Reference: Age - 25, Group - Control")
- if (FALSE) ggsave("../output/f1iAge.exp.ggplot.png", width = 6, height = 4)
- options(prType = 'html', grType = 'plotly', digits = 3)
- options(datadist = 'dd')
- f1iAge <- update(f1iAge)
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement