Regstats enhanced. Robust std.errors; loops on a matrix of responses, 'onlydata' model.
Updated 1 Oct 2011

View License

This enhanced version of regstats has implemented several methods to estimate robust standard errors for coefficients:

- HC0: White robust t statistics (Eicker,1963,1967; Huber,1967; White,1980)
- HC1: With dfe correction (Hinkley,1977)
- HC2: White weighted by 1-h (MacKinnon & White,1985)
- HC3: White weighted by (1-h)^2 (Davidson & MacKinnon,1993)
- HC4: White weighted by (1-h)^delta (Cribari & Neto,2004)
- HAC: Newey West t statistics (Newey & West,1987)

Other fields (available from p5v2; visible from p5v5):
- 'empty': if the regression is performed on all NaN series the regstats2 skips the computations and sets to true this field.
- 'rankdef': if after the autoremoval of the NaNs, the design matrix is rank defiecient, regstats2 skips the computations and sets his field to true.

Those fields are meant to easily individuate those series that would otherwise interrupt the looping of the regression.

This fcn allows to supply a matrix of responses, where each columns is considered as a distinct series, instead of just a vector. The engine will loop through each column returning a set of results for each regression.

From p5v6 the MODEL argument can also be 'onlydata'. Under this option the DATA is left as it is (no constant or interaction terms are addded).

From p5v7 QLIKE loss function as in Patton (2011b).

- The GUI is oversized due to the additions. Use the Help to choose the statistics and supply a cellarray with the names of the statistics.

For major details see the help of the fcn
The published M-file contains a direct comparison with the original regstats fcn.

Comments/suggestions/error reports are welcome.


Cite As

Oleg Komarov (2024). regstats2 (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!


Version Published Release Notes

Added QLIKE loss functions as in Patton (2011b)

Per Nick Baltas suggestion: added 'onlydata' model which leaves data as it is. Added warning in case R^2 or F stat is requested under this model.

Per Sebastian Eisenbach suggestion: empty and rankdef fields are now 'visible'.
Bug in hc3 and hc4 if called together or with hc2. Edited help and description.

Per Dajun Tuo suggestion: fixed assignment error between dissimilar structures

Added hidden fields 'empty' and 'rankdef'. If the responses are an n by m matrix and all NaN series (or after NaN removal rank deficient design matrix) are present, regstats skips those series setting to true those fields.

Added link to FEX page inside the help

Eliminated useless folder in the .zip file