Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkearney/tidyreg
🎓 Tidy regression tools for academics
https://github.com/mkearney/tidyreg
generalized-linear-models linear-models quantitative-methods regression statistics tidyversity
Last synced: about 1 month ago
JSON representation
🎓 Tidy regression tools for academics
- Host: GitHub
- URL: https://github.com/mkearney/tidyreg
- Owner: mkearney
- Created: 2018-06-02T21:38:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T21:03:03.000Z (over 6 years ago)
- Last Synced: 2024-08-03T06:03:26.043Z (5 months ago)
- Topics: generalized-linear-models, linear-models, quantitative-methods, regression, statistics, tidyversity
- Language: R
- Homepage:
- Size: 541 KB
- Stars: 23
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
eval = TRUE
)
options(width = 100)
polcom <- tidyversity::polcom
```
# tidyreg[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
🎓 Tidy tools for academics
## \*\*\* This package is in very early development. Feedback is encouraged!!! \*\*\*
## Installation
Install the development version from [Github](https://github.com/mkearney/tidyreg) with:
```{r install, eval=FALSE}
## 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).
```{r library}
## load tidyverse
library(tidyverse)## load tidyreg
library(tidyreg)
```## Regression models
### Ordinary Least Squares (OLS)
Conduct an Ordinary Least Squares (OLS) regression analysis.
```{r ols}
polcom %>%
tidy_regression(follow_trump ~ news_1 + ambiv_sexism_1) %>%
tidy_summary()
```### Logistic (dichotomous)
Conduct a logistic regression analysis for binary (dichotomous) outcomes.
```{r logistic}
polcom %>%
tidy_regression(follow_trump ~ news_1 + ambiv_sexism_1, type = "logistic") %>%
tidy_summary()
```### Poisson (count)
Conduct a poisson regression analysis for count data.
```{r poisson}
polcom %>%
mutate(polarize = abs(therm_1 - therm_2)) %>%
tidy_regression(polarize ~ news_1 + ambiv_sexism_1, type = "poisson") %>%
tidy_summary()
```### Negative binomial (overdispersed)
Conduct a negative binomial regression analysis for overdispersed count data.
```{r, negbinom}
polcom %>%
mutate(polarize = abs(therm_1 - therm_2)) %>%
tidy_regression(polarize ~ news_1 + ambiv_sexism_1, type = "negbinom") %>%
tidy_summary()
```### Robust and quasi- models
```{r, robust_glm}
polcom %>%
mutate(polarize = abs(therm_1 - therm_2)) %>%
tidy_regression(polarize ~ news_1 + ambiv_sexism_1,
type = "quasipoisson", robust = TRUE) %>%
tidy_summary()
```