View source: R/ols_BP_test_calc.R
ols_BP_test_calc | R Documentation |
Function computes the Breusch-Pagan Test for heteroskedasticity involving OLS models
Performs the BP-test from submitted lm
formula and data frame.
Background for creating this function was from "Using R for Introductory Econometrics" by Florian Heiss, page 147.
ols_BP_test_calc(df = NULL, formula_obj = NULL)
df |
A data frame with columns for observed response and predictors |
formula_obj |
A formula object following the rules of |
Returning a list with the BP statistic and its p-value.
library(wooldridge)
library(RregressPkg)
price_formula_obj = stats::as.formula("price~lotsize+sqrft+bdrms")
bp_lst <- RregressPkg::ols_BP_test_calc(
df = wooldridge::hprice1,
formula_obj = price_formula_obj
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.