Stata 如何对CEM匹配的数据运行ttest?

Stata 如何对CEM匹配的数据运行ttest?,stata,Stata,我已经使用Stata对我的数据运行了CEM匹配过程,现在我想知道如何对匹配数据的变量运行t检验 /* Simple example of my code; first I run the CEM */ cem age gender education, treatment(treat) /* Then I want to have a look at the summary statistics of the entire population and the matched data (th

我已经使用Stata对我的数据运行了CEM匹配过程,现在我想知道如何对匹配数据的变量运行t检验

/* Simple example of my code; first I run the CEM */
cem age gender education, treatment(treat)

/* Then I want to have a look at the summary statistics of the entire population and the matched data (this code works fine) */
summarize age gender education
summarize age gender education [iweight=cem_weights]

/* But if I want to do a t test only on the matched data, I get an error with the weights */
ttest age, by(treat) /* works fine */
ttest age [iweight=cem_weights], by(treat) /* error saying that weights are not allowed */

如何仅对匹配的数据运行t测试?还可以选择导出匹配的数据,那么我如何才能做到这一点呢?

类似这样的操作应该可以做到:

sysuse auto, clear
cem mpg weight rep78, treatment(foreign)
mean price [iweight = cem_weight], over(foreign)  //coeflegend
lincom _b[c.price@1.foreign] - _b[c.price@0.foreign]
就个人而言,我只会使用回归和het稳健标准误差(在这里得到类似的结果,并且在更大的样本中会更接近):


像这样的东西应该可以做到:

sysuse auto, clear
cem mpg weight rep78, treatment(foreign)
mean price [iweight = cem_weight], over(foreign)  //coeflegend
lincom _b[c.price@1.foreign] - _b[c.price@0.foreign]
就个人而言,我只会使用回归和het稳健标准误差(在这里得到类似的结果,并且在更大的样本中会更接近):