***************************************************************************** * * Dofile "3.Code_Article Equity 1_R1.do" * * Project: Horizontal equity in the Dutch LTC system * * Purpose: Provide the code used to derive the results presented in * Tenand, Bakx and van Doorslaer / Equity paper 1 * --> First revision after submission to Health * Economics (summer 2019) * * Author: MT * * Created: January 2019 * Last modif: Sept, 3 2019 * /* Cleaned (headcounts deleted) on 15/01/2021 */ * ***************************************************************************** * Globals for directories do "H:\Marianne\Dofile\0.Directories.do" * Globals for options /* 1: entire population; 2: eligible for home care; 2: eligible for institutional care */ global pop = 1 * Dataset if $pop == 1 { use "${base_perso}\data_phase1.dta", clear global type All } if $pop == 2 { use "${base_perso}\data_phase1_hc.dta", clear global type HC } if $pop == 3 { use "${base_perso}\data_phase1_ic.dta", clear global type IC } set more off *** Variables creation *** if $pop == 1 { gen y = hc_value + ic_value + pb_value gen x = hc_elig_value + ic_elig_value } if $pop == 2 | $pop == 3 { gen y = use_value gen x = needs_value } label var y "LTC use" label var x "CIZ--assessed LTC needs" foreach var in y x { replace `var' = `var'/1000 } foreach var in hc ic pb hc_elig ic_elig care_elig care_use { replace `var'_value = `var'_value/1000 } gen income_decile = 1 forvalues i=2/10{ replace income_decile = `i' if income_decile_`i' == 1 } label var income_decile "Income decile" forvalues i=1/10{ label var income_decile_`i' "Income decile `i'" } cap drop income_bottom death_2012 elig_both dur gen income_bottom = (income_decile <= 5) label var income_bottom "Bottom 50% of income" gen death_2012 = (year(dod) == 2012) label var death_2012 "Haved died in 2012" gen elig_both = (elig_hc_some == 1 & elig_ic_some == 1) label var elig_both "Eligible for both HC and IC" gen dur=duration_hc+duration_ic label var dur "Number of days of LTC eligibility" /**************************************************************************** *** Part A: Descriptive statistics ****************************************************************************/ *** 1. Table of descriptive statistics *** ****************************************** global elig "elig_hc_some elig_ic_some elig_both hc_elig_value ic_elig_value care_elig_value nb_indication dur" global use "hc_use ic_use ic_hc_use pb_takeup care_use hc_value ic_value pb_value care_use_value" global demo "woman age_60_69 age_70_79 age_80_84 age_85_89 age_90_ death_2012 married partner_in_hh hh_nb_pers origin_nl origin_turk origin_maroc origin_surinam origin_dutch_windies origin_western origin_nwestern" global econ "income_eq wealth_ind owner_house main_res_ind" qui estpost su $elig $use $demo $econ est store $type matrix b=e(mean)' matrix sd=e(sd)' putexcel set "$results\Excel_files\SD.xlsx", sheet(SD_$type, replace) modify putexcel A1=("$type") B1=("Variables") C1=("Coefficients") B2=matrix(b), rownames nformat(number_d3) putexcel set "$results\Excel_files\SD.xlsx", sheet(SD_$type) modify putexcel D1=("Standard deviation") D2=matrix(sd), nformat(number_d3) preserve foreach var in $elig $use $demo $econ { foreach v of varlist `var' { label var `v' `"\hspace{0.3cm} `: variable label `v''"' } } if $pop == 1 { esttab All using "$tables\SD.txt", replace /// refcat(elig_hc "\emph{Eligibility}" hc_use "\emph{Use}" woman "\emph{Demographics}" income_eq "\emph{Socio-economic characteristics}", nolabel) /// cells("mean(fmt(3)) sd(fmt(3))") /// label booktabs nonum collabels(,none) gaps plain /// title(Descriptive statistics on the sample.\label{tab:sd}) } if $pop == 2 | $pop == 3 { esttab $type using "$tables\SD_subgroups.txt", replace /// refcat(elig_hc "\emph{Eligibility}" hc_use "\emph{Use}" woman "\emph{Demographics}" income_eq "\emph{Socio-economic characteristics}", nolabel) /// mtitle("Eligible for HC" "Eligibile for IC") /// cells(mean(fmt(3))) label booktabs nonum collabels(none) gaps plain /// title(Descriptive statistics on the subgroups.\label{tab:sd_sub}) } restore *** 2. Concentration curves *** ******************************* global ptile 1000 preserve sort income_eq rin egen income_mil = cut(income_eq), group($ptile) foreach var in y x { bysort income_mil: egen total_`var' = total(`var') } bysort income_mil: egen total_income = total(income_eq) keep income_mil total_y total_x total_income duplicates drop foreach var in y x { gen cum_`var' = 0 replace cum_`var' = cum_`var' + total_`var' if _n == 1 forvalues i=2/$ptile{ replace cum_`var' = cum_`var'[_n-1] + total_`var' if _n == `i' } gen share_`var' = 0 replace share_`var' = cum_`var'/cum_`var'[_N] } keep income_mil share_y total_y share_x total_x total_income keep income_mil share_y share_x total_y total_x total_income forvalues i=1/$ptile { replace income_mil = `i' if _n == `i' } label var income_mil "Income milliles" label var total_income "Total income in the income group" label var total_y "Total use in the income group" label var share_y "Cumulated use, as a % of total" label var total_x "Total eligibility in the income group" label var share_x "Cumulated eligibility, as a % of total" export excel using "$results\Excel_files\SD.xlsx", sheet("CC_$type") sheetreplace firstrow(varlabels) restore *** 3. Probability of LTC use by income decile *** ************************************************** preserve gen pb_use = pb_takeup if $pop != 1 { replace care_use = 0 replace care_use = 1 if y > 0 } if $pop == 2 { replace pb_use = 0 replace pb_use = 1 if pb_elighc_value > 0 replace hc_use = 0 replace hc_use = 1 if hc_use_elighc_value > 0 } if $pop == 3 { replace pb_use = 0 replace pb_use = 1 if pb_eligic_value > 0 replace hc_use = 0 replace hc_use = 1 if hc_use_eligic_value > 0 } foreach var in care hc ic pb { qui reg `var'_use income_decile_*, nocons estimates store REG_`var'_$type foreach t in b V { matrix `t'_`var' = e(`t') } } keep rin keep if _n<=10 foreach var in care hc ic pb { gen b_`var' = 0 forvalues i=1/10{ replace b_`var' = b_`var'[1,`i'] if _n == `i' } gen se_`var' = 0 forvalues i=1/10{ replace se_`var' = V_`var'[`i',`i'] if _n == `i' } } gen income_decile = 0 forvalues i=1/10{ replace income_decile = `i' if _n==`i' } drop rin * Excel export label var income_decile "Income decile" label var b_care "Care use: average" label var se_care "Care use: standard deviation" label var b_hc "Home care use: average" label var se_hc "Home care use: standard deviation" label var b_ic "Institutional care use: average" label var se_ic "Institutional care use: standard deviation" label var b_pb "Personal budget use: average" label var se_pb "Personal budget use: standard deviation" order income_decile export excel using "$results\Excel_files\SD.xlsx", sheetreplace sheet("Care_use_decile_$type") firstrow(varlabels) * Graph Stata graph twoway (scatter b_care income_decile, msymbol(circle) msize(medsmall) mcolor(gs2) connect(direct)) /// (scatter b_hc income_decile, msymbol(triangle) msize(medsmall) mcolor(gs6) connect(direct)) /// (scatter b_ic income_decile, msymbol(square) msize(medsmall) mcolor(gs10) connect(direct)) /// (scatter b_pb income_decile, msymbol(diamond) msize(medsmall) mcolor(gs8) connect(direct)), /// yline(0) xtitle("Income decile") ytitle("Probability of LTC use") /// xlab(1(1)10) ylab(0(0.1)1) /// legend(label(1 "P(LTC use)") label(2 "P(HC use)") /// label(3 "P(IC use)") label(4 "P(PB use)")) /// graphregion(color(white)) graph export "${graph}\Proba_care_use_decile_$type.png", replace restore * Conversion of entitlements into use gen x_income_bottom = x*income_bottom reg y x income_bottom x_income_bottom *** 4. Mortality by income and wealth decile *** ************************************************ *** Compute mortality rate by wealth decile *** cap drop death_2012 gen death_2012 = (year(dod) == 2012) foreach var in income wealth { qui reg death_2012 `var'_decile_*, nocons estimates store REG_`var'_death_$type foreach t in b V { matrix `t'_`var' = e(`t') } } preserve keep rin keep if _n<=10 foreach var in income wealth { gen b_`var' = 0 forvalues i=1/10{ replace b_`var' = b_`var'[1,`i'] if _n == `i' } gen `var'_decile = 0 forvalues i=1/10{ replace `var'_decile = `i' if _n==`i' } } drop rin order income_decile b_income wealth_decile b_wealth * Excel export foreach var in income wealth { label var `var'_decile "`var' decile" label var b_`var' "Probability of death in `var' decile" } export excel using "$results\Excel_files\SD.xlsx", sheetreplace sheet("Death_decile_$type") firstrow(varlabels) restore * General descriptive statistics in subsample of individuals who survived * preserve keep if death_2012 == 0 global elig "elig_hc_some elig_ic_some hc_elig_value ic_elig_value care_elig_value" global use "hc_use ic_use ic_hc_use pb_takeup care_use hc_value ic_value pb_value care_use_value" qui estpost su $elig $use est store $type matrix b=e(mean)' matrix sd=e(sd)' putexcel set "$results\Excel_files\SD.xlsx", sheet(SD_Alive_$type, replace) modify putexcel A1=("All") B1=("Variables") C1=("Coefficients") B2=matrix(b), rownames nformat(number_d3) putexcel set "$results\Excel_files\SD.xlsx", sheet(SD_Alive_$type) modify putexcel D1=("Standard deviation") D2=matrix(sd), nformat(number_d3) restore *** 5. Additional descriptive statistics *** ******************************************** graph bar x, over(woman) graph bar woman, over(income_decile) graph bar x, over(married) graph bar married, over(income_decile) * Use of vouchers across income * * * * * * * * * * * * * * * * * * mean pb_takeup, over(income_cat) gen share_pb = pb_value/y replace share_pb = 0 if y == 0 mean share_pb, over(income_cat) drop share_pb * P1 and P99 for main variables * * * * * * * * * * * * * * * * * * foreach var in income_eq wealth_ind x y { qui sum `var', d disp "p1 of variable `var':", r(p1) disp "p99 of variable `var':", r(p99) } /**************************************************************************** *** Part B: Core analysis ****************************************************************************/ *** 1. Variable creation *** **************************** * Generate the fractional rank (income) * cap program drop do_rank program define do_rank cap drop tmp sort income_eq qui sum income_eq scalar nobs = r(N) gen rank=. egen tmp = rank(income_eq) replace rank = tmp/nobs label var rank "Cumulative share of beneficiaries (poorest first)" end foreach var in x y { sum `var' gen mean_`var' = r(mean) } *** 2. Definition of controls *** ********************************* global needs x if $pop == 1 | $pop == 2 | $pop == 4 { global non_needs age_60_69 age_70_79 age_85_89 age_90_ woman partner_in_hh hh_nb_pers origin_western origin_turk origin_maroc origin_surinam origin_dutch_windies origin_nwestern income_decile_1 income_decile_2 income_decile_3 income_decile_4 income_decile_6 income_decile_7 income_decile_8 income_decile_9 income_decile_10 wealth_decile_1 wealth_decile_2 wealth_decile_3 wealth_decile_4 wealth_decile_6 wealth_decile_7 wealth_decile_8 wealth_decile_9 wealth_decile_10 owner_house /* Ref: age_80_84 ; origin_dutch */ } if $pop == 3 { global non_needs age_60_69 age_70_79 age_85_89 age_90_ woman married origin_western origin_turk origin_maroc origin_surinam origin_dutch_windies origin_nwestern income_decile_1 income_decile_2 income_decile_3 income_decile_4 income_decile_6 income_decile_7 income_decile_8 income_decile_9 income_decile_10 wealth_decile_1 wealth_decile_2 wealth_decile_3 wealth_decile_4 wealth_decile_6 wealth_decile_7 wealth_decile_8 wealth_decile_9 wealth_decile_10 owner_house } global regions i.cak_unit if $pop == 1 | $pop == 2 | $pop == 4 { global controls x age_60_69 age_70_79 age_85_89 age_90_ woman partner_in_hh hh_nb_pers origin_western origin_turk origin_maroc origin_surinam origin_dutch_windies origin_nwestern income_decile_1 income_decile_2 income_decile_3 income_decile_4 income_decile_6 income_decile_7 income_decile_8 income_decile_9 income_decile_10 wealth_decile_1 wealth_decile_2 wealth_decile_3 wealth_decile_4 wealth_decile_6 wealth_decile_7 wealth_decile_8 wealth_decile_9 wealth_decile_10 owner_house } if $pop == 3 { global controls x age_60_69 age_70_79 age_85_89 age_90_ woman married origin_western origin_turk origin_maroc origin_surinam origin_dutch_windies origin_nwestern income_decile_1 income_decile_2 income_decile_3 income_decile_4 income_decile_6 income_decile_7 income_decile_8 income_decile_9 income_decile_10 wealth_decile_1 wealth_decile_2 wealth_decile_3 wealth_decile_4 wealth_decile_6 wealth_decile_7 wealth_decile_8 wealth_decile_9 wealth_decile_10 owner_house } *** 3. Computation of CI for needs and use *** ********************************************** do_rank * CI of x and CI of y * * * * * * * * * * * * * foreach var in y x { * i) Point estimate glcurve `var', sortvar(income_eq) pvar(rank2) glvar(ccurve) /// lorenz nograph; qui sum rank scalar var_rank = r(Var) cap drop l_`var' gen l_`var' = 2*var_rank*(`var'/mean_`var') qui regress l_`var' rank scalar c_`var' = _b[rank] * ii) Standard error sort rank gen cclag = ccurve[_n-1] replace cclag=0 if cclag ==. gen asqr = ((`var'/mean_`var')*(2*rank-1-c_`var')+2-cclag-ccurve)^2 qui sum asqr scalar var=(r(mean)-(1+c_`var')^2)/r(N) scalar se_`var' = sqrt(var) drop rank2 ccurve cclag l_`var' asqr } foreach var in y x { disp "Concentration index of `var':", c_`var' disp "Concentration index of `var' (se):", se_`var' } *** 4. Computation of need-standardized use and HI *** ****************************************************** sca HI_y = c_y - c_x * Need_predicted LTC use * * * * * * * * * * * * * * * gen y_pr = x*(mean_y/mean_x) * Need_standardized LTC use * * * * * * * * * * * * * * * * gen y_is = y - y_pr + mean_y cap label var y_is "(Indirectly) standardized care use" *mean y_is, over(income_cat) *graph bar y_is, over(income_cat) /* HI is also equal to the CI of y_is */ glcurve y_is, sortvar(income_eq) pvar(rank2) glvar(ccurve) /// lorenz nograph; qui sum rank scalar var_rank = r(Var) cap drop l_y_is gen l_y_is = 2*var_rank*(y_is/mean_y) qui regress l_y_is rank scalar c_y_is = _b[rank] drop rank2 ccurve disp "Concentration index of y_is:", c_y_is * Inference on HI * * * * * * * * * * * glcurve y_is, sortvar(income_eq) pvar(rank2) glvar(ccurve) /// lorenz nograph; sort rank gen cclag = ccurve[_n-1] replace cclag=0 if cclag ==. gen asqr = ((y_is/mean_y)*(2*rank-1-HI_y)+2-cclag-ccurve)^2 qui sum asqr scalar var=(r(mean)-(1+HI_y)^2)/r(N) scalar se_y_is = sqrt(var) drop rank2 ccurve cclag asqr disp "HI of LTC use", HI_y disp "HI of LTC use (se)", se_y_is *** 5. Linear regression / model of LTC use *** *********************************************** global ratio = mean_y/mean_x constraint 1 x = $ratio qui xi: cnsreg y $needs $non_needs $regions, constraints(1) vce(robust) nocons estimates store REG_$type /* No R^2: Maximum likelihood estimation */ * Export Excel matrix b=e(b)' matrix V=e(V) preserve keep rin keep if _n==1 forvalues i=1/64{ gen se_`i' = sqrt(V[`i',`i']) } drop rin mkmat _all, matrix(see_$type) matrix seee_$type =see_$type matrix se_$type = seee_$type' restore putexcel set "$results\Excel_files\Regressions.xlsx", sheet(Coef1_$type, replace) modify putexcel A1=("Baseline regression: LTC use on LTC needs and non-need factors") /// B2=("R-squared") C2=(e(r2)) B3=("Number of observations") C3=(e(N)) /// A5=("Variables") B5=("Coefficients") A6=matrix(b), rownames nformat(number_d3) putexcel set "$results\Excel_files\Regressions.xlsx", sheet(Coef1_$type) modify putexcel C5=("Standard errors") C6=matrix(se_$type), nformat(number_d3) * Export .tex * foreach ft in tex txt { esttab REG2_$type using "${tables}\Table_Regression_$type_Coef1.`ft'", replace f /// label booktabs b(%10.3f) eqlabels(none) alignment(S) nomtitles /// title(OLS regression of LTC use on CIZ--assessed needs for LTC and non--need factors.\label{tab:reg}) /// keep($needs $non_needs) /// star(* 0.05 ** 0.01 *** 0.001) /// cells("b(fmt(3)star)" "se(fmt(3)par)") /// refcat(x "\emph{Need variable}" age_60_69 "\emph{Non-need variables}", nolabel) /// stats(N r2, fmt(0 3) layout("\multicolumn{1}{c}{@}" "\multicolumn{1}{S}{@}") labels(`"Observations"' `"\(R^{2}\)"')) /// prehead(`"\begin{table}[h!]\centering"' `"\footnotesize"' /// `"\caption{@title}"' `"\vspace{0.3cm}"' `"\begin{tabular}{lC{3cm}}"' /// `"\toprule"' `"&\multicolumn{1}{c}{Dependent variable: value of LTC use} \\"' ) /// posthead(`"\addlinespace"' `"\midrule"') /// prefoot(`"Contracting LTC regions & Yes \\"' `"\midrule"') /// postfoot(`"\bottomrule"' `"\end{tabular}"' /// `"\medskip\begin{minipage}{0.85\textwidth} {\footnotesize \textsc{Notes:} The monetary value of LTC use and CIZ--assessed needs, income and wealth are expressed in thousands euros. \par}\end{minipage}"' /// `"\end{table}"' `"\normalisze"') } *** 6. Decomposition analysis *** ********************************* foreach x of global non_needs { qui { scalar b_`x' = _b[`x'] corr rank `x', c scalar cov_`x' = r(cov_12) sum `x' scalar mean_`x' = r(mean) scalar elas_`x' = (b_`x'*mean_`x')/mean_y scalar CI_`x' = 2*cov_`x'/mean_`x' scalar con_`x' = elas_`x'*CI_`x' scalar prcnt_`x' = con_`x'/c_y } } /* MT: 28.06.2019: where are the CIZ units? */ foreach x of varlist _Icak_unit_2-_Icak_unit_32 { qui { scalar b_`x' = _b[`x'] corr rank `x', c scalar cov_`x' = r(cov_12) sum `x' scalar mean_`x' = r(mean) scalar elas_`x' = (b_`x'*mean_`x')/mean_y scalar CI_`x' = 2*cov_`x'/mean_`x' scalar con_`x' = elas_`x'*CI_`x' scalar prcnt_`x' = con_`x'/c_y } } * Contribution of needs scalar sum_contr_need = c_x * Contribution of non-need variables: scalar sum_contr_nneed = 0 foreach x of global non_needs { scalar sum_contr_nneed = sum_contr_nneed + con_`x' } scalar sum_contr_cak_regions = 0 foreach x of varlist _Icak_unit_2-_Icak_unit_32 { scalar sum_contr_cak_regions = sum_contr_cak_regions + con_`x' } scalar sum_contr_nneed = sum_contr_nneed + sum_contr_cak_regions * Computing the residual scalar res = c_y foreach x of global non_needs { scalar res = res - elas_`x'*CI_`x' } foreach x of varlist _Icak_unit_2-_Icak_unit_32 { scalar res = res - elas_`x'*CI_`x' } scalar res = res - sum_contr_need * Display of results disp "Contribution of need variables:", sum_contr_need disp "Contribution of non-need variables:", sum_contr_nneed disp "Residual:", res foreach x of global non_needs { disp "`x' contribution to CI", con_`x' } scalar con_age_80_84 = 0 scalar sum_contr_age = 0 foreach x of varlist age_60_69 - age_90_ { scalar sum_contr_age = sum_contr_age + con_`x' } scalar con_origin_nl = 0 scalar sum_contr_origin = 0 foreach x of varlist origin_* { scalar sum_contr_origin = sum_contr_origin + con_`x' } foreach var in income wealth { scalar con_`var'_decile_5 = 0 scalar sum_contr_`var' = 0 foreach x of varlist `var'_decile_1 - `var'_decile_10 { scalar sum_contr_`var' = sum_contr_`var' + con_`x' } } disp "Background contribution to CI", sum_contr_origin disp "Age contribution to CI", sum_contr_age foreach var in income wealth { disp "`var' contribution to CI", sum_contr_`var' } * Export Excel preserve keep rin keep if _n==1 * CI, CI^N, CI^NN, residual and HI foreach x in c_y HI_y sum_contr_need sum_contr_nneed res { gen `x' = `x' } foreach x in y y_is { gen se_`x' = se_`x' } * Contribution of each factor foreach x in $non_needs { gen contr_`x' = con_`x' } gen contr_x = sum_contr_need foreach x in age origin income wealth cak_regions { gen sum_contr_`x' = sum_contr_`x' } drop rin if $pop != 3{ order c_y HI_y sum_contr_need sum_contr_nneed res se_y se_y_is contr_x sum_contr_age contr_woman contr_partner* contr_hh* sum_contr_origin sum_contr_income sum_contr_wealth contr_owner_house sum_contr_cak_regions contr_income* contr_wealth* contr_age* contr_origin* keep c_y HI_y sum_contr_need sum_contr_nneed res se_y se_y_is contr_x sum_contr_age contr_woman contr_partner_in_hh contr_hh_nb_pers sum_contr_origin sum_contr_income sum_contr_wealth contr_owner_house sum_contr_cak_regions } if $pop == 3{ order c_y HI_y sum_contr_need sum_contr_nneed res se_y se_y_is contr_x sum_contr_age contr_woman contr_married sum_contr_origin sum_contr_income sum_contr_wealth contr_owner_house sum_contr_cak_regions contr_income* contr_wealth* contr_age* contr_origin* keep c_y HI_y sum_contr_need sum_contr_nneed res se_y se_y_is contr_x sum_contr_age contr_woman contr_married sum_contr_origin sum_contr_income sum_contr_wealth contr_owner_house sum_contr_cak_regions } mkmat _all, matrix(m) matrix matrice = m' restore putexcel set "$results\Excel_files\Inequality_decomposition.xlsx", sheet(Decomposition_Coef1_$type, replace) modify if $pop != 3{ putexcel A1=("CI, HI and basic decomposition") B1=matrix(matrice) /// A6=("Standard errors of CI and HI") A9=("Aggregate decomposition") /// , rownames nformat(number_d3) } if $pop == 3{ putexcel A1=("CI, HI and basic decomposition") B1=matrix(matrice) /// A6=("Standard errors of CI and HI") A9=("Aggregate decomposition") /// , rownames nformat(number_d3) } */ foreach x of varlist age wealth_ind income_eq { qui{ corr rank `x', c scalar cov_`x' = r(cov_12) sum `x' scalar mean_`x' = r(mean) scalar CI_`x' = 2*cov_`x'/mean_`x' } disp "`x'", CI_`x' } foreach x of global non_needs { qui{ corr rank `x', c scalar cov_`x' = r(cov_12) sum `x' scalar mean_`x' = r(mean) scalar CI_`x' = 2*cov_`x'/mean_`x' } disp "`x'", CI_`x' } *** 7. Additional analyses *** ****************************** reg y_is woman reg y_is partner_in_hh reg y_is woman if partner_in_hh == 0 reg y_is woman if partner_in_hh == 1 graph bar y_is if partner_in_hh == 0, over(woman) graph bar y_is if partner_in_hh == 1, over(woman) mean y_is, over(origin) mean income_eq, over(origin) mean y_is, over(cak_unit) /**************************************************************************** *** Part C: Supplementary analysis ****************************************************************************/ *** 1. Wealth-standardized use *** ********************************** graph bar (mean) y_is, over(wealth_decile) foreach var in income wealth { preserve cap drop `var'_decile gen `var'_decile = 1 forvalues i=2/10 { qui replace `var'_decile = `i' if `var'_decile_`i' == 1 } bys `var'_decile: egen y_is_mean_`var' = mean(y_is) label var `var'_decile "`var' decile" label var y_is_mean_`var' "Average need-standardized LTC use in the decile" keep `var'_decile y_is_mean_`var' duplicates drop export excel using "$results\Excel_files\NeedStandardizedUse_deciles.xlsx", /// sheet("`var'_Coef1_$type") sheetreplace firstrow(varlabels) restore } *** 2. Dealing with the dead *** ******************************** preserve drop if year(dod) == 2012 drop mean_* foreach var in x y { qui sum `var' gen mean_`var' = r(mean) } cap drop rank do_rank * CI * * i) Point estimate foreach var in y x { cap drop rank2 cap drop ccurve glcurve `var', sortvar(income_eq) pvar(rank2) glvar(ccurve) /// lorenz nograph; qui sum rank scalar var_rank = r(Var) qui sum `var' scalar mean=r(mean) cap drop l_`var' gen l_`var' = 2*var_rank*(`var'/mean) qui regress l_`var' rank scalar c_`var' = _b[rank] * ii) Standard error sort rank gen cclag = ccurve[_n-1] replace cclag=0 if cclag ==. gen asqr = ((`var'/mean)*(2*rank-1-c_`var')+2-cclag-ccurve)^2 qui sum asqr scalar var=(r(mean)-(1+c_`var')^2)/r(N) scalar se_`var' = sqrt(var) drop rank2 ccurve cclag l_`var' asqr } foreach var in y x { disp "Concentration index of `var':", c_`var' disp "Concentration index of `var' (se):", se_`var' } scalar HI_y = c_y - c_x cap drop y_is gen y_is = y - x*(mean_y/mean_x) + mean_y glcurve y_is, sortvar(income_eq) pvar(rank2) glvar(ccurve) /// lorenz nograph; sort rank gen cclag = ccurve[_n-1] replace cclag=0 if cclag ==. gen asqr = ((y_is/mean_y)*(2*rank-1-HI_y)+2-cclag-ccurve)^2 qui sum asqr scalar var=(r(mean)-(1+HI_y)^2)/r(N) scalar se_y_is = sqrt(var) drop rank2 ccurve cclag asqr disp "Horizontal inequity index of LTC use", HI_y disp "HI of LTC needs (se)", se_y_is * Excel export foreach var in c se { foreach varr in y y_is x { gen `var'_`varr' = `var'_`varr' } } gen HI_y = HI_y gen N=_N keep c_y c_x HI_y se_y se_x se_y_is N order c_y c_x HI_y se_y se_x se_y_is N keep if _n == 1 mkmat _all, matrix(m) matrix matrice = m' putexcel set "$results\Excel_files\Inequality_decomposition.xlsx", sheet(Decomposition_Alive_$type, replace) modify putexcel A1=("CI, HI and basic decomposition") B1=matrix(matrice) /// A4=("Standard errors of CI and HI") A7=("CI(x)") A9=("N") /// , rownames nformat(number_d3) restore *** Additional robustness check: dropping individuals in large households *** /* Also take individuals with negative income out */ sum income_eq if nb_adult > 3 ta nb_adult if elig_ic_some == 1 ta nb_adult if elig_ic_some == 0 /* Households with more than 2 adults are not more frequent among those eligible for IC */ preserve keep if nb_adult <= 3 keep if income >= 0 cap drop rank do_rank foreach var in y x { qui sum `var' global mean_`var' = r(mean) } foreach var in y x { cap drop ccurve rank2 glcurve `var', sortvar(income_eq) pvar(rank2) glvar(ccurve) /// lorenz nograph; qui sum rank scalar var_rank = r(Var) cap drop l_`var' gen l_`var' = 2*var_rank*(`var'/${mean_`var'}) qui regress l_`var' rank scalar c_`var' = _b[rank] } foreach var in y x { disp "Concentration index of `var':", c_`var' *disp "Concentration index of `var' (se):", se_`var' } gen y_is = y - x*(mean_y/mean_x) + mean_y cap label var y_is "(Indirectly) standardized care use" qui sum rank scalar var_rank=r(Var) qui sum x gen y_mod =2*var_rank*(y/mean_y) reg y_mod rank x, robust restore *** Synthetic tables of estimates *** foreach ft in tex txt { esttab REG2_All REG2_HC REG2_IC using "${tables}\Table_Regression_All.`ft'", replace f /// label booktabs b(%10.3f) eqlabels(none) alignment(S) nomtitles /// title(OLS regression of LTC use on CIZ--assessed needs for LTC and non--need factors.\label{tab:reg}) /// keep($needs $non_needs) /// star(* 0.05 ** 0.01 *** 0.001) /// cells("b(fmt(3)star)" "se(fmt(3)par)") /// refcat(x "\emph{Need variable}" age_60_69 "\emph{Non-need variables}", nolabel) /// stats(N r2, fmt(0 3) layout("\multicolumn{1}{c}{@}" "\multicolumn{1}{S}{@}") labels(`"Observations"' `"\(R^{2}\)"')) /// prehead(`"\begin{table}[h!]\centering"' `"\footnotesize"' /// `"\caption{@title}"' `"\vspace{0.3cm}"' `"\begin{tabular}{lC{3cm}}"' /// `"\toprule"' `"&\multicolumn{1}{c}{Dependent variable: value of LTC use} \\"' ) /// posthead(`"\addlinespace"' `"\midrule"') /// prefoot(`"Contracting LTC regions & Yes \\"' `"\midrule"') /// postfoot(`"\bottomrule"' `"\end{tabular}"' /// `"\medskip\begin{minipage}{0.85\textwidth} {\footnotesize \textsc{Notes:} The monetary value of LTC use and CIZ--assessed needs, income and wealth are expressed in thousands euros. \par}\end{minipage}"' /// `"\end{table}"' `"\normalisze"') } ****************** *** Copayments *** ****************** gen year = 2012 merge 1:1 rin year using "${base_perso}\copayment_data.dta", keep(master matched) keepusing(CP_hc_net CP_ic_low CP_ic_high CP_ic_net) * Estimate the difference in CP across income deciles * if $pop == 3 { mean CP_ic_net if stay_duration_tot >= 365, over(income_cat) } if $pop == 2 { mean CP_hc_net if duration_hc >= 365, over(income_cat) } * Difference in need-standardized use * mean y_is, over(income_cat) mean income_eq, over(income_cat) /* END OF THE DOFILE */