You are on page 1of 9

UNIVERSIDAD NACIONAL DEL ALTIPLANO

ESCUELA DE POST GRADO


Maestría en Economía
Profesor: Dr. Alfredo Pelayo Calatayud Mendoza

Taller práctico N 1

Propensity Score Matching (PSM)

En México, el Programa Oportunidades realiza transferencias monetarias para lograr la acumulación de


capital humano a través de servicios de salud, educación y nutrición. Más específicamente, el objetivo del
presente trabajo es, evaluar el impacto del programa oportunidades en el gasto en alimentos.

Hipótesis: Aquellos hogares del sector rural que son parte del programa oportunidades
tienen un mayor gasto en alimentos en peso Mexicanos.

Se pide:

Evaluar el impacto del programa Oportunidades con el método de propensity matching score emparejando con el
vecino más cercano (Nearest Neighbor Matching).

Cuantificación de las variables e hipótesis

Signo
Variable Notación Cuantificación Hipótesis
esperado
Representa la variable dependiente de interés
Gasto total en
Y En pesos Mexicanos sobre el cual se evaluará el programa
alimentos
oportunidades
Probabilidad de
Variable dependiente para caracterizar la
participar en el 1=Si participa
T probabilidad de participar en el programa
Programa 0=No participa
oportunidades
Oportunidades
1=si cuenta Si cuenta con agua potable es menor la
Agua potable X1 (-)
0=no cuenta probabilidad de participar en el programa.
1=si cuenta Si cuenta con energía eléctrica es menor la
Energía eléctrica X2 (-)
0=no cuenta probabilidad de acceder al programa.
Si cuenta con servicios de red de desagüe es
Red pública de 1=si cuenta
X3 menor la probabilidad de participar en el (-)
desagüe 0=no cuenta
programa.
1=si el techo es de
Hogares con vivienda de techo de concreto o
Tipo de techo de concreto
X4 sofisticado tienen menor probabilidad de (-)
la vivienda 0=en otro caso (paja,
participar en el programa
cartón)
1=cocina con gas natural o
Tipo de
licuado Los hogares que utilizan gas natural tienen
combustible X5 (-)
0=en otro caso (leña y menor probabilidad de acceder al programa.
para cocinar
carbón)
Aquellos hogares que tiene como jefe de
1=si es varón hogar mujer tienen mayor probabilidad de
Jefe de hogar X6 (-)
0=si es mujer acceder al programa.

Total de
Número total de miembros Hogares con un mayor número de miembros
integrante en el
X7 menores a 8 años en el tienen mayor probabilidad de participar en el (+)
hogar menores a
hogar programa
8 años
Nota: 1 Nuevo Sol=5 pesos Mexicanos (aproximadamente)

BASE DE DATOS DE CORTE TRANSVERSAL (n=40)


obs y T x1 x2 x3 x4 x5 x6 x7
1 2000 1 0 0 0 1 0 0 4
2 1800 0 1 1 1 1 1 1 3
3 2300 1 0 0 0 0 1 0 7
4 1900 1 0 0 0 0 0 0 5
5 1800 0 1 1 1 1 1 1 4
6 1600 0 0 1 0 0 0 0 3
7 1800 1 1 1 0 1 1 1 4
8 2200 0 1 1 1 0 1 1 3
9 1900 1 0 0 0 0 0 0 4
10 2000 0 1 1 1 1 1 1 5
11 2300 1 0 0 0 0 0 0 6
12 1800 0 1 1 1 1 1 1 3
13 2200 1 0 0 0 0 0 0 4
14 1800 0 1 1 1 1 1 1 3
15 1800 0 0 1 0 0 1 1 4
16 2000 1 0 0 0 0 0 1 7
17 1600 0 1 1 1 0 1 0 4
18 1900 0 0 0 0 1 1 1 2
19 2200 1 0 0 0 0 0 0 4
20 1800 0 1 1 0 1 1 1 3
21 1800 1 0 0 0 0 0 0 8
22 1900 0 1 1 1 1 1 1 2
23 2300 1 0 0 0 0 1 1 4
24 2000 0 0 0 0 0 0 0 3
25 1800 0 1 1 1 1 1 1 2
26 2200 1 0 0 0 0 0 0 4
27 1700 1 0 1 0 0 1 1 3
28 2100 0 1 0 1 1 0 0 2
29 1800 1 0 0 0 0 1 1 5
30 2100 0 1 1 1 1 1 1 4
31 1900 0 1 1 1 0 1 1 3
32 1800 0 1 1 1 1 1 1 2
33 1900 1 0 0 0 0 0 0 4
34 1700 0 1 1 1 1 1 1 3
35 1800 1 0 0 0 0 0 1 4
36 2200 0 0 1 0 0 1 1 2
37 1800 0 0 0 0 1 0 0 3
38 2300 1 0 0 0 0 1 1 4
39 2200 1 0 1 1 0 1 0 5
40 1800 0 1 1 1 1 1 1 2

