knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", eval = TRUE ) options(width = 100) polcom <- tidyversity::polcom
🎓 Tidy tools for academics
Install the development version from Github with:
## install devtools if not already if (!requireNamespace("devtools", quietly = TRUE)) { install.packages("devtools") } ## install tidyreg from Github devtools::install_github("mkearney/tidyreg")
Load the package (it, of course, plays nicely with tidyverse).
## load tidyverse library(tidyverse) ## load tidyreg library(tidyreg)
Conduct an Ordinary Least Squares (OLS) regression analysis.
polcom %>% tidy_regression(follow_trump ~ news_1 + ambiv_sexism_1) %>% tidy_summary()
Conduct a logistic regression analysis for binary (dichotomous) outcomes.
polcom %>% tidy_regression(follow_trump ~ news_1 + ambiv_sexism_1, type = "logistic") %>% tidy_summary()
Conduct a poisson regression analysis for count data.
polcom %>% mutate(polarize = abs(therm_1 - therm_2)) %>% tidy_regression(polarize ~ news_1 + ambiv_sexism_1, type = "poisson") %>% tidy_summary()
Conduct a negative binomial regression analysis for overdispersed count data.
polcom %>% mutate(polarize = abs(therm_1 - therm_2)) %>% tidy_regression(polarize ~ news_1 + ambiv_sexism_1, type = "negbinom") %>% tidy_summary()
polcom %>% mutate(polarize = abs(therm_1 - therm_2)) %>% tidy_regression(polarize ~ news_1 + ambiv_sexism_1, type = "quasipoisson", robust = TRUE) %>% tidy_summary()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.