Test for constant variance
f_test(model, fitted_values = TRUE, rhs = FALSE, vars = NULL, ...)
lm
f_test
returns an object of class "f_test"
.
An object of class "f_test"
is a list containing the
following components:
Wooldridge, J. M. 2013. Introductory Econometrics: A Modern Approach. 5th ed. Mason, OH: South-Western.
# using fitted values model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars) f_test(model)#> #> F Test for Heteroskedasticity #> ----------------------------- #> Ho: Variance is homogenous #> Ha: Variance is not homogenous #> #> Variables: fitted values of mpg #> #> Test Summary #> --------------------- #> Num DF = 1 #> Den DF = 30 #> F = 0.492 #> Prob > F = 0.488# using all predictors of the model model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars) f_test(model, rhs = TRUE)#> #> F Test for Heteroskedasticity #> ----------------------------- #> Ho: Variance is homogenous #> Ha: Variance is not homogenous #> #> Variables: disp hp wt qsec #> #> Test Summary #> --------------------- #> Num DF = 4 #> Den DF = 27 #> F = 0.459 #> Prob > F = 0.765# using fitted values model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars) f_test(model, vars = c('disp', 'hp'))#> #> F Test for Heteroskedasticity #> ----------------------------- #> Ho: Variance is homogenous #> Ha: Variance is not homogenous #> #> Variables: disp hp #> #> Test Summary #> --------------------- #> Num DF = 2 #> Den DF = 29 #> F = 0.467 #> Prob > F = 0.632