# How to identify ARCH effect for time series analysis in STATA?

By Divya Dhuria,Priya Chetty & Guest on October 4, 2018

The previous articles showed how to apply Vector Auto Regression (VAR) and Vector Error Correction Model (VECM) based on the assumption that the variables either have a long run or short run causality among them. Some financial time series such as stock returns show wide swings for an extended period of time. Such behaviour is known as volatility. Volatility only represents a high variability in a series over time. This article explains the issue of volatility in data using the Autoregressive Conditional Heteroscedasticity (ARCH) model. It will identify the ARCH effect in a given time series in STATA.

Heteroscedasticity represents the problem of unequal variances over time. Therefore a time series with volatility is termed as having an ‘ARCH’ effect. The treatment of the ARCH model is slightly different from other models like Auto-Regressive Integrated Moving Average (ARIMA), VAR and VECM. In order to demonstrate the ARCH model in STATA, this article takes into consideration the stock price data for the period 1990 to 2016.

## Setting the time variable

Firstly set the time variable for the new time series stock returns. This is similar to the process followed for Gross Domestic Product (GDP) in the previous articles. Since the data of 1990-2016 is in a monthly format, use the below command:

`gen datem = m(1990m11) + _n - 1`

Here the time series variable is ‘datem’. Then format the time series data of stock returns by using the command:

`format datem %tm`

Lastly, set out the time variable “date” as a time series variable by using the command:

`tsset datem`

## Checking stationarity

To start with the analysis first check the stationarity of the stock returns time series through the Dickey-Fuller test. The command for this test is:

`dfuller LOGStock_RE, lags(0)`

Here note that variable ‘logStock_RE’ represents time-series stock return. As per the results of the test, stock returns are non-stationarity with an insignificant p-value as shown in the figure below.

Therefore, the time series stock returns are non-stationary. Thus further analysis is not possible. To transform the time series into stationary, use the method of first differencing. The command for first differencing is:

`gen  logRE_d1 = d1.logRE`

This command reveals the first-differenced time series of stock returns as variable ‘logRE_d1’. Again check the stationarity of the first differenced series by using the augmented Dickey-Fuller test. Stationarity is present in the series. Therefore proceed to the ARCH model.

## Checking the presence of volatility

To start with the ARCH model it is imperative to check the presence of volatility in time series data. The finest way to check is using time-series graphs. To plot a time-series graph of logRE_d1, follow these steps (figure below):

1. Select ‘Graphics’ on the output window
2. Select ‘Time-series graphs’
3. Click on ‘Line plots’

Alternatively, use the below command to generate the graph:

`twoway (tsline logRE_d1)`

The result line plot of the time series ‘Stock_RE_d1’ will appear.

It is noticeable in the figure above that the first-differenced time series of stock returns are highly volatile. This is because the returns are showing wide swings on some periods and calm in others. Therefore, a case of unequal variance is present here. However, the line graph cannot alone indicate the ARCH effect. Therefore, to identify the presence of the ARCH effect in the time series stock exchange, further perform different steps.

## Check for normality

Similar to confirming stationarity of time series, also confirm the normality of residuals for time series ‘Stock_RE_d1’. To perform the normality, use the command:

`histogram logRE_d1`

OR

• Select ‘Graphics’ on the output window
• Select ‘Histogram’.

The histogram will appear on the result window of STATA as shown in the figure below.

These series are leptokurtic. This means that they have lots of observations around the average and a relatively less number of observations that are far from average. Also, the centre of the histogram has a high peak and the tails are relatively heavy.

Use 5E3BCCB908B47 to save 6000 on 6001 - 10000 words standard order of research analysis.

## Check for ARCH effect

The line plot cannot alone suggest the presence of the ARCH effect. This is because the ARCH effect also carries the presence of autocorrelation which is unidentifiable in line plots. Recall from the article (Regression analysis using VAR in STATA), ‘AR’ implies the effects of lagged value on the concerned dependent variables. Thus, to rectify the applicability of ARCH effects, ascertaining the presence of autocorrelation with volatility is also important. In order to identify the autocorrelation first, regress the time series ‘Stock_RE_d1’ and then perform the LM test.

To perform regression use the command:

`reg logRE_d1`

Further to perform LM test for ARCH effect use command:

`estat archlm, lags(1)`

The figure below shows the results of both the commands: