broom methods for heteroscedasticity diagnostics
tidy.hetero_test.RdTidy, glance and augment methods integrating heteroscedasticity diagnostics with the broom generics from the generics package.
Usage
# S3 method for class 'hetero_test'
tidy(x, ...)
# S3 method for class 'hetero_test'
glance(x, ...)
# S3 method for class 'hetero_test'
augment(x, data = NULL, ...)
# S3 method for class 'hetero_test_suite'
tidy(x, ...)
# S3 method for class 'hetero_test_suite'
glance(x, ...)
# S3 method for class 'hetero_test_suite'
augment(x, data = NULL, ...)
# S3 method for class 'hetero_grouped_suite'
tidy(x, ...)Value
A data frame summarising the diagnostic(s), or an augmented data set containing fitted values and residuals alongside the original predictors.
Examples
if (requireNamespace("generics", quietly = TRUE)) {
data(mtcars)
fit <- lm(mpg ~ wt + qsec, data = mtcars)
suite <- runHeteroTests(fit, mtcars, tests = c("white", "breusch_pagan"))
generics::tidy(suite)
}
#> diagnostic statistic parameter p.value estimate
#> 1 white 11.82248 5 0.03730286 NA
#> 2 breusch_pagan 3.13479 2 0.20858780 NA
#> alternative method nobs
#> 1 heteroscedasticity present White's test for heteroscedasticity 32
#> 2 <NA> Breusch-Pagan test for heteroscedasticity 32
#> status message suggestions
#> 1 ok <NA> <NA>
#> 2 ok <NA> <NA>