* * Example 8.3, page 269 * cal 1955 open data table8-8.prn data(format=prn,org=columns) 1955:1 1974:1 table * set loggdp = log(gdp) set logemp = log(employment) set logcap = log(capital) linreg loggdp # constant logemp logcap * * Testing b2+b3=1.0 (or 1.0xb2+1.0xb3=1.0) using RESTRICT * restrict(title="Test of b2+b3=1.0") 1 # 2 3 # 1.0 1.0 1.0 * * Testing by using SUMMARIZE, which computes the sum of the requested * coefficients, and the standard error of the sum. The t-stat in the SUMMARIZE * output is for the null of the sum being zero, while we want to test that it's * one. We can get the t stat for our test by taking * * (sum-1)/std error * * from the output, or by doing the same computation using compute and the %sumlc * and %varlc variables, which have the sum and variance of the sum. * summarize # logemp logcap compute tstat=(%sumlc-1)/sqrt(%varlc) cdf(title="Test of b2+b3=1 using SUMMARIZE output") ttest tstat %ndf * * Testing by restricted/unrestricted regressions. We have to use the RSS form, * since the dependent variable is different. * compute rssu=%rss,ndfu=%ndf set loggdpdemp = log(gdp/employment) set logcapdemp = log(capital/employment) linreg loggdpdemp # constant logcapdemp compute f=((%rss-rssu)/1)/(rssu/ndfu) cdf(title="Test of b2+b3=1 using Restricted/Unrestricted Regressions") ftest f 1 ndfu