OLS with Newey-West and Hansen-Hodrick SE

버전 1.2.0.0 (2.34 KB) 작성자: Sandra
Computes OLS and reports Robust SE, NW AND HH corrected standard errors.
다운로드 수: 2K
업데이트 날짜: 2013/10/29

라이선스 보기

% PURPOSE: computes OLS and reports Robust SE, and Newey-West and Hansen-Hodrick adjusted heteroscedastic-serial consistent standard errors.

% Inputs:
% y = T x 1 vector, left hand variable data
% X = T x n matrix, right hand variable data
% L = number of lags to include in NW corrected standard errors
% H = number of lags to include in HH corrected standard errors
%
%Note: you must make one column of X a vector of ones if you want a
% constant.
% Output:
% beta = regression coefficients 1 x n vector of coefficients
% R2 = unadjusted
% R2adj = adjusted R2
% X2(Degrees of Freedom) = : Chi-squared statistic for all coefficients
% jointly zero.
% std = corrected standard errors.
% t_ = t-stat for NW and HH
%Note: For chi-square test program checks whether first is a constant and ignores that one for
% test. If there is only one beta the program does not report X^2
% results since t_stat^2= X2.
%Note: program automatically displays outputs in an organized format. If you want
%to disable the automatic display just comment lines 129-136.

인용 양식

Sandra (2025). OLS with Newey-West and Hansen-Hodrick SE (https://kr.mathworks.com/matlabcentral/fileexchange/43259-ols-with-newey-west-and-hansen-hodrick-se), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2012a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Tracking and Motion Estimation에 대해 자세히 알아보기
도움

도움 받은 파일: Newey-West Standard Errors

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

Now you can get results for Newey West, Hansen Hodrick and Robust SE all at once. If there is only one beta the code does not report a chi-square statistic since it is just the square of the single t_stat. Overall, I cleaned up the code.

1.1.0.0

changed beta from a 1 by n vector to a n x 1

1.0.0.0