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:


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

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

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

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

# 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"))

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)

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