Help with a Panel Error

Hi Everyone.
I am running a panel regression and keep getting the following error whenever I try to run a fixed effects estimator:

Error in class(x) <- setdiff(class(x), "pseries") : invalid to set the class to matrix unless the dimension attribute is of length 2 (was 0).

The pooling, firstdiff and between works fine. Just wondering what I could do to correct this one.

Sorry forgot to put in the panel r script:

Y<-cbind(gdpg)
X<-cbind(iq,rpi,gcg,gfc,se,anet,rec,fi,gdp,netb)

# Set data as panel data
pdata <- plm.data(Regression_DATA_Final_, indexes = c("id","t"))

#Descriptive Statistics
summary(Y)
summary(X)
  
# pooled OLS estimator 
pooling<- plm(Y ~ X, data = pdata, model = "pooling")
summary(pooling)

# between estimator
between <- plm(Y ~ X, data = pdata, model = "between")
summary(between)

#First differences estimator 
firstdiff <- plm(Y ~ X, data = pdata, model = "fd")
summary(firstdiff)

# Fixed effects or within estimator
fixed <- plm(gdpg ~ iq,rpi,gcg,gfc,se,anet,rec,fi,gdp, data =Regression_DATA_Final_, model = "within",index = c("id","t"))
summary(fixed)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

often errors are caused by mismatch between data used and the code.
We can't run your code and examine it without the data (or a small example sample of your data).
Can you think about reducing your input data by sampling, and then sharing the result by using the dput() function to get a copy and pasteable representation ?
(sometimes factors with many levels can be an issue, but otherwise this tends to work well)