---------------------------------------------------------------------------------------------------- name: log: dofile/16_PSM_IPW_Sinteticos/psm_demo.log > hpad/run2/psm_demo.log log type: text opened on: 16 Oct 2026, 14:55:01 . . ***============================================*** . * 1. ESTADÍSTICAS DESCRIPTIVAS . ***============================================*** . . tab D 1 si | tratado, 0 | caso | contrario | Freq. Percent Cum. ------------+----------------------------------- 0 | 2,048 51.20 51.20 1 | 1,952 48.80 100.00 ------------+----------------------------------- Total | 4,000 100.00 . table D, stat(mean y2) ------------------------------------------- | Mean -------------------------------+----------- 1 si tratado, 0 caso contrario | 0 | -.9764538 1 | -.6439568 Total | -.8141953 ------------------------------------------- . . ***============================================*** . * 2. ESTIMAR EL PROPENSITY SCORE . ***============================================*** . . logit D $X Iteration 0: Log likelihood = -2771.4366 Iteration 1: Log likelihood = -2739.1739 Iteration 2: Log likelihood = -2739.1509 Iteration 3: Log likelihood = -2739.1509 Logistic regression Number of obs = 4,000 LR chi2(6) = 64.57 Prob > chi2 = 0.0000 Log likelihood = -2739.1509 Pseudo R2 = 0.0116 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0877553 .0173153 -5.07 0.000 -.1216927 -.0538179 orden_n | .3665863 .099304 3.69 0.000 .171954 .5612185 ocupado_jefe | .3288618 .0840225 3.91 0.000 .1641806 .4935429 educa_jefe | -.0240645 .0087182 -2.76 0.006 -.0411518 -.0069772 ingresos_hogar_jefe | .0012478 .0003923 3.18 0.001 .0004789 .0020167 hombre | .0653864 .0637975 1.02 0.305 -.0596544 .1904271 _cons | -.2442872 .1711683 -1.43 0.154 -.5797709 .0911964 ------------------------------------------------------------------------------------- . predict double pscore1, pr . . summ pscore1, detail Pr(D) ------------------------------------------------------------- Percentiles Smallest 1% .3176397 .2063744 5% .3790855 .2237817 10% .4057382 .227325 Obs 4,000 25% .4523237 .2518196 Sum of wgt. 4,000 50% .4928597 Mean .488 Largest Std. dev. .0631162 75% .5248827 .7421678 90% .5574216 .7430411 Variance .0039837 95% .5854625 .7467729 Skewness -.1732627 99% .6454116 .7596988 Kurtosis 4.380905 . . ***============================================*** . * 2B. PROBIT Y EFECTOS MARGINALES (margins) . ***============================================*** . . * Los coeficientes del probit no son efectos sobre la probabilidad. . * El efecto de una x continua es g(xb)*b, distinto para cada hogar. . * Con i. Stata sabe cuáles variables son binarias y para ellas . * calcula G(xb | x=1) - G(xb | x=0) en lugar de una derivada. . . probit D personas orden_n i.ocupado_jefe educa_jefe ingresos_hogar_jefe i.hombre Iteration 0: Log likelihood = -2771.4366 Iteration 1: Log likelihood = -2739.1529 Iteration 2: Log likelihood = -2739.1378 Iteration 3: Log likelihood = -2739.1378 Probit regression Number of obs = 4,000 LR chi2(6) = 64.60 Prob > chi2 = 0.0000 Log likelihood = -2739.1378 Pseudo R2 = 0.0117 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0546392 .0107219 -5.10 0.000 -.0756539 -.0336246 orden_n | .2289233 .0618875 3.70 0.000 .1076261 .3502205 1.ocupado_jefe | .205384 .052298 3.93 0.000 .1028817 .3078863 educa_jefe | -.0150867 .0054408 -2.77 0.006 -.0257504 -.0044229 ingresos_hogar_jefe | .0007748 .0002393 3.24 0.001 .0003058 .0012437 1.hombre | .0412945 .0398411 1.04 0.300 -.0367926 .1193817 _cons | -.1528546 .1068195 -1.43 0.152 -.3622169 .0565077 ------------------------------------------------------------------------------------- . predict double pscore_probit, pr . predict double xb_probit, xb . . * Efecto marginal promedio (AME): promedio sobre i de g(x_i b)*b . margins, dydx(*) Average marginal effects Number of obs = 4,000 Model VCE: OIM Expression: Pr(D), predict() dy/dx wrt: personas orden_n 1.ocupado_jefe educa_jefe ingresos_hogar_jefe 1.hombre ------------------------------------------------------------------------------------- | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0215122 .0041789 -5.15 0.000 -.0297027 -.0133216 orden_n | .09013 .0242361 3.72 0.000 .0426282 .1376318 1.ocupado_jefe | .0807343 .0203835 3.96 0.000 .0407834 .1206851 educa_jefe | -.0059398 .0021357 -2.78 0.005 -.0101256 -.001754 ingresos_hogar_jefe | .000305 .0000938 3.25 0.001 .0001211 .0004889 1.hombre | .0162608 .0156865 1.04 0.300 -.0144842 .0470058 ------------------------------------------------------------------------------------- Note: dy/dx for factor levels is the discrete change from the base level. . . * Efecto marginal en las medias de X (MEM) . margins, dydx(*) atmeans Conditional marginal effects Number of obs = 4,000 Model VCE: OIM Expression: Pr(D), predict() dy/dx wrt: personas orden_n 1.ocupado_jefe educa_jefe ingresos_hogar_jefe 1.hombre At: personas = 5.04525 (mean) orden_n = 1.10675 (mean) 0.ocupado_jefe = .191 (mean) 1.ocupado_jefe = .809 (mean) educa_jefe = 6.57575 (mean) ingresos_hogar_jefe = 72.94536 (mean) 0.hombre = .489 (mean) 1.hombre = .511 (mean) ------------------------------------------------------------------------------------- | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0217877 .0042754 -5.10 0.000 -.0301673 -.0134081 orden_n | .0912844 .0246782 3.70 0.000 .042916 .1396528 1.ocupado_jefe | .0814328 .0205396 3.96 0.000 .0411759 .1216897 educa_jefe | -.0060159 .0021695 -2.77 0.006 -.0102681 -.0017637 ingresos_hogar_jefe | .0003089 .0000954 3.24 0.001 .0001219 .0004959 1.hombre | .016465 .015883 1.04 0.300 -.0146651 .0475952 ------------------------------------------------------------------------------------- Note: dy/dx for factor levels is the discrete change from the base level. . . * Verificación a mano para educa_jefe, que es continua. . * normalden() es la densidad normal g(.) . gen double em_educa = normalden(xb_probit) * _b[educa_jefe] . summ em_educa Variable | Obs Mean Std. dev. Min Max -------------+--------------------------------------------------------- em_educa | 4,000 -.0059398 .000149 -.0060187 -.0042303 . di "AME de educa_jefe calculado a mano = " r(mean) AME de educa_jefe calculado a mano = -.00593981 . . * Verificación a mano para hombre, que es binaria. . * Para cada hogar se predice con hombre=1 y con hombre=0 y se resta. . gen double xb_h1 = xb_probit + _b[1.hombre]*(1 - hombre) . gen double xb_h0 = xb_probit - _b[1.hombre]*hombre . gen double em_hombre = normal(xb_h1) - normal(xb_h0) . summ em_hombre Variable | Obs Mean Std. dev. Min Max -------------+--------------------------------------------------------- em_hombre | 4,000 .0162608 .0004048 .0117788 .016473 . di "AME de hombre calculado a mano = " r(mean) AME de hombre calculado a mano = .01626082 . . * El logit da coeficientes distintos pero efectos marginales casi iguales . logit D personas orden_n i.ocupado_jefe educa_jefe ingresos_hogar_jefe i.hombre Iteration 0: Log likelihood = -2771.4366 Iteration 1: Log likelihood = -2739.1739 Iteration 2: Log likelihood = -2739.1509 Iteration 3: Log likelihood = -2739.1509 Logistic regression Number of obs = 4,000 LR chi2(6) = 64.57 Prob > chi2 = 0.0000 Log likelihood = -2739.1509 Pseudo R2 = 0.0116 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0877553 .0173153 -5.07 0.000 -.1216927 -.0538179 orden_n | .3665863 .099304 3.69 0.000 .171954 .5612185 1.ocupado_jefe | .3288618 .0840225 3.91 0.000 .1641806 .4935429 educa_jefe | -.0240645 .0087182 -2.76 0.006 -.0411518 -.0069772 ingresos_hogar_jefe | .0012478 .0003923 3.18 0.001 .0004789 .0020167 1.hombre | .0653864 .0637975 1.02 0.305 -.0596544 .1904271 _cons | -.2442872 .1711683 -1.43 0.154 -.5797709 .0911964 ------------------------------------------------------------------------------------- . margins, dydx(*) Average marginal effects Number of obs = 4,000 Model VCE: OIM Expression: Pr(D), predict() dy/dx wrt: personas orden_n 1.ocupado_jefe educa_jefe ingresos_hogar_jefe 1.hombre ------------------------------------------------------------------------------------- | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0215767 .0042039 -5.13 0.000 -.0298161 -.0133372 orden_n | .0901338 .0242525 3.72 0.000 .0425998 .1376678 1.ocupado_jefe | .0806921 .0203945 3.96 0.000 .0407195 .1206646 educa_jefe | -.0059168 .0021356 -2.77 0.006 -.0101025 -.0017312 ingresos_hogar_jefe | .0003068 .000096 3.20 0.001 .0001187 .0004949 1.hombre | .01608 .0156869 1.03 0.305 -.0146658 .0468258 ------------------------------------------------------------------------------------- Note: dy/dx for factor levels is the discrete change from the base level. . . * Y el propensity score de los dos modelos es casi el mismo . corr pscore1 pscore_probit (obs=4,000) | pscore1 pscore~t -------------+------------------ pscore1 | 1.0000 pscore_pro~t | 1.0000 1.0000 . . drop xb_probit em_educa xb_h1 xb_h0 em_hombre . . ***============================================*** . * 3. VERIFICAR SOPORTE COMÚN . ***============================================*** . . twoway (kdensity pscore1 if D==1, lcolor(blue) lwidth(medium)) /// > (kdensity pscore1 if D==0, lcolor(red) lwidth(medium)), /// > legend(label(1 "Tratados (D=1)") label(2 "Controles (D=0)")) /// > title("Distribución del Propensity Score") /// > xtitle("Propensity Score") ytitle("Densidad") . . graph export pscore_distribution.png, replace (file pscore_distribution.png not found) file pscore_distribution.png written in PNG format . . ***============================================*** . * 4. NEAREST NEIGHBOR (1) - SIN REEMPLAZO . ***============================================*** . . drawnorm orden . sort orden . . psmatch2 D, outcome(y2) n(1) pscore(pscore1) noreplacement ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.643956823 -.970753883 .32679706 .034208597 9.55 ----------------------------+----------------------------------------------------------- Note: S.E. does not take into account that the propensity score is estimated. | psmatch2: psmatch2: | Common Treatment | support assignment | On suppor | Total -----------+-----------+---------- Untreated | 2,048 | 2,048 Treated | 1,952 | 1,952 -----------+-----------+---------- Total | 4,000 | 4,000 . psgraph . pstest $X, treated(D) both graph ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.9098 5.0328 -6.1 53.5 | -1.99 0.047 | 1.02 | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1235 1.0948 8.8 12.1 | 2.72 0.007 | 1.42* | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .83811 .80789 7.7 46.8 | 2.48 0.013 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.541 6.6004 -1.5 12.5 | -0.48 0.634 | 0.94 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 76.558 70.658 6.7 16.4 | 2.08 0.037 | 1.10* | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51998 .50666 2.7 24.1 | 0.83 0.405 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.92; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.005 27.99 0.000 5.6 6.4 16.9 1.23 50 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . ***============================================*** . * 5. NEAREST NEIGHBOR (1) - CON SOPORTE COMÚN . ***============================================*** . . psmatch2 D $X, outcome(y2) n(1) noreplacement common Probit regression Number of obs = 4,000 LR chi2(6) = 64.60 Prob > chi2 = 0.0000 Log likelihood = -2739.1378 Pseudo R2 = 0.0117 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0546392 .0107219 -5.10 0.000 -.0756539 -.0336246 orden_n | .2289233 .0618875 3.70 0.000 .1076261 .3502205 ocupado_jefe | .205384 .052298 3.93 0.000 .1028817 .3078863 educa_jefe | -.0150867 .0054408 -2.77 0.006 -.0257504 -.0044229 ingresos_hogar_jefe | .0007748 .0002393 3.24 0.001 .0003058 .0012437 hombre | .0412945 .0398411 1.04 0.300 -.0367926 .1193817 _cons | -.1528546 .1068195 -1.43 0.152 -.3622169 .0565077 ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.642832576 -.971296239 .328463663 .034326476 9.57 ----------------------------+----------------------------------------------------------- Note: S.E. does not take into account that the propensity score is estimated. psmatch2: | psmatch2: Common Treatment | support assignment | Off suppo On suppor | Total -----------+----------------------+---------- Untreated | 0 2,048 | 2,048 Treated | 5 1,947 | 1,952 -----------+----------------------+---------- Total | 5 3,995 | 4,000 . psgraph . pstest $X, treated(D) both graph ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.9122 5.0334 -6.0 54.2 | -1.95 0.051 | 1.01 | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1238 1.095 8.8 11.9 | 2.72 0.007 | 1.42* | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .8377 .80894 7.3 49.4 | 2.35 0.019 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.5485 6.5794 -0.8 54.6 | -0.25 0.805 | 0.94 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 74.673 70.491 4.8 40.7 | 1.55 0.122 | 0.91* | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51926 .50745 2.4 32.6 | 0.74 0.461 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.91; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.004 23.92 0.001 5.0 5.4 15.7 1.17 50 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . ***============================================*** . * 6. NEAREST NEIGHBOR (1) - CON REEMPLAZO Y ES ANALÍTICOS . ***============================================*** . . psmatch2 D $X, outcome(y2) n(1) common ai(1) Probit regression Number of obs = 4,000 LR chi2(6) = 64.60 Prob > chi2 = 0.0000 Log likelihood = -2739.1378 Pseudo R2 = 0.0117 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0546392 .0107219 -5.10 0.000 -.0756539 -.0336246 orden_n | .2289233 .0618875 3.70 0.000 .1076261 .3502205 ocupado_jefe | .205384 .052298 3.93 0.000 .1028817 .3078863 educa_jefe | -.0150867 .0054408 -2.77 0.006 -.0257504 -.0044229 ingresos_hogar_jefe | .0007748 .0002393 3.24 0.001 .0003058 .0012437 hombre | .0412945 .0398411 1.04 0.300 -.0367926 .1193817 _cons | -.1528546 .1068195 -1.43 0.152 -.3622169 .0565077 ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.642832576 -.915518705 .272686129 .053318886 5.11 ----------------------------+----------------------------------------------------------- Note: Sample S.E. psmatch2: | psmatch2: Common Treatment | support assignment | Off suppo On suppor | Total -----------+----------------------+---------- Untreated | 0 2,048 | 2,048 Treated | 5 1,947 | 1,952 -----------+----------------------+---------- Total | 5 3,995 | 4,000 . psgraph . pstest $X, treated(D) both graph ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.9122 4.9692 -2.8 78.4 | -0.92 0.357 | 1.02 | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1238 1.1238 0.0 100.0 | -0.00 1.000 | 1.06 | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .8377 .83308 1.2 91.9 | 0.39 0.697 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.5485 6.5306 0.5 73.5 | 0.14 0.885 | 0.96 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 74.673 79.986 -6.0 24.7 | -1.53 0.126 | 0.41* | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51926 .51053 1.7 50.2 | 0.54 0.586 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.91; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.001 3.08 0.799 2.0 1.5 5.6 0.47* 25 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . ***============================================*** . * 7. KERNEL MATCHING - EPANECHNIKOV . ***============================================*** . . psmatch2 D $X, outcome(y2) kernel kerneltype(epan) bwidth(0.06) common Probit regression Number of obs = 4,000 LR chi2(6) = 64.60 Prob > chi2 = 0.0000 Log likelihood = -2739.1378 Pseudo R2 = 0.0117 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0546392 .0107219 -5.10 0.000 -.0756539 -.0336246 orden_n | .2289233 .0618875 3.70 0.000 .1076261 .3502205 ocupado_jefe | .205384 .052298 3.93 0.000 .1028817 .3078863 educa_jefe | -.0150867 .0054408 -2.77 0.006 -.0257504 -.0044229 ingresos_hogar_jefe | .0007748 .0002393 3.24 0.001 .0003058 .0012437 hombre | .0412945 .0398411 1.04 0.300 -.0367926 .1193817 _cons | -.1528546 .1068195 -1.43 0.152 -.3622169 .0565077 ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.642832576 -.967933289 .325100713 .034289571 9.48 ----------------------------+----------------------------------------------------------- Note: S.E. does not take into account that the propensity score is estimated. psmatch2: | psmatch2: Common Treatment | support assignment | Off suppo On suppor | Total -----------+----------------------+---------- Untreated | 0 2,048 | 2,048 Treated | 5 1,947 | 1,952 -----------+----------------------+---------- Total | 5 3,995 | 4,000 . psgraph . pstest $X, treated(D) both graph ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.9122 4.9093 0.1 98.9 | 0.05 0.963 | 1.11* | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1238 1.1033 6.3 37.1 | 1.90 0.058 | 1.28* | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .8377 .84603 -2.1 85.4 | -0.71 0.476 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.5485 6.6175 -1.8 -1.5 | -0.55 0.579 | 0.96 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 74.673 72.979 1.9 76.0 | 0.61 0.544 | 0.81* | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51926 .51647 0.6 84.1 | 0.17 0.862 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.91; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.001 5.14 0.526 2.1 1.8 7.3 1.26 75 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . ***============================================*** . * 8. KERNEL MATCHING - GAUSSIANO . ***============================================*** . . psmatch2 D $X, outcome(y2) kernel kerneltype(normal) bwidth(0.06) common Probit regression Number of obs = 4,000 LR chi2(6) = 64.60 Prob > chi2 = 0.0000 Log likelihood = -2739.1378 Pseudo R2 = 0.0117 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0546392 .0107219 -5.10 0.000 -.0756539 -.0336246 orden_n | .2289233 .0618875 3.70 0.000 .1076261 .3502205 ocupado_jefe | .205384 .052298 3.93 0.000 .1028817 .3078863 educa_jefe | -.0150867 .0054408 -2.77 0.006 -.0257504 -.0044229 ingresos_hogar_jefe | .0007748 .0002393 3.24 0.001 .0003058 .0012437 hombre | .0412945 .0398411 1.04 0.300 -.0367926 .1193817 _cons | -.1528546 .1068195 -1.43 0.152 -.3622169 .0565077 ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.642832576 -.961775999 .318943423 .034253057 9.31 ----------------------------+----------------------------------------------------------- Note: S.E. does not take into account that the propensity score is estimated. psmatch2: | psmatch2: Common Treatment | support assignment | Off suppo On suppor | Total -----------+----------------------+---------- Untreated | 0 2,048 | 2,048 Treated | 5 1,947 | 1,952 -----------+----------------------+---------- Total | 5 3,995 | 4,000 . psgraph . pstest $X, treated(D) both graph ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.9122 4.9128 -0.0 99.8 | -0.01 0.992 | 1.15* | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1238 1.0848 11.9 -19.4 | 3.77 0.000 | 1.61* | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .8377 .83806 -0.1 99.4 | -0.03 0.976 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.5485 6.6583 -2.8 -61.6 | -0.88 0.378 | 0.96 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 74.673 68.592 6.9 13.8 | 2.40 0.017 | 1.19* | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51926 .51002 1.8 47.3 | 0.58 0.564 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.91; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.004 24.13 0.000 3.9 2.3 15.7 1.59 75 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . ***============================================*** . * 9. RADIO MATCHING CON CALIPER . ***============================================*** . . psmatch2 D $X, outcome(y2) radius caliper(0.001) common ai(1) Probit regression Number of obs = 4,000 LR chi2(6) = 64.60 Prob > chi2 = 0.0000 Log likelihood = -2739.1378 Pseudo R2 = 0.0117 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0546392 .0107219 -5.10 0.000 -.0756539 -.0336246 orden_n | .2289233 .0618875 3.70 0.000 .1076261 .3502205 ocupado_jefe | .205384 .052298 3.93 0.000 .1028817 .3078863 educa_jefe | -.0150867 .0054408 -2.77 0.006 -.0257504 -.0044229 ingresos_hogar_jefe | .0007748 .0002393 3.24 0.001 .0003058 .0012437 hombre | .0412945 .0398411 1.04 0.300 -.0367926 .1193817 _cons | -.1528546 .1068195 -1.43 0.152 -.3622169 .0565077 ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.638607733 -.962626295 .324018563 .036141566 8.97 ----------------------------+----------------------------------------------------------- Note: Sample S.E. psmatch2: | psmatch2: Common Treatment | support assignment | Off suppo On suppor | Total -----------+----------------------+---------- Untreated | 0 2,048 | 2,048 Treated | 58 1,894 | 1,952 -----------+----------------------+---------- Total | 58 3,942 | 4,000 . psgraph . pstest $X, treated(D) both graph ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.8955 4.9247 -1.4 89.0 | -0.47 0.635 | 1.06 | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1072 1.0991 2.5 75.3 | 0.79 0.430 | 1.14* | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .83844 .84324 -1.2 91.6 | -0.40 0.686 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.5924 6.5482 1.1 34.9 | 0.35 0.726 | 0.95 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 70.187 72.337 -2.4 69.5 | -0.85 0.393 | 0.58* | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51848 .52144 -0.6 83.1 | -0.18 0.855 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.91; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.000 1.81 0.937 1.6 1.3 4.4 0.82 50 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . ***============================================*** . * 10. ALTERNATIVA: teffects psmatch (Stata nativo 13+) . ***============================================*** . . * ATT con NN(1) . teffects psmatch (y2) (D $X, probit), atet Treatment-effects estimation Number of obs = 4,000 Estimator : propensity-score matching Matches: requested = 1 Outcome model : matching min = 1 Treatment model: probit max = 7 ------------------------------------------------------------------------------ | AI robust y2 | Coefficient std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- ATET | D | (1 vs 0) | .2831433 .0519175 5.45 0.000 .1813868 .3848998 ------------------------------------------------------------------------------ . estimates store att_nn1 . . * ATE con NN(1) . teffects psmatch (y2) (D $X, probit), ate nn(1) Treatment-effects estimation Number of obs = 4,000 Estimator : propensity-score matching Matches: requested = 1 Outcome model : matching min = 1 Treatment model: probit max = 7 ------------------------------------------------------------------------------ | AI robust y2 | Coefficient std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- ATE | D | (1 vs 0) | .3094893 .0419913 7.37 0.000 .2271879 .3917908 ------------------------------------------------------------------------------ . estimates store ate_nn1 . . * Comparación . estimates table att_nn1 ate_nn1, b se ---------------------------------------- Variable | att_nn1 ate_nn1 -------------+-------------------------- ATET | D | (1 vs 0) | .28314331 | .05191753 -------------+-------------------------- ATE | D | (1 vs 0) | .30948934 | .0419913 ---------------------------------------- Legend: b/se . . ***============================================*** . * 11. SELECCIÓN DE VARIABLES CON LASSO . ***============================================*** . . * Regla de la clase: los confusores obligatorios se escogen con teoría . * y LASSO no puede sacarlos. LASSO solo decide qué términos adicionales . * (cuadrados e interacciones) entran al propensity score. . * psmatch2 no acepta notación de factores, así que creamos los términos. . . gen double personas2 = personas^2 . gen double educa2 = educa_jefe^2 . gen double ingresos2 = ingresos_hogar_jefe^2 . gen double ocup_hom = ocupado_jefe*hombre . gen double educa_ingr = educa_jefe*ingresos_hogar_jefe . . global Xflex "personas2 educa2 ingresos2 ocup_hom educa_ingr" . . * (a) Lo que NO hacemos: dejar que LASSO escoja todo, incluidos . * los confusores. Sirve para ver qué sacaría si lo dejáramos. . lasso probit D $X $Xflex, selection(cv) rseed(1298) 10-fold cross-validation with 100 lambdas ... Grid value 1: lambda = .0576854 no. of nonzero coef. = 0 Folds: 1...5....10 CVF = 1.386729 Grid value 2: lambda = .0525608 no. of nonzero coef. = 1 Folds: 1...5....10 CVF = 1.38639 Grid value 3: lambda = .0478914 no. of nonzero coef. = 2 Folds: 1...5....10 CVF = 1.385598 Grid value 4: lambda = .0436369 no. of nonzero coef. = 2 Folds: 1...5....10 CVF = 1.38488 Grid value 5: lambda = .0397603 no. of nonzero coef. = 3 Folds: 1...5....10 CVF = 1.384104 Grid value 6: lambda = .0362281 no. of nonzero coef. = 3 Folds: 1...5....10 CVF = 1.383107 Grid value 7: lambda = .0330097 no. of nonzero coef. = 3 Folds: 1...5....10 CVF = 1.382127 Grid value 8: lambda = .0300772 no. of nonzero coef. = 4 Folds: 1...5....10 CVF = 1.381206 Grid value 9: lambda = .0274052 no. of nonzero coef. = 4 Folds: 1...5....10 CVF = 1.380322 Grid value 10: lambda = .0249706 no. of nonzero coef. = 4 Folds: 1...5....10 CVF = 1.379568 Grid value 11: lambda = .0227523 no. of nonzero coef. = 5 Folds: 1...5....10 CVF = 1.378884 Grid value 12: lambda = .0207311 no. of nonzero coef. = 5 Folds: 1...5....10 CVF = 1.378352 Grid value 13: lambda = .0188894 no. of nonzero coef. = 5 Folds: 1...5....10 CVF = 1.377873 Grid value 14: lambda = .0172113 no. of nonzero coef. = 5 Folds: 1...5....10 CVF = 1.377483 Grid value 15: lambda = .0156823 no. of nonzero coef. = 5 Folds: 1...5....10 CVF = 1.377008 Grid value 16: lambda = .0142891 no. of nonzero coef. = 6 Folds: 1...5....10 CVF = 1.376622 Grid value 17: lambda = .0130197 no. of nonzero coef. = 6 Folds: 1...5....10 CVF = 1.37631 Grid value 18: lambda = .0118631 no. of nonzero coef. = 6 Folds: 1...5....10 CVF = 1.376051 Grid value 19: lambda = .0108092 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.375841 Grid value 20: lambda = .0098489 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.375663 Grid value 21: lambda = .008974 no. of nonzero coef. = 6 Folds: 1...5....10 CVF = 1.375547 Grid value 22: lambda = .0081768 no. of nonzero coef. = 6 Folds: 1...5....10 CVF = 1.375457 Grid value 23: lambda = .0074504 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.375325 Grid value 24: lambda = .0067885 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.375158 Grid value 25: lambda = .0061854 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.37491 Grid value 26: lambda = .0056359 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374667 Grid value 27: lambda = .0051352 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374464 Grid value 28: lambda = .004679 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374298 Grid value 29: lambda = .0042634 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374153 Grid value 30: lambda = .0038846 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374032 Grid value 31: lambda = .0035395 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.373933 Grid value 32: lambda = .0032251 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.373852 Grid value 33: lambda = .0029386 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.373796 Grid value 34: lambda = .0026775 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.37376 Grid value 35: lambda = .0024397 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.373808 Grid value 36: lambda = .0022229 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.373878 Grid value 37: lambda = .0020254 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.373958 Grid value 38: lambda = .0018455 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374038 Grid value 39: lambda = .0016816 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374115 Grid value 40: lambda = .0015322 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374182 Grid value 41: lambda = .0013961 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374235 Grid value 42: lambda = .001272 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374291 Grid value 43: lambda = .001159 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374351 Grid value 44: lambda = .0010561 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374414 Grid value 45: lambda = .0009623 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374478 Grid value 46: lambda = .0008768 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374542 Grid value 47: lambda = .0007989 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374608 Grid value 48: lambda = .0007279 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374677 Grid value 49: lambda = .0006632 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374742 Grid value 50: lambda = .0006043 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374803 Grid value 51: lambda = .0005506 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.37486 Grid value 52: lambda = .0005017 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374905 Grid value 53: lambda = .0004571 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374939 Grid value 54: lambda = .0004165 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374969 Grid value 55: lambda = .0003795 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374997 Grid value 56: lambda = .0003458 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375023 Grid value 57: lambda = .0003151 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375047 Grid value 58: lambda = .0002871 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.37507 Grid value 59: lambda = .0002616 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375091 Grid value 60: lambda = .0002384 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.37511 Grid value 61: lambda = .0002172 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375127 Grid value 62: lambda = .0001979 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375143 Grid value 63: lambda = .0001803 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375157 Grid value 64: lambda = .0001643 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375171 ... cross-validation complete ... minimum found Lasso probit model No. of obs = 4,000 No. of covariates = 11 Selection: Cross-validation No. of CV folds = 10 -------------------------------------------------------------------------- | No. of Out-of- | nonzero sample CV mean ID | Description lambda coef. dev. ratio deviance ---------+---------------------------------------------------------------- 1 | first lambda .0576854 0 -0.0007 1.386729 33 | lambda before .0029386 7 0.0086 1.373796 * 34 | selected lambda .0026775 7 0.0086 1.37376 35 | lambda after .0024397 7 0.0086 1.373808 64 | last lambda .0001643 11 0.0076 1.375171 -------------------------------------------------------------------------- * lambda selected by cross-validation. . lassocoef ------------------------------- | active --------------------+---------- personas | x orden_n | x ocupado_jefe | x ingresos_hogar_jefe | x hombre | x educa2 | x ingresos2 | x _cons | x ------------------------------- Legend: b - base level e - empty cell o - omitted x - estimated . . * (b) Lo que sí hacemos: los paréntesis obligan a mantener $X . * y LASSO solo elige entre los términos de $Xflex. . lasso probit D ($X) $Xflex, selection(cv) rseed(1298) 10-fold cross-validation with 100 lambdas ... Grid value 1: lambda = .007085 no. of nonzero coef. = 6 Folds: 1...5....10 CVF = 1.375055 Grid value 2: lambda = .0064556 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.37501 Grid value 3: lambda = .0058821 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374914 Grid value 4: lambda = .0053595 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374745 Grid value 5: lambda = .0048834 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374582 Grid value 6: lambda = .0044496 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374447 Grid value 7: lambda = .0040543 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374335 Grid value 8: lambda = .0036941 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374242 Grid value 9: lambda = .0033659 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374165 Grid value 10: lambda = .0030669 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374102 Grid value 11: lambda = .0027945 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.37405 Grid value 12: lambda = .0025462 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.374051 Grid value 13: lambda = .00232 no. of nonzero coef. = 7 Folds: 1...5....10 CVF = 1.37411 Grid value 14: lambda = .0021139 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374186 Grid value 15: lambda = .0019261 no. of nonzero coef. = 8 Folds: 1...5....10 CVF = 1.374258 Grid value 16: lambda = .001755 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374318 Grid value 17: lambda = .0015991 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374374 Grid value 18: lambda = .001457 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374429 Grid value 19: lambda = .0013276 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374452 Grid value 20: lambda = .0012097 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.374479 Grid value 21: lambda = .0011022 no. of nonzero coef. = 9 Folds: 1...5....10 CVF = 1.37451 Grid value 22: lambda = .0010043 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374544 Grid value 23: lambda = .0009151 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374578 Grid value 24: lambda = .0008338 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374614 Grid value 25: lambda = .0007597 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374658 Grid value 26: lambda = .0006922 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374707 Grid value 27: lambda = .0006307 no. of nonzero coef. = 10 Folds: 1...5....10 CVF = 1.374753 Grid value 28: lambda = .0005747 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374798 Grid value 29: lambda = .0005236 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374847 Grid value 30: lambda = .0004771 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374892 Grid value 31: lambda = .0004347 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374921 Grid value 32: lambda = .0003961 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374946 Grid value 33: lambda = .0003609 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.374968 Grid value 34: lambda = .0003289 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.37499 Grid value 35: lambda = .0002996 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375012 Grid value 36: lambda = .000273 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375034 Grid value 37: lambda = .0002488 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375055 Grid value 38: lambda = .0002267 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375076 Grid value 39: lambda = .0002065 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375095 Grid value 40: lambda = .0001882 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375112 Grid value 41: lambda = .0001715 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375128 Grid value 42: lambda = .0001562 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375143 Grid value 43: lambda = .0001424 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375157 Grid value 44: lambda = .0001297 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375169 Grid value 45: lambda = .0001182 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375181 Grid value 46: lambda = .0001077 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375191 Grid value 47: lambda = .0000981 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.3752 Grid value 48: lambda = .0000894 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375208 Grid value 49: lambda = .0000815 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375215 Grid value 50: lambda = .0000742 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375222 Grid value 51: lambda = .0000676 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375228 Grid value 52: lambda = .0000616 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375234 Grid value 53: lambda = .0000561 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375239 Grid value 54: lambda = .0000512 no. of nonzero coef. = 11 Folds: 1...5....10 CVF = 1.375244 ... change in deviance stopping tolerance reached ... last lambda selected Lasso probit model No. of obs = 4,000 No. of covariates = 11 Selection: Cross-validation No. of CV folds = 10 -------------------------------------------------------------------------- | No. of Out-of- | nonzero sample CV mean ID | Description lambda coef. dev. ratio deviance ---------+---------------------------------------------------------------- 1 | first lambda .007085 6 0.0077 1.375055 10 | lambda before .0030669 7 0.0084 1.374102 * 11 | selected lambda .0027945 7 0.0084 1.37405 12 | lambda after .0025462 7 0.0084 1.374051 54 | last lambda .0000512 11 0.0076 1.375244 -------------------------------------------------------------------------- * lambda selected by cross-validation. . lassocoef ------------------------------- | active --------------------+---------- personas | x orden_n | x ocupado_jefe | x educa_jefe | x ingresos_hogar_jefe | x hombre | x ingresos2 | x _cons | x ------------------------------- Legend: b - base level e - empty cell o - omitted x - estimated . global Xsel "`e(allvars_sel)'" . di "Variables en el propensity score: $Xsel" Variables en el propensity score: personas orden_n ocupado_jefe educa_jefe ingresos_hogar_jefe hombr > e ingresos2 . . * Matching con el propensity score que eligió LASSO . psmatch2 D $Xsel, outcome(y2) n(1) common ai(1) Probit regression Number of obs = 4,000 LR chi2(7) = 71.19 Prob > chi2 = 0.0000 Log likelihood = -2735.8436 Pseudo R2 = 0.0128 ------------------------------------------------------------------------------------- D | Coefficient Std. err. z P>|z| [95% conf. interval] --------------------+---------------------------------------------------------------- personas | -.0588338 .0108556 -5.42 0.000 -.0801104 -.0375572 orden_n | .2307735 .0619295 3.73 0.000 .1093938 .3521531 ocupado_jefe | .1872092 .052802 3.55 0.000 .0837191 .2906992 educa_jefe | -.0167769 .0054833 -3.06 0.002 -.0275239 -.0060298 ingresos_hogar_jefe | .001855 .0004861 3.82 0.000 .0009023 .0028077 hombre | .0398443 .0398626 1.00 0.318 -.0382849 .1179735 ingresos2 | -1.87e-06 7.40e-07 -2.53 0.011 -3.32e-06 -4.22e-07 _cons | -.1617437 .1069283 -1.51 0.130 -.3713194 .0478319 ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------- Variable Sample | Treated Controls Difference S.E. T-stat ----------------------------+----------------------------------------------------------- y2 Unmatched |-.643956823 -.976453845 .332497022 .03380015 9.84 ATT |-.641819643 -.923528506 .281708863 .047497046 5.93 ----------------------------+----------------------------------------------------------- Note: Sample S.E. psmatch2: | psmatch2: Common Treatment | support assignment | Off suppo On suppor | Total -----------+----------------------+---------- Untreated | 0 2,048 | 2,048 Treated | 6 1,946 | 1,952 -----------+----------------------+---------- Total | 6 3,994 | 4,000 . pstest $X, treated(D) both ---------------------------------------------------------------------------------------- Unmatched | Mean %reduct | t-test | V(T)/ Variable Matched | Treated Control %bias |bias| | t p>|t| | V(C) --------------------------+----------------------------------+---------------+---------- personas U | 4.9098 5.1743 -13.0 | -4.12 0.000 | 0.85* M | 4.9096 4.9085 0.1 99.6 | 0.02 0.987 | 1.08 | | | orden_n U | 1.1235 1.0908 10.0 | 3.16 0.002 | 1.48* M | 1.1202 1.1192 0.3 96.9 | 0.09 0.925 | 1.15* | | | ocupado_jefe U | .83811 .78125 14.5 | 4.58 0.000 | . M | .83762 .83607 0.4 97.3 | 0.13 0.896 | . | | | educa_jefe U | 6.541 6.6089 -1.7 | -0.55 0.582 | 0.94 M | 6.5519 6.7569 -5.3 -202.0 | -1.63 0.102 | 0.92 | | | ingresos_hogar_jefe U | 76.558 69.502 8.0 | 2.54 0.011 | 1.13* M | 75.719 79.006 -3.7 53.4 | -1.14 0.256 | 0.93 | | | hombre U | .51998 .50244 3.5 | 1.11 0.267 | . M | .51953 .51542 0.8 76.6 | 0.26 0.798 | . | | | ---------------------------------------------------------------------------------------- * if variance ratio outside [0.92; 1.09] for U and [0.91; 1.09] for M ----------------------------------------------------------------------------------- Sample | Ps R2 LR chi2 p>chi2 MeanBias MedBias B R %Var -----------+----------------------------------------------------------------------- Unmatched | 0.012 64.60 0.000 8.5 9.0 25.5* 0.96 75 Matched | 0.001 4.07 0.667 1.8 0.6 6.5 0.92 25 ----------------------------------------------------------------------------------- * if B>25%, R outside [0.5; 2] . . * (c) Benchmark doblemente robusto: telasso usa LASSO en el modelo . * del resultado y en el del tratamiento. ainclude() deja fijo $X. . telasso (y2 $X $Xflex, ainclude($X)) (D $X $Xflex, ainclude($X)), atet rseed(1298) Estimating lasso for outcome y2 if D = 0 using plugin method ... note: personas orden_n ocupado_jefe educa_jefe ingresos_hogar_jefe hombre specified as alwaysvar and othervar; assumed to be alwaysvar and always selected. Estimating lasso for outcome y2 if D = 1 using plugin method ... note: personas orden_n ocupado_jefe educa_jefe ingresos_hogar_jefe hombre specified as alwaysvar and othervar; assumed to be alwaysvar and always selected. Estimating lasso for treatment D using plugin method ... note: personas orden_n ocupado_jefe educa_jefe ingresos_hogar_jefe hombre specified as alwaysvar and othervar; assumed to be alwaysvar and always selected. Estimating ATET ... Treatment-effects lasso estimation Number of observations = 4,000 Outcome model: linear Number of controls = 11 Treatment model: logit Number of selected controls = 6 ------------------------------------------------------------------------------ | Robust y2 | Coefficient std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- ATET | D | (1 vs 0) | .3319309 .033892 9.79 0.000 .2655038 .3983581 -------------+---------------------------------------------------------------- POmean | D | 0 | -.9758877 .0245233 -39.79 0.000 -1.023952 -.927823 ------------------------------------------------------------------------------ . lassocoef (., for(D)) (., for(y2) tlevel(0)) (., for(y2) tlevel(1)) ----------------------------------------------------- | D y2(0) y2(1) --------------------+-------------------------------- personas | x x x orden_n | x x x ocupado_jefe | x x x educa_jefe | x x x ingresos_hogar_jefe | x x x hombre | x x x _cons | x x x ----------------------------------------------------- Legend: b - base level e - empty cell o - omitted x - estimated . . log close name: log: dofile/16_PSM_IPW_Sinteticos/psm_demo.log > hpad/run2/psm_demo.log log type: text closed on: 16 Oct 2026, 14:56:01 ----------------------------------------------------------------------------------------------------