Solved – How to do likelihood ratio test to compare two panel models (plm) in R

likelihood-ratiopanel dataplmr

I have a problem to run a likelihood ratio test to compare two panel regression models in order to find whether one model is significantly better than the another one. However, neither lrtest nor anova functions can be applied to 'plm' class. Due to the limit of my statistic knowledge, I failed to understand the likehihood ratio test formula and thus would like to ask for help to solve this problem.

Sample code could be:

data("Produc", package = "plm")
mod1 <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
          data = Produc, index = c("state","year"))
mod2 <- plm(log(gsp) ~ log(pcap) + log(pc) + unemp,
          data = Produc, index = c("state","year"))
#However, anova(mod1, mod2) or lrtest(mod1, mod2) will report a error

Best Answer

As far as I'm aware, plm is a linear model and I think it is OLS estimation not maximum likelihood. If that's right, you have no likelihood to test in that way.

If it is OLS-based, you could compare the adjusted R-squared and use the better one, provided your model assumptions hold.