* * Example from section 11.2 on pp 359-361 * data(org=columns,unit=input) 1 40 state change 0 -20 0 -17.5 0 -13 0 -12.5 0 -4.5 0 -4 0 -3.5 0 -2 0 -1.5 0 -1 0 -.5 0 -.5 0 0 0 0 0 .5 0 .5 0 1.5 0 2 0 2 0 2.25 0 3 0 4.5 0 4.5 0 5.5 0 6 0 6.25 0 8.25 0 9 0 10 0 10.5 0 12 0 14.75 0 34 1 -7 1 -6 1 -2.5 1 -.5 1 4 1 4.5 1 4.5 * * The parametric test can be done rather simply by a regression of change on * constant and the state dummy. The test for equality of means is done by looking * at the coefficient on the state dummy. * linreg change # constant state * * Using RATS, you can do the shuffling of the data set using the BOOT instruction * with the NOREPLACE option. This draws a SERIES of INTEGERS which, when used as * subscripts for the original dependent variable, will shuffle the data. * compute ndraws=10000 set diffs 1 ndraws = 0.0 do draws=1,ndraws boot(noreplace) shuffle set ys = change(shuffle(t)) linreg(noprint) ys # constant state compute diffs(draws)=%beta(2) end do draws * * The 95% confidence level interval can be obtained by using the %fractiles * function. We need the .025 and .975 fractiles. * compute bounds=%fractiles(diffs,||.025,.975||) density diffs / dx fx scatter(style=lines,hgrid=bounds) # dx fx