全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
5002 8
2017-05-13
请教大家,如何让回归结果中的Industry和Year变量都藏起来?即利用esttab时直接删除黄色部分和红色部分?

我的程序:
复制代码


输出的结果
1.png
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-5-13 21:32:13
建议用outreg2命令
里面有选项是关于保留显示的变量的
下面是outreg2帮助里面的例子

Example 8. Drop/keep/order variables


    Specifying a varlist can be convenient to limit the output table to only the essential coefficients.  For example, we may want to control for the influence of dummy variables, but not report their estimated coefficients.

    sysuse auto, clear
    tab rep78, gen(repair)
    regress mpg foreign weight repair1-repair4
    outreg2 weight foreign using myfile, drop(repair*)

    Alternatively, keep( ) and drop( ) can be used to control the displayed variables. Use nocons to drop constants.

    outreg2 using myfile, drop(repair*) replace
    outreg2 using myfile, keep(mpg foreign)
    outreg2 using myfile, nocons
    seeout

    There are several ways to order variables in the output. The first is to order them when running regression. The second way is to specify varlist from within outreg2. Or you might try sortvar( ) or groupvar( ).

    * single equation
    reg mpg rep78 head trunk weight
    outreg2 using myfile, replace sortvar(trunk turn)
    reg mpg rep78 head weight turn disp gear
    outreg2 using myfile, sortvar(trunk turn) see

    * multiple equations
    reg3 (mpg rep78 head trunk weight) (head trunk weight rep78 gear)
    outreg2 using myfile, replace long
    reg3 (mpg rep78 head weight turn disp ) (mpg rep78 head trunk weight gear)
    outreg2 using myfile, sortvar(trunk turn) see long

    * groupvar( ) will create super-rows
    reg mpg rep78 head trunk weight
    outreg2 using myfile, replace
    reg mpg rep78 head weight turn disp gear
    outreg2 using myfile, groupvar(Group1 trunk turn head weight Group2) see

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-5-13 21:59:20
蓝色 发表于 2017-5-13 21:32
建议用outreg2命令
里面有选项是关于保留显示的变量的
下面是outreg2帮助里面的例子
非常感谢您!我一直采用的都是outreg2,之所以现在换成esttab,是因为outreg2有两个问题:

1、OLS一直挺正常,但是Logit的回归结果使用outreg2总是异常,程序例如为:
复制代码
但是第二个回归的结果无法通过append紧接着第一个回归展示

2、如果一组回归中,有几个是OLS,有几个是Logit,那么更难以用outreg2一字排开。我的理解是
OLS的outreg2为
复制代码
但是
Logit的outreg2是
复制代码
由于outreg2的写法不同,很难处理“既包含OLS,又包含LOGIT”的一组(比如10个)回归模型
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-5-13 22:21:35
没有问题啊
logit也可以的
你重新下载一个outreg2
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-5-13 22:26:02
没有问题啊
这就是随便一个数据生成的结果
result2.xml.zip
大小:(1.68 KB)

 马上下载

本附件包括:

  • result2.xml


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-5-13 22:59:31
蓝色 发表于 2017-5-13 22:26
没有问题啊
这就是随便一个数据生成的结果


可能真是我的STATA版本问题,我原封不动地粘贴您刚刚发给我的代码,但是STATA不能识别drop
提示语为“invalid 'drop' ”
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群