Learn R Programming

olsrr (version 0.4.0)

ols_f_test: F Test for Constant Variance

Description

Test for heteroskedasticity under the assumption that the errors are independent and identically distributed (i.i.d.).

Usage

ols_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

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

f statistic

p

p-value of f

fv

fitted values of the regression model

rhs

names of explanatory variables of fitted regression model

numdf

numerator degrees of freedom

dendf

denominator degrees of freedom

vars

variables to be used for heteroskedasticity test

resp

response variable

preds

predictors

References

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

Examples

Run this code
# NOT RUN {
# model
model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars)

# using fitted values
ols_f_test(model)

# using all predictors of the model
ols_f_test(model, rhs = TRUE)

# using fitted values
ols_f_test(model, vars = c('disp', 'hp'))
# }

Run the code above in your browser using DataLab