You are on page 1of 1

Time series analysis

Commands and syntax for data analysis using STATA


1. Open and Run the STATA application – copy the data to the Data editor

2. Declare the dataset to be time series data, type the following


tsset time variable (set the time variable)

3. Moving average of yvar :


tssmooth ma new var = yvar, window (no. of lags)

4. Single Exponential Smoothing of yvar :


tssmooth exponential new var = yvar

5. Double –exponential smoothing of yvar :


tssmooth dexponential new var = yvar

6. Holt-Winters seasonal smoothing of yvar :


tssmooth shwinters new var = yvar, forecast(3)

(to display the changes in the result window type the command – “list”)

7. Holt Winters non-seasonal smoothing of yvar:


tssmooth hwinters wc1= , parms(.7 .3) forecast(3)
line wc1 month, title("Holt-Winters Forecast with alpha=.7 and beta=.3")

You might also like