Thanks for the prompt reply.
Due to confidentiality issue I can’t show you the code part.
My data contains various information variables for all the countries for the years 1960-2014. So it is in a panel data format. My output variable is a count variable which is a positive whole number for individual countries. So I went for a negative binomial regression on panel data. After some research I found a package “pglm” in R for similar task. But since the package is very new and only the first version is available, there is no predict() function to predict the output variable by applying the built model on a new data set containing the same variables for the year 2015 (except the output count variable value).
you can find the details about the package in the below link:
The format of my equation:
NB_Pan_Mod = pglm(Count ~ A + B+C +D ,data = train_pan
,family = negbin, model = “within”,index=c(‘Country’, ‘Year’))
But the following code does not work:
test_pan$Pred= predict(NB_Pan_Mod , test_pan ,type= “response”)
Hope this helps.
Please let me know if you need any more details.