You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sourish-cmi
changed the title
Integrate Brush-Pegan test for checking homoscadasticity
Integrate Brush-Pegan test for checking heteroskedasticity
Feb 15, 2023
Here is the code for the Brush-Pegan test for checking heteroskedasticity
using HypothesisTests
functionBPTest(container::FrequentistRegression, data::DataFrame)
fm_frame =ModelFrame(container.formula, data);
X=modelmatrix(fm_frame)
e =residuals(container)
BP_Test1 =WhiteTest(X,e);
return(BP_Test1);
end
@ShouvikGhosh2048 can you please add this function in the getter and add a PR? I am adding the test below:
julia>using CRRao, RDatasets, StatsModels
julia> df =dataset("datasets", "mtcars")
julia> model =fit(@formula(MPG ~ HP + WT+Gear), df, LinearRegression());
julia> BP_tst =BPTest(model,df)
White's (or Breusch-Pagan's) test for heteroskedasticity
--------------------------------------------------------
Population details:
parameter of interest: T*R2
value under h_0:0
point estimate:8.73554
Test summary:
outcome with 95% confidence: fail to reject h_0
one-sided p-value:0.4620
Details:
T*R^2 statistic:8.73554
degrees of freedom:9
type: White
julia>pvalue(BP_tst)
0.46203539153321815
Brush-Pegan test for checking heteroskedasticity
Integrate Brush-Pegan test (aka. WhiteTest) from
HypothesisTest
packageDescribe the solution you'd like
Possible code would look like:
The text was updated successfully, but these errors were encountered: