* * Example NONLIN.DAT from pp 211-212 * open data nonlin.dat data(format=free,org=columns) 1 31 time actual logactual * graph(footer="Figure 6-2 Slight nonlinear trend") # actual * * You can get the second difference directly with the DIFFERENCE instruction with * the option DIFFS=2. * diff actual / act1d diff(diffs=2) actual / act2d * stats act2d set fit2d * 32 = 2*actual{1}-actual{2}+%mean set err2d = actual-fit2d * print(picture="*.##") / actual act1d act2d fit2d err2d * * Analysis of the log series. * diff logactual / log1d stats log1d * * Compute the fitted value in log form, then take the exp of it to get back to * levels. * set fitlog * 32 = exp(logactual{1}+%mean) set errlog = actual-fitlog * print(picture="*.##") / logactual log1d fitlog errlog