Heteroskedasticity test

版本 1.6.0.0 (715.9 KB) 作者: Oleg Komarov
White, White special case and Breush-Pagan tests. Stat TB needed: regstats and chi2cdf.
4.5K 次下载
更新时间 2009/8/15

查看许可证

TESTHET Tests wether heteroskedasticity affects data. Need 'regstats' and 'chi2cdf' (Stat TB).

PVAL = TESTHET(RES, X, WHICHTEST, YHAT)
INPUTS:
- Res: residuals obtained by regressing Y on x1, x2 etc...(1) It can be a numeric 'n-by-1' vector or a 'n-by-p' matrix with 'p' residuals obtained from different regressions. The # of obs. is 'n'.
- X: predictors suspected of causing heteroskedasticity. Not necessarily all those in (1). Same format as Res.
- Whichtest: test chosen in format string.
a. Breush-Pagan, Koenker mod. --> -BPK
b. White --> -W
c. White, Wooldridge --> -Ws
[OPTIONAL]
- Yhat: only for '-Ws' test. Fitted values from (1). Same format as Res.

OUTPUT:
A '1-by-p' array with p-values.

EXAMPLE:
1. Regress Y on x1, x2:
--> regstats(Y, [x1 x2], 'linear', {'r','yhat'})
2. Test with -Ws:
--> TestHet(r,[x1, x2], '-Ws', yhat)

For general econometric reference:
[1] Greene, W.H. (2003 - 5th ed.) Econometric Analysis. Prentice Hall.
[2] Wooldridge, J.M. (2006 - 3rd ed.). Introductory Econometrics: A Modern Approach. Thomson - South West.
[3] Kennedy, P. (2008 - 6th ed.). A Guide to Econometrics. Blackwell Publishing.

Any comments, suggestions and critics are truly welcome.
Plz let me know if you prefer a function which doesn't use the stats toolbox.

p2v1.21

引用格式

Oleg Komarov (2024). Heteroskedasticity test (https://www.mathworks.com/matlabcentral/fileexchange/24722-heteroskedasticity-test), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2008b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.6.0.0

Error on line 80: Nseries = size(Res,2)-1 --> Nseries = size(Res,2).
Pointed out by Dan Iancu.

1.5.0.0

Added check on solvability of the system.

1.1.0.0

DemoDataset.mat was missing in the package. Added.

1.0.0.0