* * Example 1.4.2 from pp 21-23 * open data lake.dat calendar 1875 data(format=free,org=columns) 1875:1 1972:1 lake * set trend = t linreg lake # constant trend * set y = %resids @acf(number=40) y * * In a regression, or in a transformation instruction like SET, the notation * series{lag} is used to denote the lag of a series. * linreg y # y{1} set z = %resids @acf(number=40) z * * The instruction SCATTER is used for x-y graphs. (GRAPH is used when "time" is * on the horizontal axis). SCATTER can't accept the lag notation used in the * LINREG above, so we have to create ylag as a separate series. The LINE option * on SCATTER is used to draw in a straight line. Use LINE=||intercept,slope|| * set ylag = y{1} scatter(footer="Figure 1-16 Scatter Plot of y(t-1) vs y(t)",line=||0.0,%beta(1)||) # ylag y