【RMD-617】巨乳女子校生4 Stata:复旧加入多维固定效应的中介效应号令-medhdfe
发布日期:2024-08-03 22:09 点击次数:85
1 medhdfe简介
利用Stata进行中介效应分析时【RMD-617】巨乳女子校生4,你是否仍是为奈何加动身点艺固定效应和个体固定效应而烦嚣呢?
全新编写的Stata号令medhdfe重磅首发,复旧在进行中介效应分析时收尾多维固定效应,让你和烦嚣说拜拜。
2 medhdfe特质medhdfe将中介效应号令sgmediation2与多维固定效应号令reghdfe相蚁合,完好处罚在中介效应分析时奈何加入多维固定效应的问题。
比拟在sgmediation2号令中的收尾变量部分引入多个维度虚构变量【RMD-617】巨乳女子校生4,medhdfe通过absorb加入多维固定效应,极大擢升了开动速率。
medhdfe还复旧加入矜重圭臬误,包括异方差矜重圭臬误robust和聚类矜重圭臬误cluster。
3 medhdfe语法medhdfe depvar [if exp] [in range] , iv(indepvar) mv(medvar) cv(ctrlvar) absorb(absvars) [options]其中,depvar为因变量,indepvar为自变量,medvar为中介变量,ctrlvar为收尾变量,absvars为固定维度。
亚州情色4 medhdfe示例以grunfeld.dta数据集为例,对medhdfe号令的利用进行演示。
示例以invest为因变量,mvalue为自变量,kstock为中介变量,同期收尾company公司固定效应和year年份固定效应。
webuse 'grunfeld', clearmedhdfe invest, iv(mvalue) mv(kstock) absorb(company year)
具体效果如下:【RMD-617】巨乳女子校生4
Model with dv regressed on iv (path c) reghdfe invest mvalue , absorb(company year) cluster() vce()(MWFE estimator converged in 2 iterations)HDFE Linear regression Number of obs = 200Absorbing 2 HDFE groups F( 1, 170) = 76.08 Prob > F = 0.0000 R-squared = 0.8808 Adj R-squared = 0.8604 Within R-sq. = 0.3092 Root MSE = 81.0287------------------------------------------------------------------------------ invest | Coefficient Std. err. t P>|t| [95% conf. interval]-------------+---------------------------------------------------------------- mvalue | .1799679 .0206334 8.72 0.000 .1392372 .2206986 _cons | -48.70963 23.0425 -2.11 0.036 -94.19591 -3.223356------------------------------------------------------------------------------Absorbed degrees of freedom:-----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs |-------------+---------------------------------------| company | 10 0 10 | year | 20 1 19 |-----------------------------------------------------+Model with mediator regressed on iv (path a) reghdfe kstock mvalue , absorb(company year) cluster() vce()(MWFE estimator converged in 2 iterations)HDFE Linear regression Number of obs = 200Absorbing 2 HDFE groups F( 1, 170) = 15.30 Prob > F = 0.0001 R-squared = 0.7127 Adj R-squared = 0.6637 Within R-sq. = 0.0826 Root MSE = 174.6154------------------------------------------------------------------------------ kstock | Coefficient Std. err. t P>|t| [95% conf. interval]-------------+---------------------------------------------------------------- mvalue | .1739291 .0444647 3.91 0.000 .0861551 .2617031 _cons | 87.88131 49.65618 1.77 0.079 -10.14081 185.9034------------------------------------------------------------------------------Absorbed degrees of freedom:-----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs |-------------+---------------------------------------| company | 10 0 10 | year | 20 1 19 |-----------------------------------------------------+Model with dv regressed on mediator and iv (paths b and c') reghdfe invest kstock mvalue , absorb(company year) cluster() vce()(MWFE estimator converged in 2 iterations)HDFE Linear regression Number of obs = 200Absorbing 2 HDFE groups F( 2, 169) = 217.44 Prob > F = 0.0000 R-squared = 0.9517 Adj R-squared = 0.9431 Within R-sq. = 0.7201 Root MSE = 51.7245------------------------------------------------------------------------------ invest | Coefficient Std. err. t P>|t| [95% conf. interval]-------------+---------------------------------------------------------------- kstock | .3579163 .022719 15.75 0.000 .3130667 .4027659 mvalue | .1177158 .0137513 8.56 0.000 .0905694 .1448623 _cons | -80.16378 14.84402 -5.40 0.000 -109.4674 -50.86019------------------------------------------------------------------------------Absorbed degrees of freedom:-----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs |-------------+---------------------------------------| company | 10 0 10 | year | 20 1 19 |-----------------------------------------------------+Sobel-Goodman Mediation Tests | Est Std_err z P>|z| ---------------------+------------------------------------------------ Sobel | 0.062 0.016 3.796 0.000 Aroian | 0.062 0.016 3.789 0.000 Goodman | 0.062 0.016 3.804 0.000 Indirect, Direct, and Total Effects | Est Std_err z P>|z| ---------------------+------------------------------------------------ a_coefficient | 0.174 0.044 3.912 0.000 b_coefficient | 0.358 0.023 15.754 0.000 Indirect_effect_aXb | 0.062 0.016 3.796 0.000 Direct_effect_c' | 0.118 0.014 8.560 0.000 Total_effect_c | 0.180 0.021 8.722 0.000 Proportion of total effect that is mediated: 0.346Ratio of indirect to direct effect: 0.529Ratio of total to direct effect: 1.5295 medhdfe获得 本站仅提供存储行状,统共本色均由用户发布,如发现存害或侵权本色,请点击举报。