0
votes

I am trying to run a regression with a panel data from the Michigan Consumers Survey. It is the first time I am using panel data on R so I am not very aware of the package "plm" that is needed. I am setting my panel data for fixed effects on individuals (CASEID) and time (YYYY):

Michigan_panel <- pdata.frame(Michigan_survey, index = c("CASEID", "YYYY"))

Then I am using the following regression:

mod_1 <- plm(data = Michigan_panel, ICS ~  ICE + PX1Q2 +  RATEX + ZLB + INCOME + AGE + EDUC + MARRY + SEX + AGE_sq, model = "within")

However R is showing me the following error:

> mod_1 <- plm(data = Michigan_panel, ICS ~  ICE + PX1Q2 +  RATEX + ZLB + INCOME + AGE + EDUC + MARRY + SEX + AGE_sq, model = "within")
Error in plm.fit(data, model, effect, random.method, random.models, random.dfcor,  : 
  empty model

Does anyone know what I am doing wrong?

1
Use plm with the correct order of arguments, i.e., put the formula first and then the data (also, you may want to have a look at the package's vignettes which have examples how to use the function). - Helix123

1 Answers

0
votes

Could you give the link where is this specific survey? I found various dataset with this data name. I suspect (only suspect), you data isn't panel data, please check the CASEID variable.

Changing the order between formula and data in plm won't be solve your problem.

.