Test for constant variance

f_test(model, fitted_values = TRUE, rhs = FALSE, vars = NULL, ...)

Arguments

model
an object of class lm
fitted_values
logical; if TRUE, use fitted values of regression model
rhs
logical; if TRUE, specifies that tests for heteroskedasticity be performed for the right-hand-side (explanatory) variables of the fitted regression model
vars
variables to be used for for heteroskedasticity test
...
other arguments

Value

f_test returns an object of class "f_test". An object of class "f_test" is a list containing the following components:

References

Wooldridge, J. M. 2013. Introductory Econometrics: A Modern Approach. 5th ed. Mason, OH: South-Western.

Examples

# 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