Please, consider that this is not THE way to go, it is just a quick roadmap to start analyzing panel data. A more rigorous procedure should be tested for the specific case of the user and supported by the literature.
After studying a bit more in detail the topic, although there is not a standardized procedure to apply to these analyses, a sequential approach that could be adopted is the following (ref and more info in this website and this video):
(example code in R
using the plm
package)
- clean the panel data and set up the panel analysis (not explained here);
Estimate a simple OLS model
OLS<-plm(Y ~ X, data = my_panel, model = "pooling")
Estimate a random effect model
random<-plm(Y ~ X, data = my_panel, model = "random")
Estimate a fixed effect model
fixed<-plm(Y ~ X, data = my_panel, model = "within")
Test the difference between the models
# LM test for random effects versus OLS
plmtest(OLS)
if the p-values is small enough, it will indicate alternative hypothesis: significant effects
, then opt for a random
effect model.
# LM test for fixed effects versus OLS
pFtest(fixed, OLS)
if the p-values is small enough, it will indicate alternative hypothesis: significant effects
, then opt for a fixed
effect model.
# Hausman test for fixed versus random effects model
phtest(random, fixed)
if the test suggests alternative hypothesis: one model is inconsistent
, then it would be more appropriate to go for a fixed
effect model.