如何使用censReg解决“错误:由于类型(列表/列表)不兼容,无法在'.rows'x'.rows'上联接”

时间:2019-05-10 10:08:53

标签: r

我正在尝试使用censReg软件包在r中进行tobit回归。几年来,我与许多公司都有面板数据。我使用pdata.frame设置了数据,但是当我尝试运行回归时,会弹出此错误消息:

错误:由于类型(列表/列表)不兼容,无法在'.rows'x'.rows'上加入

我该怎么做才能解决此问题?

testPanelData <- pdata.frame(testSample, index = c("gvkey", "fyear"))
estResult <- censReg(REP ~ Cash + Size + Leverage, data = testPanelData)
#Error: Can't join on '.rows' x '.rows' because of incompatible types (list / list)

1 个答案:

答案 0 :(得分:0)

您的数据是否使用dplyr的{​​{1}}进行了分组?如果是,则在运行group_by()模型时会出现此错误。要解决此问题,请将plm::plm()附加到您的ungroup()命令中,例如:

dplyr