Skip to content

Package that checks the assumptions for a linear regression model

License

Notifications You must be signed in to change notification settings

chloefeehan/linearcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linearcheck R package

This is a package that checks the assumptions (equal variance, normality, independence, linearity) for a simple linear regression. Do not use this package for a multiple linear regression as there is only one x variable included.

Equal Variance Assumption

  • residplot() allows you to specify x and y variables in a dataset to build a residual plot.

  • bptable() allows you to specify x and y variables in a dataset and prints Breusch-Pagan test results. Prints Breusch-Pagan interpretation if commentary = TRUE.

Normality Assumption

  • qqgraph() allows you to specify x and y variables in a dataset to build a Quantile-Quantile plot.

  • swtable() allows you to specify x and y variables in a dataset and prints Shapiro-Wilk test results. Prints Shapiro-Wilk interpretation if commentary = TRUE.

Independence Assumption

  • acf_pacf() allows you to specify x and y variables in a dataset to build ACF and PACF plots for both x and y variables.

  • dwtable() allows you to specify x and y variables in a dataset and prints Durbin-Watson test results. Prints Durbin-Watson interpretation if commentary = TRUE.

Linearity Assumption

  • linearplot() allows you to specify x and y variables in a dataset to build a scatterplot with line of best fit.

  • stats_table() allows you to specify x and y variables in a dataset and prints summary statitistics. Prints adjusted R-squared and p-value interpretation if commentary = TRUE.

Installation

  1. Install and load in devtools package
install.packages("devtools")
library(devtools)
  1. Install r package from github and load in linearcheck package
install_github("chloefeehan/linearcheck")
library(linearcheck)

Examples

Equal Variance Assumption

data(cars)
residplot(cars, speed, dist)
bptable(cars, speed, dist, commentary = TRUE)

Normality Assumption

data(cars)
qqgraph(cars, speed, dist)
swtable(cars, dist, commentary = TRUE)

Independence Assumption

data(cars)
acf_pacf(cars, speed, dist) 
dwtable(cars, speed, dist, commentary = TRUE)

Linearity Assumption

data(cars)
linearplot(cars, speed, dist, title = "Plot") 
stats_table(cars, speed, dist, commentary = TRUE)

About

Package that checks the assumptions for a linear regression model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages