The previous article (Pooled panel data regression in STATA) showed how to conduct pooled regression analysis with dummies of 30 American companies. The results revealed that the joint hypothesis of dummies reject the null hypothesis that these companies do not have any alternative or joint effects. Therefore pooled regression is not a favourable technique for the panel data sets. It is also due to the fact that inclusion of too many dummies can lead to consequent loss of degrees of freedom. Therefore pooled regression is not the right technique to analyze panel data series. Therefore the present article intends to introduce to the concept of random effect model in STATA.

## Ways to conduct panel data regression

There are two ways to conduct panel data regression; random effects model and fixed effect model. In a random effect model, the intercepts in the regression equation represent the mean values of cross-sectional intercepts. On the other hand, the error terms represent random deviations of individual intercepts from the mean value. Therefore internalise the effects of different cross sections (in this case, 30 firms) as random effects in the regression equation. Since no joint or alternative effect appears in regression results, generate the effect estimates.

## Conducting random effect model in STATA

Use the below command to start with random effect panel data analysis:

xtreg EBIT LTD Int, re

In the above syntax, “xtreg” represents the command ** Earnings Before Interest and Taxes (EBIT)**,

**Long Term Debt (LTD)**and

__Interest payments (INT).__These are the variables in the order of dependent and independent variables. “re” represents the random effects for the above panel data regression. The below results will appear.

In the above results, both the independent variables have significant effects on the dependent variable ** EBIT**. Therefore,

- The coefficients of independent variable
**LDT**and INT are significant with the p-value less than 0.05. - The R square value also indicates the goodness of fit equals 68% which is significantly large.
- The rho value is 0.8516 which indicates the individual effects of cross-sections are 0.8%.

Since the data set is not normal, there are several implications in the random effect model. Although non-normal data in case of panel regression does not have any direct impact when observations are above 83, it may have some indirect impacts. Due to lack of normality, the error variances may be unequal and the problem of heteroscedasticity may be present. To check this, use the below command.

xttest0

The below result will appear.

The above figure represents the outcome of Breusch and Pegan Lagrangian Multiplier test which helps to identify the presence of heteroscedasticity. The null hypothesis for above test is homoscedasticity and alternative hypothesis suggest heteroscedasticity. Since the p values are 0.000 reject the null hypothesis. Thus the above random effect model contains the problem of heteroscedasticity.

## Correcting heteroscedasticity in the random effect model in STATA

In order to rectify the heteroscedasticity use another version of the random effect model known as ‘random effect with GLS’. Follow the below steps.

- Click on ‘Statistics’ in the main window.
- Go to ‘Longitudinal/ panel data’.
- Click on ‘Random coefficients regression by GLS’.

Or use the below STATA command.

xtrc EBIT LTD Int

The below window will appear. Here select the dependent and independent variables.

The results of the above GLS random effect model will appear.

The above results show that the model takes care of the problem of heteroscedasticity Also the variable interest does not appear to be significantly different from the previous model. The overall random effects model looks fine and indicates that the relationship between concerned variables as significant.

However, the results do not indicate if the randomness of this random effect model is correct and if it provides the effect set of solution. In order to determine that, it is necessary to perform the fixed effects model in the next article.

### Saptarshi Basu Roy Choudhury

#### Latest posts by Saptarshi Basu Roy Choudhury (see all)

- An overview of CSR policies in Mauritius, Singapore, Netherlands and India - March 2, 2019
- Types of measurement scales in survey questionnaires - January 31, 2019
- The inflow of FDI in the key industries of India - January 29, 2019

your presentations are highly educative.

kindly release the discussions on the fixed effect model which has not been discussed. thanks

very helpful! thanks!

can u do fixed effects as well?