Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用stargazer在r中报告选择模型的选择和结果方程?_R_Stargazer - Fatal编程技术网

如何使用stargazer在r中报告选择模型的选择和结果方程?

如何使用stargazer在r中报告选择模型的选择和结果方程?,r,stargazer,R,Stargazer,我用R中sampleSelection包的selection()函数计算了一个tobit类型2模型 现在我想用stargazer创建一个回归表,它正式支持sampleSelection包及其“selection”对象 stargazer(tobit, tobit_2, type = "html", out = "tobit2.html", model.names = TRUE, star.char = c("+", "*", "**", "***"), star.cutoffs =

我用R中sampleSelection包的selection()函数计算了一个tobit类型2模型

现在我想用stargazer创建一个回归表,它正式支持sampleSelection包及其“selection”对象

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)
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我发现了一个(相当脏)的解决方案,尽管它仍然可以帮助其他人:

我将selection.equation设置为TRUE,复制选择对象,并在复制对象中切换选择和结果方程的参考索引。现在在两个模型上调用stargazer会给出一个包含选择和结果方程的表(尽管stargazer仍然认为它返回了两次选择方程)

#tobit_2是从selection()函数返回的选择对象
#从样本选举方案中
托比特氧化铀
# 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>"))