TsSet

The tsset command declares a time series dataset.


Usage

. webuse gdp2
(Federal Reserve Economic Data, St. Louis Fed)

. tsset daten

Time variable: daten, 01jan1952 to 01oct2010, but with gaps
        Delta: 1 day

. tsset tq

Time variable: tq, 1952q1 to 2010q4
        Delta: 1 month

Stata will indicate if there are gaps in observations. A common issue is misspecifying the time units (e.g., specifying a date for time series data that was collected weekly)


Operators

Time series variable operators:

Note also that the operators are case-insensitive.

As an example:

webuse gdp2
tsset tq

// Create new variables
generate l_gdp_ln = l.gdp_ln
generate l_l_gdp_ln = l2.gdp_ln

// Directly reference
regress gdp_ln l.gdp_ln


Analysis

twoway (line gdp_ln tq)


CategoryRicottone

Stata/TsSet (last edited 2024-11-16 22:03:16 by DominicRicottone)