# How to predict and forecast using ARIMA in STATA?

After performing **Autoregressive Integrated Moving Average (ARIMA)** modelling in the previous article: **ARIMA** modelling for time series analysis in STATA, the time series GDP can be modelled through **ARIMA** (9, 2, 1) equation as below:

**ARIMA** results as in the above figure can be analyzed through several components:

**Log-likelihood:**the value of log-likelihood is 535.8 which is minimum among all the**ARIMA**models.**AIC & BIC:**The value of AIC and BIC is also less than the previous model but only up to 1 point.

## Prediction in ARIMA

To generate the prediction use the command:

STATA Command: predict chat, y

The commands ‘predict’ is used for generating values based on the selected model. In the present case, this is a fixed-effect model. Furthermore, ‘chat’ is the term given to the fitted variable of GDP. Lastly, ‘y’ denotes the fitted values. Now a separate variable as ‘chat’ will be created in the data editor window. These are the fitted values of GDP. The command for standard errors is:

STATA Command: predict stdp

Furthermore, representing the fitted and actual values together in a two-way graph. It shows standard deviations as scattered around the fitted line. For that use the command:

STATA Command: twoway lfitci gdp chat, stdp || scatter gdp chat

Here,

- ‘two-way’ is for two-way graphs in STATA
- ‘lfitci’ stands for a line of best fit with a confidence interval
- ‘GDP’ is the actual variable
- ‘chat’ is predicted variable
- ‘Stdp’ is estimated standard error
- ‘Scatter’ means scatter plot.

After running the command, the below graph will appear. It shows green dots as actual GDP values, the shaded region as a confidence interval, and straight-line as fitted values.

The above graph shows that the fitted values fully take into account the scattered values of GDP. That means although the mean of both the series are the same, ‘predict’ values of GDP do not differ from actual values of GDP.

## Forecasting

To generate the prediction use the command:

STATA Command:predict chatdy, dynamic(tq(2017q1)) y

Here,

The command ‘predict’ is used for generating values based on the selected model. The present case is a fixed-effect model. Furthermore, ‘chatdy’ is the name for the forecasted variable of GDP. Lastly, ‘dynamic’ denotes the dynamic forecasting of STATA.

Now, a separate variable as chat will appear in the data editor window. This shows the forecasted values of GDP. The forecasted values of GDP for 2017 are:

Time Period | GDP Forecasts |

2017 Q1 | 39333.45 |

2017 Q2 | 40220.4 |

2017 Q3 | 41081.47 |

2017 Q4 | 42014.04 |

Thus, **ARIMA** equations are useful in forecasting the values of GDP. However, **ARIMA** is insufficient in defining the econometrics model with more than one variable. Therefore, multivariate time series is necessary in some cases. The proceeding articles explain the procedure for conducting *Vector Auto-Regression (VAR)* analysis, which is a popular method of multivariate time series.

Priya is the co-founder and Managing Partner of Project Guru, a research and analytics firm based in Gurgaon. She is responsible for the human resource planning and operations functions. Her expertise in analytics has been used in a number of service-based industries like education and financial services.

Her foundational educational is from St. Xaviers High School (Mumbai). She also holds MBA degree in Marketing and Finance from the Indian Institute of Planning and Management, Delhi (2008).

Some of the notable projects she has worked on include:

- Using systems thinking to improve sustainability in operations: A study carried out in Malaysia in partnership with Universiti Kuala Lumpur.
- Assessing customer satisfaction with in-house doctors of Jiva Ayurveda (a project executed for the company)
- Predicting the potential impact of green hydrogen microgirds (A project executed for the Government of South Africa)

She is a key contributor to the in-house research platform Knowledge Tank.

She currently holds over 300 citations from her contributions to the platform.

She has also been a guest speaker at various institutes such as JIMS (Delhi), BPIT (Delhi), and SVU (Tirupati).

## Discuss