Download Introduction to Stata
Transcript
If you wanted to lag income by more than one time period, you would simply change the L. to something like "L2." or "L3." to lag it by 2 and 3 time periods respectively. Differencing Used in a similar way, the D.varname command will take the first difference, D2.varname will take the double difference (difference in difference), etc… For example: Date 02feb1999 02mar1999 02apr1999 income 120 230 245 D.income . 110 15 D2.income . . 5 Seasonal Differencing The S.varname command is similar to the D.varname, except that the difference is always taken from the current observation to the n-th observation: In other words: S.income=income(t)-income(t-1) and S2.income=income(t)income(t-2) Date 02feb1999 02mar1999 02apr1999 income 120 230 245 S.income . 110 15 S2.income . . 125 Page 60 of 61