Created
December 10, 2021 20:51
-
-
Save MJacobs1985/a0317fc2f7c98ff5098ab22c0c6b3898 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| B0 <- tidy_summary_1$estimate[1] | |
| B1 <- tidy_summary_1$estimate[2] | |
| B2 <- tidy_summary_1$estimate[3] | |
| d %>% | |
| add_fitted_draws(model2, n = 200, re_formula = NA) %>% | |
| ggplot(aes(x = ADF, y = ADG)) + | |
| geom_line(aes(y = .value, group = .draw), alpha = 0.1) + | |
| geom_abline(intercept = B0+B2, slope = B1, color = "blue") +theme_bw() | |
| Studycode_summaries_1 <- model2 %>% | |
| spread_draws(`(Intercept)`, b[,Studycode]) %>% | |
| mutate(Studycode_intercept = `(Intercept)` + b) %>% | |
| dplyr::select(-`(Intercept)`, -b) %>% | |
| median_qi(.width = 0.80) %>% | |
| dplyr::select(Studycode, Studycode_intercept, .lower, .upper) | |
| Studycode_summaries_1 %>% | |
| filter(Studycode %in% c("Studycode:V0011207", "Studycode:V0011270")) | |
| d %>% | |
| filter(Studycode %in% c("V0011207", "V0011270")) %>% | |
| add_fitted_draws(model2, n = 100) %>% | |
| ggplot(aes(x = ADF, | |
| y = ADG)) + | |
| geom_line( | |
| aes(y = .value, | |
| group = paste(Studycode, .draw), | |
| color = Studycode), | |
| alpha = 0.1) + | |
| geom_point(aes(color = Studycode)) + theme_bw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment