I am trying to forecast my dependent variable 9 periods ahead, having history of 25 years. I have panel data with 34 countries and 25 years for each country – 850 observations in total. Currently I am having hard times with making predictions based on my models (pooled ols and time specific fixed effects) due to the fact, that I have many countries with their specific historical values of the dependent variable. But I want to use the results of my models to make those predictions 9 periods ahead.
The model: y = x1 + x2 + x3
pooled <- plm(log(Depvar+1)~lag(x1,8)+lag(x2,8)+lag(x3,8), index=c("country","year"), data=RMB2, model="pooling")
The code for forecasting (tried numerous combinations, but the best result so far is the same predicted value 9 periods ahead):
forecast = forecast(pooled1[["model"]][,1],h=10)
Probably I need to introduce a training set, but not sure how.
It is basically simple panel dataset, nothing special - one dependent variable and three independent. I just need the code to correctly build the forecast 9 periods ahead out of plm model.
I am currently working on a forecast and have exactly the same question. I am an absolute beginner in R and am currently trying my luck with panel data analysis. Nice to see that I am on the right track. Unfortunately my data is strictly confidential, otherwise I would be happy to provide it. I hope someone can help us.
I actually have the same problem - I am not sure if I can share my data due to our company compliance stipulations. But I gues the general mechanics should be the same for plm models, where each unit has it unique values over time. By the way, all the four variables are stationary in my case according to the Dickey–Fuller test.
Hello,
I have anonymized a part of my data set and can now share this file with you. It is economic data for 147 countries for the period 2002-2018, with one dependent variable (Y) and several independent variables (X).
The goal is a forecast of the variable Y for the years 2019 to 2025.
Am I correct in assuming that a panel data analysis with the plm function in R is the right way to do this? I would apply all models (pooled, fixed & random) and finally check which method is the most suitable using the B-P LM test and Hausman test.
I still have some questions:
are there (as with multiple linear regression) certain requirements that my data must fulfill in order to be allowed to perform a panel data analysis? Unfortunately, I have not found any information on this.
in the end I get a regression equation after all, right?. In order to make a forecast for the years 2019-2025 for the variable Y, I then need the X-values for the years 2019-2025. Once I have the values, I simply put them into the regression equation (Y = ax1+bx2... etc.) and can thus predict Y? Or is there any other way to do this?
I hope with my data we can find a solution together.
My case is quite similar, though I have lagged variables and can use them for predictions. But there should be a method, smth like exponential smoothing etc., which does not require inputs and works with several independent variables besides just autocorrelation with lagged dependent variable.