在Stata中为什么outreg会覆盖其他文件?

时间:2012-04-24 06:40:33

标签: stata

当我在stata中使用outreg命令导出到一个文件然后使用它导出到另一个文件,然后返回到原始文件中添加更多内容时,该命令就好像只有一个文件。正如您在下面的代码中看到的,我已经清楚地区分了这两个文件:

    (...regression...)
    outreg using fileA, landscape title(Farm Level by ///
    Stratum w/Management) starlevels(10 5 1) ///
    ctitles("Variables","Strat 1 Log Rev") replace
    (...do some other stuff, export new stuff to new file...)
    outreg using fileB,stats(b) landscape ///
    title("Normalized Ricardian Model w/Management Variables"\ ///
    "Farm Level by Stratum") noautosumm ///
    ctitles("Variables","Strat 1 Log Rev (%)") replace
    (...then another regression which I want to export to the original file...)
    outreg using fileA,landscape title(Farm Level by ///
    Stratum w/Management) starlevels(10 5 1) ///
    ctitles("Variables","Strat 1 Log Cost") merge replace
    (...But it simply merges everything together as though fileA and fileB were one)

2 个答案:

答案 0 :(得分:1)

尝试

...
outreg ...  , merge(tblnameA)
...
outreg ...  , merge(tblnameB)

它涵盖在http://www.stata-journal.com/article.html?article=sg97_4

答案 1 :(得分:1)

您可能需要查看outreg2。它是用户贡献的,允许您指定追加和替换选项。 要安装类型

findit outreg2