25.03.2013 Views

Time Series - Data and Statistical Services - Princeton University

Time Series - Data and Statistical Services - Princeton University

Time Series - Data and Statistical Services - Princeton University

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Lag operators (lag)<br />

Another set of time series comm<strong>and</strong>s are the lags, leads, differences <strong>and</strong> seasonal operators.<br />

It is common to analyzed the impact of previous values on current ones.<br />

To generate values with past values use the “L” operator<br />

generate unempL1=L1.unemp<br />

generate unempL2=L2.unemp<br />

list datevar unemp unempL1 unempL2 in 1/5<br />

. generate unempL1=L1.unemp<br />

(1 missing value generated)<br />

. generate unempL2=L2.unemp<br />

(2 missing values generated)<br />

. list datevar unemp unempL1 unempL2 in 1/5<br />

datevar unemp unempL1 unempL2<br />

1. 1957q1 3.933333 . .<br />

2. 1957q2 4.1 3.933333 .<br />

3. 1957q3 4.233333 4.1 3.933333<br />

4. 1957q4 4.933333 4.233333 4.1<br />

5. 1958q1 6.3 4.933333 4.233333<br />

In a regression you could type:<br />

regress y x L1.x L2.x<br />

or regress y x L(1/5).x<br />

10<br />

PU/DSS/OTR

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!