SAMPLE 1 36
READ (SALES.txt) SALES ADVERT
GENR L1SALES=LAG(SALES)
* List the data and take a look
PRINT SALES L1SALES ADVERT
* Adjust the sample period
SAMPLE 2 36
OLS SALES L1SALES ADVERT / COEF=BETA
* Analyze the effect of a 1 unit increase in advertising.
GEN1 A=BETA:1
GEN1 B=BETA:2
* Get the total impact of advertising on all future sales.
GEN1 TOTAL = B/(1-A)
* Find the time period at which 95% of the impact is expected.
GEN1 P95 = LOG(1-.95)/LOG(A) - 1
PRINT TOTAL P95
* Find the expected increases in sales for up to 6 months ahead.
SAMPLE 1 7
GENR AHEAD=TIME(-1)
GENR IMPACT = B*(A**AHEAD)
PRINT AHEAD IMPACT
STOP