* * Example from page 168, section 6.1 * Regression through the origin * cal 1971 open data table6-1.prn data(format=prn,org=columns) 1971:1 1980:1 * * Run the regression through the origin, and with an intercept. Compute a 95% * confidence interval for the beta coefficient each way. Note that, given the * order of the regressors in the 2nd regression, the coefficient is %BETA(2) and * the std error is %STDERRS(2). * linreg y # x * * Compute the scale for a 95% confidence interval for the t distributions. These * have different degrees of freedom for the two regressions. You can look these * up in a table, or use the %INVTTEST function. This takes two arguments: the * first is the desired tail probability (thus 1-.95=.05 for 95% confidence bands), * and the second is the degrees of freedom, which is just %ndf for the last * regression run. * compute t95 = %invttest(.05,%ndf) disp "95% confidence interval" %beta(1)-t95*%stderrs(1) %beta(1)+t95*%stderrs(1) linreg y # constant x compute t95 = %invttest(.05,%ndf) disp "95% confidence interval" %beta(2)-t95*%stderrs(2) %beta(2)+t95*%stderrs(2)