You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Stata中如何让esttab的_cons置于indicate()生成变量行之后?

解决Stata esttab中常数项置于indicate行之后的问题

要实现将_cons放在indicate()生成的文本行之后,核心是利用indicate()行自动插入对应变量之后的特性,调整order()选项里的变量排列顺序即可。

修正方法

把indicate()对应的目标变量(此处为*.foreign)放在其他自变量之后、_cons之前,这样系统会自动把标识行插入到该变量之后,紧接着就是常数项。

修正后的代码

sysuse auto
eststo m1: regress price weight length headroom i.foreign
esttab m1, indicate("International FE = *.foreign") order(length weight headroom *.foreign _cons)

输出效果

调整后表格的顺序变为:

  • length
  • weight
  • headroom
  • 1.foreign(虚拟变量)
  • International FE(indicate生成的标识行)
  • _cons(常数项)

完全满足常数项置于indicate文本行之后的需求。

内容的提问来源于stack exchange,提问作者flxflks

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 16:12:42