* * Example from page 275, section 8.8 * Chow test * cal 1970 open data table8-9.prn data(format=prn,org=columns) 1970:1 1995:1 table * * Chow test for sample split at 1981:1 * linreg savings 1970:1 1981:1 # constant income compute ndf1=%ndf,rss1=%rss linreg savings 1982:1 1995:1 # constant income compute ndf2=%ndf,rss2=%rss linreg savings 1970:1 1995:1 # constant income compute ndfr=%ndf,rssr=%rss compute rssu=rss1+rss2,ndfu=ndf1+ndf2 compute fchow=((rssr-rssu)/%nreg)/(rssu/ndfu) * cdf(title="Chow Test for Split at 1981:1") ftest fchow %nreg ndfu * * Test for constant variance. Note that, unlike most F tests, this is a * two-tailed test: either a small value or a large value should lead to * rejection. The cdf instruction produces a significance level (p-value) for the * more typical one-tailed test. To get a two-tailed significance (for H0: same * variance vs H1: variances aren't the same), multiply small p-values by 2, and * transform large ones to 2x(1-stated pvalue). For instance if you exchange the * roles of samples 2 and 1 in the formulas below, you would get a p-value of * .98972. The two-tailed test significance would be 2x(1-.98972), i.e. you would * reject same variances at the .05 level. * cdf(title="Test of equal variances") ftest (rss2/ndf2)/(rss1/ndf1) ndf2 ndf1