Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rsquaredacademy/olsrr

Tools for developing OLS regression models
https://github.com/rsquaredacademy/olsrr

collinearity-diagnostics linear-models regression rstats stepwise-regression

Last synced: about 17 hours ago
JSON representation

Tools for developing OLS regression models

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# olsrr

[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/olsrr)](https://cran.r-project.org/package=olsrr)
[![R build status](https://github.com/rsquaredacademy/olsrr/workflows/R-CMD-check/badge.svg)](https://github.com/rsquaredacademy/olsrr/actions)
[![Coverage status](https://codecov.io/gh/rsquaredacademy/olsrr/branch/master/graph/badge.svg)](https://app.codecov.io/github/rsquaredacademy/olsrr?branch=master)

## Overview

The olsrr package provides following tools for building OLS regression models using R:

- Comprehensive Regression Output
- Variable Selection Procedures
- Heteroskedasticity Tests
- Collinearity Diagnostics
- Model Fit Assessment
- Measures of Influence
- Residual Diagnostics
- Variable Contribution Assessment

## Installation

```{r cran-installation, eval = FALSE}
# Install release version from CRAN
install.packages("olsrr")

# Install development version from GitHub
# install.packages("pak")
pak::pak("rsquaredacademy/olsrr")
```

## Articles

- [Quick Overview](https://olsrr.rsquaredacademy.com/articles/intro.html)
- [Variable Selection Methods](https://olsrr.rsquaredacademy.com/articles/variable_selection.html)
- [Residual Diagnostics](https://olsrr.rsquaredacademy.com/articles/residual_diagnostics.html)
- [Heteroskedasticity](https://olsrr.rsquaredacademy.com/articles/heteroskedasticity.html)
- [Measures of Influence](https://olsrr.rsquaredacademy.com/articles/influence_measures.html)
- [Collinearity Diagnostics](https://olsrr.rsquaredacademy.com/articles/regression_diagnostics.html)

## Usage

```{r, echo=FALSE, message=FALSE}
library(olsrr)
library(dplyr)
library(ggplot2)
library(gridExtra)
library(nortest)
library(goftest)
```

olsrr uses consistent prefix `ols_` for easy tab completion. If you know how to write a `formula` or build models using `lm`, you will find olsrr very useful. Most of the functions use an object of class `lm` as input. So you just need to build a model using `lm` and then pass it onto the functions in olsrr. Below is
a quick demo:

#### Regression

```{r regress}
model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars)
ols_regress(model)
```

## Getting Help

If you encounter a bug, please file a minimal reproducible example using
[reprex](https://reprex.tidyverse.org/index.html) on github. For questions and clarifications,
use [StackOverflow](https://stackoverflow.com/).

## Code of Conduct

Please note that the olsrr project is released with a [Contributor Code of Conduct](https://olsrr.rsquaredacademy.com/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.