I have a problem with my panel data regression. The dataset shows a balanced panel consisting of n= 10, T = 26, N= 260. However, once I start my regression I get an unbalanced panel and the n declines to 7. I am assuming that it is because I do have NAs in my dataset. Does anybody have an idea how I can get rid of this problem?
africapd <- pdata.frame(africa, index = c("Country", "Years"))
smpl <- africapd[africapd$country]
tbl <- xtable(smpl)
kable(tbl, digits = 4, align = "c", caption = "Sample")
pdim(africapd)
africapd %>%
is.pbalanced()
Balanced Panel: n = 10, T = 26, N = 260 [1] TRUE
ols_gdp <- plm(GDP_panel ~ TA_panel+ LE_panel + Infl_panel + Fert_panel+ LED_panel+ GC_panel + ROL_panel + TOT_panel + PG_panel+ HC_panel+ LDE_panel, data = africapd, index = c("Country", "Years"),effect = "individual", model = "pooling")
ols_gdp %>% is.pbalanced()
summary(ols_gdp)
Unbalanced Panel: n = 7, T = 1-10, N = 41
Please let me know if you have an idea how to fix this. Also, please tell me how to do it in R since I am relatively new to this.
Thanks in advance