Confidence Intervals
Posted: Sat May 31, 2008 8:59 am
How do we get confidence intervals after the regressions? Thanks for any help.
A Forum for RATS Software and Econometrics Discussions
https://estima.com/forum/
This is probably overkill, but if you use this procedure, usingbkoksal wrote:How do we get confidence intervals after the regressions? Thanks for any help.
Code: Select all
*
* @RegConfidence(options)
* Regression post-processor to show table of confidence intervals for coefficients
*
* Options:
* CONFIDENCE=confidence level[.95]
* STDERRS=number of standard errors [not used]
*
* If you use STDERRS (for instance, STDERRS=2), you will get that specific
* multiple of standard errors +/- for the bounds. Otherwise, the value of the
* CONFIDENCE option will be used with the current degrees of freedom to determine
* the multiple.
*
* Revision Schedule:
* 06/2008 Written by Tom Doan, Estima
*
procedure RegConfidence
option real confidence .95
option real stderrs
*
local real k
local integer i
*
if %defined(stderrs)
compute k=stderrs
else
compute k=%invttest(1-confidence,%ndf)
report(action=define)
report(atrow=1,atcol=1) "Label"
report(atrow=1,atcol=2,align=center) "Coefficient" "Lower" "Upper"
do i=1,%nreg
report(atrow=i+1,atcol=1) %eqnreglabels(0)(i) %beta(i) $
%beta(i)-k*%stderrs(i) %beta(i)+k*%stderrs(i)
end do i
report(atcol=2,tocol=4,action=format,width=9)
report(action=show)
end