Algunas evidencias:

sum Y, detail
ttest Y, by(T)
regre Y T

DO – FILE EDITOR

use "E:\Doctorado_21 Nov 2014\Datos propensity score México.dta",


clear

****Impacto del programa oportunidades;

**MODELO 1****
****Ecuación de pscore con todas las variables;
pscore T x1 x2 x3 x4 x5 x6 x7, pscore(myps) blockid(blockf1) comsup
level(0.001)
estimate store Modelo1

****Nearest Neighbor Matching;


attnd Y T, pscore(myps) comsup

drop myps blockf1

***MODELO GANADOR, MEJOR MODELO**

pscore T x1 x2 x3 x7, pscore(myps) blockid(blockf1) comsup


level(0.001)
estimate store Modelo6

estimates table Modelo1 Modelo6, stats(N chi2 aic bic r2_p ll k)


star(.05 .01 .1)

****Nearest Neighbor Matching;


attnd Y T, pscore(myps) comsup

psgraph, treated(T) pscore(myps)

Resultados:
. use "E:\Doctorado_21 Nov 2014\Datos propensity score México.dta", clear

.
.
. ****Impacto del programa oportunidades;
.
. **MODELO 1****
. ****Ecuación de pscore con todas las variables;
. pscore T x1 x2 x3 x4 x5 x6 x7, pscore(myps) blockid(blockf1) comsup level(0.001)

****************************************************
Algorithm to estimate the propensity score
****************************************************

The treatment is T

T | Freq. Percent Cum.


------------+-----------------------------------
0 | 22 55.00 55.00
1 | 18 45.00 100.00
------------+-----------------------------------
Total | 40 100.00

Estimation of the propensity score

Iteration 0: log likelihood = -27.525553


Iteration 1: log likelihood = -12.221031
Iteration 2: log likelihood = -8.8008116
Iteration 3: log likelihood = -6.950544
Iteration 4: log likelihood = -6.2195766
Iteration 5: log likelihood = -6.077543
Iteration 6: log likelihood = -6.0724064
Iteration 7: log likelihood = -6.0723948

Probit regression Number of obs = 40


LR chi2(7) = 42.91
Prob > chi2 = 0.0000
Log likelihood = -6.0723948 Pseudo R2 = 0.7794

------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 | -.1565133 1.572941 -0.10 0.921 -3.239421 2.926395
x2 | -1.668406 2.077282 -0.80 0.422 -5.739804 2.402993
x3 | -3.492092 1.945121 -1.80 0.073 -7.304459 .3202739
x4 | -.6640878 1.188839 -0.56 0.576 -2.994169 1.665994
x5 | 1.974605 2.393355 0.83 0.409 -2.716284 6.665493
x6 | -.8201792 1.402065 -0.58 0.559 -3.568177 1.927818
x7 | 2.073788 .7889459 2.63 0.009 .5274829 3.620094
_cons | -6.5187 2.881379 -2.26 0.024 -12.1661 -.8713001
------------------------------------------------------------------------------
Note: 5 failures and 3 successes completely determined.

Note: the common support option has been selected


The region of common support is [.20859256, 1]
Description of the estimated propensity score
in region of common support

Estimated propensity score


-------------------------------------------------------------
Percentiles Smallest
1% .2085926 .2085926
5% .2958491 .3831057
10% .5269075 .6707094 Obs 20
25% .8487715 .7467666 Sum of Wgt. 20

50% .962171 Mean .8705372


Largest Std. Dev. .2186666
75% .9999704 1
90% 1 1 Variance .0478151
95% 1 1 Skewness -2.038674
99% 1 1 Kurtosis 6.12699

******************************************************
Step 1: Identification of the optimal number of blocks
Use option detail if you want more detailed output
******************************************************

The final number of blocks is 6

This number of blocks ensures that the mean propensity score


is not different for treated and controls in each blocks

**********************************************************
Step 2: Test of balancing property of the propensity score
Use option detail if you want more detailed output
**********************************************************

The balancing property is satisfied

This table shows the inferior bound, the number of treated


and the number of controls for each block

Inferior |
of block | T
of pscore | 0 1 | Total
-----------+----------------------+----------
.2 | 1 1 | 2
.6 | 0 2 | 2
.8 | 1 15 | 16
-----------+----------------------+----------
Total | 2 18 | 20

Note: the common support option has been selected

*******************************************
End of the algorithm to estimate the pscore
*******************************************

. estimate store Modelo1

.
.
. ****Nearest Neighbor Matching;
. attnd Y T, pscore(myps) comsup

The program is searching the nearest neighbor of each treated unit.


This operation may take a while.

ATT estimation with Nearest Neighbor Matching method


(random draw version)
Analytical standard errors

---------------------------------------------------------
n. treat. n. contr. ATT Std. Err. t
---------------------------------------------------------

18 2 222.222 143.004 1.554

