如何在 r 中使用 stargazer 报告选择模型的选择和结果方程?
How to report both selection and outcome equation of selection models with stargazer in r?
我用 R 中 sampleSelection 包的 selection() 函数计算了一个 tobit 2 型模型。
我现在想用官方支持 sampleSelection 包及其 'selection' 对象的 stargazer 创建回归 table。
stargazer(tobit, tobit_2, type = "html", out = "tobit2.html", model.names = TRUE,
star.char = c("+", "*", "**", "***"), star.cutoffs = c(0.1, 0.05, 0.01, 0.001),
report = 'vc*p', notes = "+ p<0.1; * p<0.05; ** p<0.01; *** p<0.001",
notes.append = F, selection.equation = TRUE)
然而,根据官方文档,只能报告选择或结果方程式。我显然想将两者并排报告。
selection.equation
a logical value that indicates whether the selection equation (when argument is
set to TRUE) or the outcome equation (default) will be reported for heckit and
selection models from the package sampleSelection
有没有人以前遇到过这个问题并且有解决方案如何方便地同时报告这两个问题table?
非常感谢!
我找到了一个(相当肮脏的)解决方案,它可能仍然对其他人有帮助:
我将 selection.equation 设置为 TRUE,复制选择对象并在复制的对象中切换选择和结果方程的参考索引。现在在两个模型上调用 stargazer 都会给出 table 以及选择和结果方程(尽管 stargazer 仍然认为它返回了两次选择方程)
# tobit_2 is a selection-object returned from the selection() function
# from the sampleSelection package
tobit_2O <- tobit_2
tobit_2O$param$index$betaO <- tobit_2$param$index$betaS
tobit_2O$param$index$betaS <- tobit_2$param$index$betaO
stargazer(tobit_2, tobit_2O, selection.equation = TRUE,
column.labels = c("<em>selection</em>", "<em>outcome</em>"))
我用 R 中 sampleSelection 包的 selection() 函数计算了一个 tobit 2 型模型。
我现在想用官方支持 sampleSelection 包及其 'selection' 对象的 stargazer 创建回归 table。
stargazer(tobit, tobit_2, type = "html", out = "tobit2.html", model.names = TRUE,
star.char = c("+", "*", "**", "***"), star.cutoffs = c(0.1, 0.05, 0.01, 0.001),
report = 'vc*p', notes = "+ p<0.1; * p<0.05; ** p<0.01; *** p<0.001",
notes.append = F, selection.equation = TRUE)
然而,根据官方文档,只能报告选择或结果方程式。我显然想将两者并排报告。
selection.equation a logical value that indicates whether the selection equation (when argument is set to TRUE) or the outcome equation (default) will be reported for heckit and selection models from the package sampleSelection
有没有人以前遇到过这个问题并且有解决方案如何方便地同时报告这两个问题table?
非常感谢!
我找到了一个(相当肮脏的)解决方案,它可能仍然对其他人有帮助:
我将 selection.equation 设置为 TRUE,复制选择对象并在复制的对象中切换选择和结果方程的参考索引。现在在两个模型上调用 stargazer 都会给出 table 以及选择和结果方程(尽管 stargazer 仍然认为它返回了两次选择方程)
# tobit_2 is a selection-object returned from the selection() function
# from the sampleSelection package
tobit_2O <- tobit_2
tobit_2O$param$index$betaO <- tobit_2$param$index$betaS
tobit_2O$param$index$betaS <- tobit_2$param$index$betaO
stargazer(tobit_2, tobit_2O, selection.equation = TRUE,
column.labels = c("<em>selection</em>", "<em>outcome</em>"))