【发布时间】:2017-12-07 09:33:55
【问题描述】:
我正在尝试使用 plm 包在 R 中运行不平衡面板的面板回归。我正在使用“Hedonic”数据来运行相同的数据。
我试图复制以下论文中所做的类似事情:http://ftp.uni-bayreuth.de/math/statlib/R/CRAN/doc/vignettes/plm/plmEN.pdf(第 14 页,3.2.5 不平衡面板)。
我的代码如下所示:
form = mv ~ crim + zn + indus + chas + nox + rm + age + dis + rad + tax + ptratio + blacks + lstat
ba = plm(form, data = Hedonic)
但是,我在执行时收到以下错误:
Error in names(y) <- namesy :
'names' attribute [506] must be the same length as the vector [0]
traceback() 产生以下结果:
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, random.dfcor,
inst.method)
1: plm(form, data = Hedonic)
我是面板回归的新手,如果有人能帮助我解决这个问题,我将不胜感激。
谢谢。
【问题讨论】:
标签: r regression plm