R中的Estout包用IV回归输出给出错误

时间:2014-06-12 14:40:21

标签: r regression

我正在尝试使用estout包来格式化LaTeX文档的回归表。这些对我的OLS回归工作正常,但是当尝试使用ivreg()创建表时,我遇到以下错误:Error in esttab() : object 'adds' not found

以下是我的代码:

fit.IV1 <- ivreg(deflatedtotalsalary ~ earlyentrypolicy + draft_year + pick + G + MP + TRB + AST 
            + PTS + STL + BLK + PER + WS | draftpolicyregime + draft_year + pick + G + MP + TRB + AST 
            + PTS + STL + BLK + PER + WS, data = mydata)

estclear()
eststo(fit.IV1) # Store model coefficients for table.

fit.IV2 <- ivreg(undeflatedtotalsalary ~ earlyentrypolicy + pick + draftage + G + MP + TRB + AST 
             + PTS + STL + BLK + PER + WS | pick + draftage + G + MP + TRB + AST 
             + PTS + STL + BLK + PER + WS + draftpolicyregime, data = mydata)

eststo(fit.IV2) # Store model coefficients for table.
esttab()

并且,如上所述,我得到上面显示的错误。有谁知道可能导致这个问题的原因?

1 个答案:

答案 0 :(得分:0)

似乎estout包可能无法处理ivreg类型的对象(就此而言,xtable也不能)。

然而,似乎有许多包可以完成这项工作。对我来说,最简单的似乎是包装观星者。