Stata Estpost返回因子变量的错误
我试图输出连续变量和因子变量的Stata Estpost返回因子变量的错误,stata,Stata,我试图输出连续变量和因子变量的平均值和sd 社区贡献了一系列命令estout(ssc install estout) 我使用的代码如下所示: sysuse auto,clear estpost sum price length foreign bn.rep78, listwise esttab, cells("mean sd min max") nomtitle nonumber 但是,我得到了一个错误: 不允许使用因子变量和时间序列运算符 r(101) 我想知道是否有可能修复这个错误 以下
平均值
和sd
社区贡献了一系列命令estout
(ssc install estout
)
我使用的代码如下所示:
sysuse auto,clear
estpost sum price length foreign bn.rep78, listwise
esttab, cells("mean sd min max") nomtitle nonumber
但是,我得到了一个错误:
不允许使用因子变量和时间序列运算符r(101)
我想知道是否有可能修复这个错误 以下语法是合法的:
regress mpg bn.rep78
要使estpost
正常工作,您需要从rep78
中删除bn.
前缀:
estpost sum price length foreign rep78, listwise
但是,如果要汇总rep78
类别的0/1
指标变量(其平均值为类别比例),则需要手动创建它们:
tab rep78, gen(rep78x)
estpost sum price length foreign rep78x* , listwise
以下语法是合法的:
regress mpg bn.rep78
要使estpost
正常工作,您需要从rep78
中删除bn.
前缀:
estpost sum price length foreign rep78, listwise
但是,如果要汇总rep78
类别的0/1
指标变量(其平均值为类别比例),则需要手动创建它们:
tab rep78, gen(rep78x)
estpost sum price length foreign rep78x* , listwise
以下语法是合法的:
regress mpg bn.rep78
要使estpost
正常工作,您需要从rep78
中删除bn.
前缀:
estpost sum price length foreign rep78, listwise
但是,如果要汇总rep78
类别的0/1
指标变量(其平均值为类别比例),则需要手动创建它们:
tab rep78, gen(rep78x)
estpost sum price length foreign rep78x* , listwise
以下语法是合法的:
regress mpg bn.rep78
要使estpost
正常工作,您需要从rep78
中删除bn.
前缀:
estpost sum price length foreign rep78, listwise
但是,如果要汇总rep78
类别的0/1
指标变量(其平均值为类别比例),则需要手动创建它们:
tab rep78, gen(rep78x)
estpost sum price length foreign rep78x* , listwise
动态生成假人的另一种方法:
sysuse auto,clear
xi: estpost sum price length foreign i.rep78, listwise
esttab ., cells("mean sd min max") nomtitle nonumber
----------------------------------------------------------------
mean sd min max
----------------------------------------------------------------
price 6146.043 2912.44 3291 15906
length 188.2899 22.7474 142 233
foreign .3043478 .4635016 0 1
_Irep78_2 .115942 .3225009 0 1
_Irep78_3 .4347826 .4993602 0 1
_Irep78_4 .2608696 .4423259 0 1
_Irep78_5 .1594203 .3687494 0 1
----------------------------------------------------------------
N 69
----------------------------------------------------------------
xi
前缀将扩展任何因子表示法,并可与不支持因子表示法的命令一起使用。另一种动态生成假人的方法:
sysuse auto,clear
xi: estpost sum price length foreign i.rep78, listwise
esttab ., cells("mean sd min max") nomtitle nonumber
----------------------------------------------------------------
mean sd min max
----------------------------------------------------------------
price 6146.043 2912.44 3291 15906
length 188.2899 22.7474 142 233
foreign .3043478 .4635016 0 1
_Irep78_2 .115942 .3225009 0 1
_Irep78_3 .4347826 .4993602 0 1
_Irep78_4 .2608696 .4423259 0 1
_Irep78_5 .1594203 .3687494 0 1
----------------------------------------------------------------
N 69
----------------------------------------------------------------
xi
前缀将扩展任何因子表示法,并可与不支持因子表示法的命令一起使用。另一种动态生成假人的方法:
sysuse auto,clear
xi: estpost sum price length foreign i.rep78, listwise
esttab ., cells("mean sd min max") nomtitle nonumber
----------------------------------------------------------------
mean sd min max
----------------------------------------------------------------
price 6146.043 2912.44 3291 15906
length 188.2899 22.7474 142 233
foreign .3043478 .4635016 0 1
_Irep78_2 .115942 .3225009 0 1
_Irep78_3 .4347826 .4993602 0 1
_Irep78_4 .2608696 .4423259 0 1
_Irep78_5 .1594203 .3687494 0 1
----------------------------------------------------------------
N 69
----------------------------------------------------------------
xi
前缀将扩展任何因子表示法,并可与不支持因子表示法的命令一起使用。另一种动态生成假人的方法:
sysuse auto,clear
xi: estpost sum price length foreign i.rep78, listwise
esttab ., cells("mean sd min max") nomtitle nonumber
----------------------------------------------------------------
mean sd min max
----------------------------------------------------------------
price 6146.043 2912.44 3291 15906
length 188.2899 22.7474 142 233
foreign .3043478 .4635016 0 1
_Irep78_2 .115942 .3225009 0 1
_Irep78_3 .4347826 .4993602 0 1
_Irep78_4 .2608696 .4423259 0 1
_Irep78_5 .1594203 .3687494 0 1
----------------------------------------------------------------
N 69
----------------------------------------------------------------
xi
前缀将扩展任何因子表示法,并可与不支持因子表示法的命令一起使用