(Session – I)
Commands and syntax for data analysis using STATA
1. Open and Run the STATA application • Click on the Data on the task bar and open Data editor • Copy the data from Excel sheet and paste it on the data editor • Preserve the data • Close Data Editor
2. Type “describe” in the command space- Software will show the description of the data set.
3. Graphs i) To Draw a scatter plot of variables yvar (y-axis) against xvar (x-axis) type the following in the command box: scatter yvar xvar
ii) Draw a line graph, i.e. scatter with connected points: line yvar xvar
iii) Draw a correlogram (graphical representation of autocorrelation coefficients): ac yvar
4. Autocorrelation function: tsset time variable (set the time variable) corrgram yvar
Time series analysis
(Session –II)
Commands and syntax for data analysis using STATA 5. Open and Run the STATA application – copy the data to the Data editor
6. Declare the dataset to be time series data, type the following tsset time variable (set the time variable)
7. Moving average of xvar : tssmooth ma [new var] = xvar, window [no. of lags]
8. Single Exponential Smoothing of xvar : tssmooth exponential [new var] = xvar
9. Double –exponential smoothing of xvar : tssmooth dexponential [new var] = xvar
10. Holt-Winters seasonal smoothing of xvar : tssmooth shwinters [new var] = xvar, period (X)
(to display the changes in the result window type the command – “list”)
Time series analysis
(Session – III)
Commands and syntax for Differencing data for stationarity using STATA
11. Open and Run the STATA