Test for heteroskedasticity under the assumption that the errors are independent and identically distributed (i.i.d.).
ols_f_test(model, fitted_values = TRUE, rhs = FALSE, vars = NULL, ...)
model | An object of class |
---|---|
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. |
ols_f_test
returns an object of class "ols_f_test"
.
An object of class "ols_f_test"
is a list containing the
following components:
f statistic
p-value of f
fitted values of the regression model
names of explanatory variables of fitted regression model
numerator degrees of freedom
denominator degrees of freedom
variables to be used for heteroskedasticity test
response variable
predictors
Wooldridge, J. M. 2013. Introductory Econometrics: A Modern Approach. 5th ed. Mason, OH: South-Western.
Other heteroskedasticity tests: ols_score_test
,
ols_test_bartlett
,
ols_test_breusch_pagan
# model model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars) # using fitted values ols_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.4920617 #> Prob > F = 0.4884154# using all predictors of the model ols_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.4594694 #> Prob > F = 0.7647271# using fitted values ols_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.4669306 #> Prob > F = 0.631555