[R] Attribute Length Error when Trying plm Regression

lross8 lross8 at kent.edu
Wed Sep 4 21:22:48 CEST 2013


Hello,

I am trying to run a fixed effects panel regression on data containing 5
columns and 1,494 rows. 

I read the data in as follows:

>drugsXX<-read.csv(file="C:\\Folder\\vX.X\\Drugs\\drugsXX_panel.csv",
head=TRUE, sep=",")

Verified it read in correctly and had a good data.frame:
>dim(drugsXX)
[1] 1494    5
>drugs XX
produce expected data with correct column names

The issue is, when I go to run the plm using:
>fixed <- plm (h ~ o + m + a, data=drugsXX, index=c("h","year"),
model="within") 

I get this error:
Error in names(y) <- namesy : 
  'names' attribute [996] must be the same length as the vector [0]

I know the data recognizes that I have 5 columns. I also know that there's
nothing wrong with row 996 (I even want back and checked for hidden
characters in the original .csv file).

traceback() was useless:
4: pmodel.response.pFormula(formula, data, model = model, effect = effect, 
       theta = theta)
3: pmodel.response(formula, data, model = model, effect = effect, 
       theta = theta)
2: plm.fit(formula, data, model, effect, random.method, inst.method)
1: plm(h ~ o + m + a, data = drugsXX, index = c("h", 
       "year"), model = "within")

What explicit steps can I follow to get my panel regression to run? 

Thank you, 
Laura



--
View this message in context: http://r.789695.n4.nabble.com/Attribute-Length-Error-when-Trying-plm-Regression-tp4675384.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list