The goal of the tidytest
package is to provide a tidy unified
interface to common statistical tests, specifically those used when
developing and validating statistical models.
You can install the development version of tidytest from GitHub with:
# install.packages("devtools")
devtools::install_github("RobbyLankford/tidytest")
The tidytest
package is designed to be used with the
tidymodels
ecosystem, particularly the
parsnip
package. Currently, methods
exist for the following parsnip
models:
library(parsnip)
library(tidytest)
mod_fit <- linear_reg() %>%
set_engine("lm") %>%
fit(mpg ~ disp + wt + hp, data = mtcars)
Tests in the tidytest
package are designed to require minimal input.
For most tests, the model object is the only required input.
Tests for linear regression often focus on the behavior of the residuals. The classic assumptions for a linear model are the “LINE” assumptions of the residuals, specifically:
Currently, the implemented linearity tests are:
ramsey_reset(mod_fit)
harvey_collier_test(mod_fit)
Currently, the implemented independence tests are:
durbin_watson_test(mod_fit)
ljung_box_test(mod_fit)
Currently, the implemented normality tests are:
anderson_darling_test(mod_fit)
shapiro_wilk_test(mod_fit)
Currently, the implemented equal variance (homoscedasticity) tests are:
bruesch_pagan_test(mod_fit)
goldfeld_quandt_test(mod_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.