---------------------------------------------------------
Note: the numbers of treated and controls refer to actual
nearest neighbour matches

.
.
. drop myps blockf1

.
. ***MODELO GANADOR, MEJOR MODELO**
.
. pscore T x1 x2 x3 x7, pscore(myps) blockid(blockf1) comsup level(0.001)

****************************************************
Algorithm to estimate the propensity score
****************************************************

The treatment is T

T | Freq. Percent Cum.


------------+-----------------------------------
0 | 22 55.00 55.00
1 | 18 45.00 100.00
------------+-----------------------------------
Total | 40 100.00

Estimation of the propensity score

Iteration 0: log likelihood = -27.525553


Iteration 1: log likelihood = -12.514256
Iteration 2: log likelihood = -9.1606287
Iteration 3: log likelihood = -7.4253407
Iteration 4: log likelihood = -6.7508115
Iteration 5: log likelihood = -6.635379
Iteration 6: log likelihood = -6.6315094
Iteration 7: log likelihood = -6.6315043

Probit regression Number of obs = 40


LR chi2(4) = 41.79
Prob > chi2 = 0.0000
Log likelihood = -6.6315043 Pseudo R2 = 0.7591
------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 | -.9207274 1.121117 -0.82 0.411 -3.118076 1.276621
x2 | -.4129198 .9067125 -0.46 0.649 -2.190044 1.364204
x3 | -2.9198 1.596352 -1.83 0.067 -6.048593 .2089938
x7 | 2.13496 .8162925 2.62 0.009 .5350565 3.734864
_cons | -6.917692 3.011319 -2.30 0.022 -12.81977 -1.015615
------------------------------------------------------------------------------
Note: 5 failures and 3 successes completely determined.

Note: the common support option has been selected


The region of common support is [.17729292, 1]

Description of the estimated propensity score


in region of common support

Estimated propensity score


-------------------------------------------------------------
Percentiles Smallest
1% .1772929 .1772929
5% .1772929 .1772929
10% .3040417 .3040417 Obs 23
25% .6135188 .3040417 Sum of Wgt. 23

50% .9476143 Mean .7811063


Largest Std. Dev. .30123
75% .9999141 1
90% 1 1 Variance .0907395
95% 1 1 Skewness -1.126951
99% 1 1 Kurtosis 2.542708

******************************************************
Step 1: Identification of the optimal number of blocks
Use option detail if you want more detailed output
******************************************************

The final number of blocks is 6

This number of blocks ensures that the mean propensity score


is not different for treated and controls in each blocks

**********************************************************
Step 2: Test of balancing property of the propensity score
Use option detail if you want more detailed output
**********************************************************

The balancing property is satisfied

This table shows the inferior bound, the number of treated


and the number of controls for each block

Inferior |
of block | T
of pscore | 0 1 | Total
-----------+----------------------+----------
.1772929 | 1 1 | 2
.2 | 3 0 | 3
.6 | 0 2 | 2
.8 | 1 15 | 16
-----------+----------------------+----------
Total | 5 18 | 23

Note: the common support option has been selected

*******************************************
End of the algorithm to estimate the pscore
*******************************************

. estimate store Modelo2

.
. estimates table Modelo1 Modelo2, stats(N chi2 aic bic r2_p ll k) star(.05 .01 .1)

----------------------------------------------
Variable | Modelo1 Modelo2
-------------+--------------------------------
x1 | -.15651331 -.92072737
x2 | -1.6684056 -.41291982
x3 | -3.4920924* -2.9197996*
x4 | -.66408785
x5 | 1.9746046
x6 | -.82017921
x7 | 2.0737885*** 2.1349604***
_cons | -6.5186996** -6.9176924**
-------------+--------------------------------
N | 40 40
chi2 | 42.906315 41.788097
aic | 28.14479 23.263009
bic | 41.655825 31.707406
r2_p | .77939063 .75907825
ll | -6.0723948 -6.6315043
k |
----------------------------------------------
legend: * p<.1; ** p<.05; *** p<.01

.
. ****Nearest Neighbor Matching;
. attnd Y T, pscore(myps) comsup

The program is searching the nearest neighbor of each treated unit.


This operation may take a while.

ATT estimation with Nearest Neighbor Matching method


(random draw version)
Analytical standard errors

---------------------------------------------------------
n. treat. n. contr. ATT Std. Err. t
---------------------------------------------------------

18 2 244.444 143.004 1.709

---------------------------------------------------------
Note: the numbers of treated and controls refer to actual
nearest neighbour matches
.
end of do-file

Balanceo del grupo de tratamiento y control

0 .2 .4 .6 .8 1
Propensity Score

Untreated Treated

Conclusiones:

Por lo tanto el impacto del programa oportunidades es positivo, es decir, el gasto


en alimentos de los que recibieron el programa es mayor en 244.22 pesos
Mexicanos con respecto a los que no recibieron a un nivel de significancia de
15%.

You might also like