hac function: pvalues or confidence intervals

조회 수: 4 (최근 30일)
Fregior
Fregior 2017년 3월 18일
댓글: Tamas Bodai 2021년 4월 28일
Hi, the function
hac
returns as coefficients the same of standard OLS. Is this correct? What changes is the covariance matrix.
At this point I would like to ask you how I could obtain the pvalues of the coefficients with hac methodology or how to get a confidence interval. I googled a bit but I could not find specific answer.
Thanks

채택된 답변

Hang Qian
Hang Qian 2017년 6월 28일
Hi Fregior,
Yes, the point estimator returned by HAC is the same as the OLS estimator.
HAC returns the covariance matrix EstCov. Then we can compute the standard erros, t-statistics, p-values and confidence intervals:
SE = sqrt(diag(EstCov))
tStat = OLS ./ SE
pVal = erfc(0.7071 * abs(tStat))
CI = [OLS-2*SE, OLS+2*SE]
  댓글 수: 1
Tamas Bodai
Tamas Bodai 2021년 4월 28일
Dear Hang,
You seem to assume normality of the t-statistic. I wonder what is the correct formula for finite sample. In particular, what is the correct degree of freedom for the t-distribution that the t-statistic obeys? In the function ‘predict’, the t-distribution is used. Actually, I asked this question here. The function ‘hac’ does not seem to recalculate DFE. However, my intuition is that with some autocorrelation present, we have a smaller effective sample size and so degree of freedom. The printout by hac gives me the same effective sample size as the actual sample size, even if I apply it to data featuring autocorrelation. I wonder why the printout of this particular piece of information if it never changes.
Your help would be greatly appreciated.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Karoline Bax
Karoline Bax 2018년 8월 2일
Hello,
that is great help! Thank you, is there a way to get the R-squared and adjusted R-squared too?

카테고리

Help CenterFile Exchange에서 Probability Distributions and Hypothesis Tests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by