在文獻中,健康不平等的測算包括健康集中指數、健康不平等的分解、基尼系數、廣義熵值數的泰爾指數阿特金森指數、Shapley和RIF-I-OLS(只是記錄可能的方法,并不一定適用于每個人的文章,按自己要求采用方法才是重要的)。
在學習這些方法過程中,記錄下來。
第一:健康集中指數:如何算出集中指數和集中曲線
代碼開——————————————————————————————————————————————————
help conindex
***哦豁,沒有這個命令,安裝
ssc install conindex
**我可真棒,安裝成功。
help conindex
***看看這個語句的命令是咋寫的,原理都是公式,放過它,放過自己。
conindex health, rankvar(age) truezero
**先隨便寫一個,找到感覺
conindex health, rankvar(hhincome) truezero compare(hukou)
///測算城鄉(xiāng)之間的健康不均等:health為健康狀況,hhincome為家庭收入,hukou為戶籍, truezero是廣義集中度指數
****進一步演化:wagstaff和erreygers獲得歸一化濃度指數
gen B_health = invnormal(uniform())>0
conindex B_health, rankvar(hhincome) truezero bounded limits(0 1) wagstaff rankvar((hukou)
conindex B_health, rankvar(hhincome) truezero bounded limits(0 1) erreygers rankvar((hukou)
代碼關——————————————————————————————————————————————————
conindex health, rankvar(hhincome) truezero compare(hukou) graph ytitle(“健康”) xtitle(“收入情況”)
我發(fā)現我用graph語句也畫不出圖像,出錯:command lorenz is unrecognized
這樣,我就繼續(xù)help conindex看看graph語句,發(fā)現因為 lorenz這個命令我沒有安裝,因此
代碼開——————————————————————————————————————————————————
ssc install lorenz
conindex health, rankvar(hhincome) truezero compare(hukou)? graph ytitle("健康") xtitle("收入情況")
****這樣集中指數估算和畫圖都完成啦,我們可太棒啦,一會會就學會了新的方法~~——~~
代碼關——————————————————————————————————————————————————
第二,學習兩個健康不平等的分解方法
1.shapley分解方法
代碼開——————————————————————————————————————————————————
ssc install shapley2
reg health pension age hukou gender exerice yrs_edu num_hhmember ln_ave_hhincome_1? per_GDP
***health 是健康,pension是養(yǎng)老金,age hukou gender yrs_edu exerice是個體特征,num_hhmember ln_ave_hhincome_1 是家庭特征,per_GDP 是省份層面的變量
shapley2,stat(r2) group(pension age hukou gender exerice yrs_edu num_hhmember ln_ave_hhincome_1? per_GDP )
too few variables specified
***出現問題,解決問題。
help shapley2
drop _mysample _est_myreg
reg health pension age hukou gender yrs_edu exerice num_hhmember ln_ave_hhincome_1? per_GDP
shapley2, stat(r2)
/*
shapley2, stat(r2)
Factor? ? | Shapley value |? Per cent
? ? ? ? ? |? (estimate)? | (estimate)
-----------+---------------+-----------+
insure1? ? |? 0.00055? ? ? |? ? 2.25 % |
age? ? ? ? |? 0.00004? ? ? |? ? 0.17 % |
hukou? ? ? |? 0.00497? ? ? |? 20.19 % |
gender? ? |? 0.00200? ? ? |? ? 8.13 % |
yrs_edu? ? |? 0.00210? ? ? |? ? 8.51 % |
exerice? ? |? 0.00078? ? ? |? ? 3.17 % |
num_hhme~r |? 0.00439? ? ? |? 17.84 % |
ln_ave_h~1 |? 0.00965? ? ? |? 39.17 % |
per_GDP? ? |? 0.00014? ? ? |? ? 0.57 % |
-----------+---------------+-----------+
TOTAL? ? ? |? 0.02463? ? ? |? 100.00 % |
-----------+---------------+-----------+
*/
**可以看出貢獻的百分比,哇塞,我們太棒啦,又解鎖了新技能。
**group是分組,可以按需要多嘗試
代碼關——————————————————————————————————————————————————
2.Oaxaca分解的stata實現及解讀
代碼開————————————————————————————————————————————————
ssc install oaxaca
help oaxaca
oaxaca health_self_report insure1 age? gender yrs_edu exerice num_hhmember, by(hukou)
代碼關————————————————————————————————————————————————
***學會三個方法,并掌握上述健康不平等測算,一篇論文實證部分可以算是完成了。后續(xù)有用到其他的,再更新。方法都不難,多嘗試!
————————————————
版權聲明:本文為CSDN博主「漸無書_hu」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權協(xié)議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/weixin_44652251/article/details/126507649