because you have a panel, (time series and cross-sectional), the differences between units are called individual effects or heterogeneity.
Panel data models acknowledge that different units behave differently by adding an individual heterogeneity term denoted to the pooled model as follows:
There are two popular panel data models that account for individual heterogeneity in two different ways.
The first model is called the fixed effects model and it assumes that the heterogeneity term f and the independent variables x are correlated.
The second model is called the random effects model and it assumes that the heterogeneity term f and the independent variables x are not correlated.
you need do Hausma test to choose btw fixed effects and random effects model
1. Estimate the fixed effects model using the command:
xtreg invest assets, fe
2. Store the results from Step 1 using the command:
est store fixed
3. Estimate the random effects model using the command:
xtreg invest assets, re
4. Finally generate the Hausman test statistic using the command
hausman fixed
The estimation of panel data models boils down to the choice between three estimators:
1. The pooled model should be used when there is no individual heterogeneity in the model.
2. When there is individual heterogeneity and it is not correlated with the independent variables of the model, the random effects model should be preferred. The Hausman test helps us decide
whether this is the case or not.
3. If the individual heterogeneity is correlated with the independent variables, the fixed effects model should be used.