Professional Documents
Culture Documents
User: ROBLES
1 . do "C:\Users\57350\AppData\Local\Temp\STD6074_000000.tmp"
9 .
10 .
11 . gen genero=rnormal(10000,20000)
12 .
13 . replace genero=1 if genero <0
(20,170 real changes made)
15 .
16 . gen marital=runiformint(1,7)
17 .
18 . gen w = runiform(800, 50000)
23 .
24 .
25 . gen negro=runiformint(0,1)
26 . gen south=runiformint(0,1)
27 . gen urb=runiformint(0,1)
29 .
30 . *w eda educ exp exp2
31 .
32 .
33 .
34 .
35 . *PUNTO 1*
36 . *Con submuestra aleatoria de 30700, estimar probit y logit*
37 . bsample 30700
38 .
ROBLESbono2502 Friday February 25 19:19:50 2022 Page 2
41 . drop if genero==1
(9,386 observations deleted)
42 .
43 . *Se dejan datos de mayores de 18 años
44 . drop if eda<18
(5,634 observations deleted)
45 .
46 . *se estipula el estado marital de mujeres casadas con mas de 18 añ
> os
47 . replace marital=0 if marital ==1
(2,267 real changes made)
54 .
55 .
56 . *OLS*
57 . regress marital eda
>
marital Coef. Std. Err. t P>|t| [95% Conf.
> Interval]
>
eda -.000415 .0004311 -0.96 0.336 -.0012601
> .0004301
_cons .1501184 .012813 11.72 0.000 .1250034
> .1752335
>
ROBLESbono2502 Friday February 25 19:19:50 2022 Page 3
58 .
59 . *probit con margins
60 .
61 . probit marital eda
>
marital Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda -.0018826 .0019556 -0.96 0.336 -.0057156
> .0019504
_cons -1.034452 .0579972 -17.84 0.000 -1.148124
> -.9207794
>
>
Delta-method
dy/dx Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda -.0004151 .0004311 -0.96 0.336 -.0012601
> .00043
>
63 .
64 .
65 . *logit con margins
66 .
67 . logit marital eda
>
marital Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda -.0034871 .0036229 -0.96 0.336 -.0105879
> .0036137
_cons -1.730348 .1073058 -16.13 0.000 -1.940664
> -1.520033
>
>
Delta-method
dy/dx Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda -.0004149 .000431 -0.96 0.336 -.0012598
> .0004299
>
69 .
70 .
71 .
72 . *Sugerencias a mi modelo
73 . probit marital eda exp
>
marital Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0007474 .0035123 0.21 0.831 -.0061365
> .0076314
exp -.002616 .0029019 -0.90 0.367 -.0083036
> .0030717
_cons -1.052036 .0612014 -17.19 0.000 -1.171989
> -.9320836
>
ROBLESbono2502 Friday February 25 19:19:51 2022 Page 5
>
marital Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0007474 .0035123 0.21 0.831 -.0061365
> .0076314
exp -.002616 .0029019 -0.90 0.367 -.0083036
> .0030717
educ 0 (omitted)
_cons -1.052036 .0612014 -17.19 0.000 -1.171989
> -.9320836
>
>
marital Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0007653 .0035125 0.22 0.828 -.006119
> .0076497
exp -.0026316 .0029021 -0.91 0.365 -.0083196
> .0030564
educ 0 (omitted)
south .0242865 .025003 0.97 0.331 -.0247184
> .0732915
_cons -1.064647 .0625775 -17.01 0.000 -1.187297
> -.9419972
>
ROBLESbono2502 Friday February 25 19:19:51 2022 Page 6
76 .
77 .
78 .
79 . *Al eliminar la variable de edad y dejar solo la experiencia nos p
> uede demostrar
80 . *que la variable no tiene una significacia relevante para indicar
> el modelo de
81 . *probabilidad para las mujeres.
82 .
83 . *Para probit con educ y south los niveles de significacia en este
> caso
84 . *aumentan la variable de edad.
85 .
86 .
87 . *PUNTO 2*
88 . *Repetir el punto 1 pero con un hombre mayor de edad de estar casa
> do con esposo
89 . *ausente no separado.
90 .
91 . clear
94 .
95 .
96 . gen genero=rnormal(10000,20000)
97 .
98 . replace genero=1 if genero <0
(20,170 real changes made)
100 .
101 . gen marital=runiformint(1,7)
102 .
103 . gen w = runiform(800, 50000)
108 .
109 .
110 . gen negro=runiformint(0,1)
114 .
115 .
116 . bsample 30700
117 .
118 .
119 . gen maritalnuev=runiformint(1,7)
120 .
121 .
122 .
123 . replace maritalnuev =0 if maritalnuev==2
(4,376 real changes made)
130 .
131 .
132 . gen nuevogene = rnormal(10000,20000)
135 .
136 . sort nuevogene eda
138 .
139 .
140 . sort genero eda // *organizar las variables de edad y genero
142 .
143 . *Se dejan datos de mayores de 18 años
144 . drop if eda<18
(1,775 observations deleted)
ROBLESbono2502 Friday February 25 19:19:51 2022 Page 8
145 .
146 .
147 . * OLS
148 . regress maritalnuev eda
>
maritalnuev Coef. Std. Err. t P>|t| [95% Conf.
> Interval]
>
eda .0002668 .0007515 0.36 0.723 -.0012065
> .0017402
_cons .1206947 .0223672 5.40 0.000 .0768447
> .1645447
>
149 .
150 . *Probit marginsplot
151 .
152 . probit maritalnuev eda
>
maritalnuev Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0012748 .0035858 0.36 0.722 -.0057533
> .008303
_cons -1.170837 .1068772 -10.95 0.000 -1.380313
> -.9613619
>
ROBLESbono2502 Friday February 25 19:19:51 2022 Page 9
>
Delta-method
dy/dx Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0002674 .0007522 0.36 0.722 -.0012069
> .0017418
>
154 .
155 .
156 . *logit margins
157 .
158 . logit maritalnuev eda
>
maritalnuev Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0023839 .0067127 0.36 0.722 -.0107728
> .0155406
_cons -1.984103 .200261 -9.91 0.000 -2.376607
> -1.591598
>
>
Delta-method
dy/dx Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0002669 .0007514 0.36 0.722 -.0012059
> .0017396
>
160 .
161 .
162 . *sugerencias
163 . probit maritalnuev eda exp
>
maritalnuev Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0051833 .0065005 0.80 0.425 -.0075575
> .017924
exp -.0038945 .0054028 -0.72 0.471 -.0144839
> .0066948
_cons -1.196906 .1128668 -10.60 0.000 -1.418121
> -.9756908
>
>
maritalnuev Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
exp .0012887 .003586 0.36 0.719 -.0057396
> .0083171
educ .0051833 .0065005 0.80 0.425 -.0075575
> .017924
_cons -1.228005 .1453 -8.45 0.000 -1.512788
> -.9432227
ROBLESbono2502 Friday February 25 19:19:52 2022 Page 11
>
>
maritalnuev Coef. Std. Err. z P>|z| [95% Conf.
> Interval]
>
eda .0051872 .0065005 0.80 0.425 -.0075535
> .017928
exp -.0039008 .0054031 -0.72 0.470 -.0144906
> .006689
educ 0 (omitted)
south .0104208 .0459749 0.23 0.821 -.0796884
> .1005299
_cons -1.202239 .1153013 -10.43 0.000 -1.428226
> -.9762529
>
166 .
167 .
168 .
169 .
170 . **PUNTO 3**
171 .
172 . *Explicar las diferenciasencontradas y proponer un modelo probit b
> ivariado
173 .
174 . biprobit (marital = w eda educ exp exp2) (maritalnuev = exp w sout
> h urb eda)
note: exp omitted because of collinearity
marital is never zero
r(2000);
end of do-file
r(2000);
175 .