het_white

In [ ]:
het_white(vdf: vDataFrame, 
          eps: str, 
          X: list)

White’s Lagrange Multiplier Test for heteroscedasticity.

Parameters

Name Type Optional Description
vdf
vDataFrame
input vDataFrame.
eps
str
Input residual vcolumn.
X
list
Exogenous variables to test the heteroscedasticity on.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [13]:
from verticapy import *
texas = vDataFrame("Texas")
texas.plot(ts = "date", columns = ["cases", "deaths"])
Out[13]:
<AxesSubplot:xlabel='"date"'>
In [14]:
from verticapy.learn.linear_model import LinearRegression

model = LinearRegression("Texas_deaths_lr")
model.drop()
model.fit(texas, X = ["cases"], y = "deaths")
texas = model.predict(texas, name = "deaths_pred")
texas["eps"] = texas["deaths"] - texas["deaths_pred"]
In [15]:
from verticapy.stats import het_white
het_white(texas, 
          eps = "eps", 
          X = ["cases"])
Out[15]:
value
Lagrange Multiplier Statistic18.447098046491487
lm_p_value1.7468664056848825e-05
F Value22.809262984579775
f_p_value7.286715469647483e-06
Rows: 1-4 | Columns: 2