【问题标题】:Stata - regress and estimates store using forvaluesStata - 使用 forvalues 进行回归和估计存储
【发布时间】:2016-10-03 21:17:04
【问题描述】:

我尝试重复以下过程:

forvalues i=1990(1)2013 { 
reg a b c if year==`i',r
est sto G`i'
}

但是,Stata 会进行回归,并且不会存储每个回归的系数。可能,forvalues 不是执行此操作的最佳命令,但我不知道哪种编码更好。

【问题讨论】:

  • 您的问题可能更好地提出为 MCVE。请参阅stackoverflow.com/help/mcve 您的问题中没有提到esttab。请注意,est stoeststo 是不同的命令。

标签: regression stata


【解决方案1】:

正如尼克建议的那样,这里非常明显的解决方案是

ssc install esttab

forvalues i=1990(1)2013 { 
    reg a b c if year==`i', r
    eststo G`i'
}

esttab, ar2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多