You are on page 1of 21

NOMBRE DEL DOCENTE

Mgr. RENE PAREDES MAMANI


NOMBRE
ANTONI HINOJOSA FRANCO
CURSO
METODOS CUANTITAVOS APLICADOS
MODELO PROVIT

. use "D:\MAESTRIA\DATOS\REGRESIONES\PRACTICAS\practica.dta", clear


. regress salary sales
Source |
SS
df
MS
Number of obs = 177
-------------+-----------------------------------------F( 1, 175) = 29.58
Model | 8784947.36 1 8784947.36
Prob > F
= 0.0000
Residual | 51981017.4 175 297034.385
R-squared
= 0.1446
-------------+-------------------------------------------Adj R-squared = 0.1397
Total | 60765964.7 176 345261.163
Root MSE
=
545.01
-----------------------------------------------------------------------------salary | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------sales | .0366937 .0067472 5.44 0.000 .0233773 .0500102
_cons | 736.3552 47.3843 15.54 0.000 642.837 829.8735
-----------------------------------------------------------------------------. scatter salary sales

. scatter salary sales


. egen m_salary=mean(salary)
. egen m_sales=mean(sales)
. gen p_sales=_b[_cons]+_b[sales]*sales
. sort sales
. twoway line p_sales sales, saving(g_sales.gph, replace)
(note: file g_sales.gph not found)
(file g_sales.gph saved)

. regress salary sales profits ceoten, noconstant


Source |
SS
df
MS
Number of obs = 177
-------------+-----------------------------------------------F( 3, 174) = 92.78
Model | 119048425 3
39682808.4
Prob > F = 0.0000
Residual | 74418186.8 174 427690.729
R-squared = 0.6153
-------------+-----------------------------------------------Adj R-squared = 0.6087
Total | 193466612
177 1093031.71
Root MSE = 653.98
---------------------------------------------------------------------------------------------------salary | Coef.
Std. Err.
t
P>|t| [95% Conf. Interval]
-------------+------------------------------------------------------------------------------------sales | .04367
.0131256 3.33 0.001 .0177642 .0695759
profits | .3626016 .2026449
1.79 0.075 -.0373568 .76256
ceoten | 50.9095 4.903747 10.38 0.000 41.23101
60.58798
----------------------------------------------------------------------------------------------------. regress salary sales profits ceoten
Source |
SS
df
MS
Number of obs = 177
-------------+-----------------------------------------F( 3, 173) = 13.80
Model | 11733215
3 3911071.67
Prob > F = 0.0000
Residual | 49032749.7 173 283426.299
R-squared = 0.1931
-------------+-------------------------------------------Adj R-squared = 0.1791
Total | 60765964.7
176 345261.163
Root MSE = 532.38
-----------------------------------------------------------------------------------------------salary | Coef.
Std. Err.
t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------------------------sales | .0196671 .0109819 1.79 0.075 -.0020087 .0413428
profits | .3410285 .1649803 2.07 0.040 .015395 .666662
ceoten | 13.29683 5.632999 2.36 0.019 2.178577 24.41508
_cons | 619.8005 65.4907 9.46 0.000 490.5368 749.0642
---------------------------------------------------------------------------------------------------. egen m_salary=mean(salary)

m_salary already defined


r(110);
. egen m_sales=mean(sales)
m_sales already defined
r(110);
. egen m_profits=mean(profits)
. egen m_ceoten=mean(ceoten)
. egen m_cons=mean(_cons)
. gen p_sales=_b[_cons] + _b[sales]*sales + _b[profits]*m_profits + _b[ceoten]*m_ceoten
p_sales already defined
r(110);
. sort sales
. twoway line p_sales sales, saving(g_sales.gph, replace)
(file g_sales.gph saved)

. gen p_profits=_b[_cons] + _b[sales]*m_sales + _b[profits]*profits + _b[ceoten]*m_ceoten


. sort profits
. twoway line p_profits profits, saving(g_profits.gph, replace)
(note: file g_profits.gph not found)
(file g_profits.gph saved)

. gen p_ceoten=_b[_cons] + _b[sales]*m_sales + _b[profits]*m_profits + _b[ceoten]*ceoten


. sort ceoten
. twoway line p_ceoten ceoten, saving(g_ceotem.gph, replace)
(note: file g_ceotem.gph not found)
(file g_ceotem.gph saved)

. gen lsalary=log(salary)
. gen lsales=log(sales)
. gen lprofits=log(profits)
(9 missing values generated)

. gen lceoten=log(ceoten)
(5 missing values generated)
. regress lsalary sales

Source |
SS
df
MS
Number of obs = 177
-------------+---------------------------------------------F( 1, 175) = 35.33
Model | 10.8581306 1
10.8581306
Prob > F
= 0.0000
Residual | 53.7880825 175 .307360471
R-squared
= 0.1680
-------------+---------------------------------------------Adj R-squared = 0.1632
Total | 64.6462131
176 .367308029
Root MSE
= .5544
-----------------------------------------------------------------------------lsalary | Coef.
Std. Err. t
P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------sales | .0000408 6.86e-06 5.94 0.000 .0000272 .0000543
_cons | 6.438865 .0482009 133.58 0.000 6.343736 6.533995
-----------------------------------------------------------------------------. mfx
Marginal effects after regress
y = Fitted values (predict)
= 6.5828476
-----------------------------------------------------------------------------variable | dy/dx
Std. Err. z P>|z|
[ 95% C.I. ]
X
---------+-------------------------------------------------------------------sales | .0000408 .00001 5.94 0.000 .000027 .000054 3529.46
-----------------------------------------------------------------------------. regress salary lsales
Source |
SS
df
MS
Number of obs = 177
-------------+-----------------------------F( 1, 175) = 40.10
Model | 11327355 1 11327355
Prob > F = 0.0000
Residual | 49438609.8 175 282506.342
R-squared = 0.1864
-------------+-----------------------------Adj R-squared = 0.1818
Total | 60765964.7 176 345261.163
Root MSE = 531.51
-----------------------------------------------------------------------------salary | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------lsales | 177.1491 27.9762 6.33 0.000 121.9349 232.3633
_cons | -415.1051 206.2038 -2.01 0.046 -822.0715 -8.138719
-----------------------------------------------------------------------------. stepwise, pr(.2): regress salary sales profits ceoten grad college
begin with full model
p = 0.7798 >= 0.2000 removing grad
p = 0.6108 >= 0.2000 removing college

Source |
SS
df
MS
Number of obs = 177
-------------+-----------------------------F( 3, 173) = 13.80
Model | 11733215 3 3911071.67
Prob > F = 0.0000
Residual | 49032749.7 173 283426.299
R-squared = 0.1931
-------------+-----------------------------Adj R-squared = 0.1791
Total | 60765964.7 176 345261.163
Root MSE = 532.38
-----------------------------------------------------------------------------salary | Coef.
Std. Err.
t
P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------sales | .0196671 .0109819 1.79 0.075 -.0020087 .0413428
profits | .3410285 .1649803 2.07 0.040 .015395 .666662
ceoten | 13.29683 5.632999 2.36 0.019 2.178577 24.41508
_cons | 619.8005 65.4907 9.46 0.000 490.5368 749.0642
-----------------------------------------------------------------------------. regress salary sales profits ceoten grad college
Source |
SS
df
MS
Number of obs = 177
-------------+--------------------------------------------F( 5, 171) = 8.27
Model | 11829650.4 5
2365930.08
Prob > F = 0.0000
Residual | 48936314.3 171 286177.277
R-squared = 0.1947
-------------+---------------------------------------------Adj R-squared = 0.1711
Total | 60765964.7 176 345261.163
Root MSE = 534.96
-----------------------------------------------------------------------------salary | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------sales | .0197139 .0110377 1.79 0.076 -.0020739 .0415017
profits | .340988
.1664067 2.05 0.042 .0125121 .6694639
ceoten | 12.85655 5.712335 2.25 0.026 1.580781 24.13232
grad | -23.16249 82.71258 -0.28 0.780 -186.4317 140.1067
college | -111.8679 248.3771 -0.45 0.653 -602.1479 378.412
_cons | 744.1547
251.862 2.95 0.004 246.9958 1241.314
-----------------------------------------------------------------------------. mfx
Marginal effects after regress
y = Fitted values (predict)
= 865.86441
---------------------------------------------------------------------------------------------------variable | dy/dx
Std. Err. z
P>|z|
[ 95% C.I. ]
X
---------+-----------------------------------------------------------------------------------------sales | .0197139 .01104 1.79 0.074 -.00192 .041347 3529.46
profits | .340988
.16641 2.05 0.040 .014837 .667139 207.831
ceoten | 12.85655 5.71233 2.25 0.024 1.66058 24.0525 7.9548
grad*| -23.16249
82.713 -0.28 0.779 -185.276 138.951 .531073
college*| -111.8679 248.38 -0.45 0.652 -598.678 374.942 .971751
----------------------------------------------------------------------------------------------------(*) dy/dx is for discrete change of dummy variable from 0 to 1

use "D:\MAESTRIA\DATOS\probit\mroz.dta", clear


. reg inlf nwifeinc educ exper expersq age kidslt6 kidsge6
Source

SS

df

Model
Residual

48.8080578
135.919698

7
745

Total

184.727756

752

inlf
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6
_cons

Coef.
-0.0034052
0.0379953
0.0394924
-0.0005963
-0.0160908
-0.2618105
0.0130122
0.5855192

Std. Err.
0.0014485
0.007376
0.0056727
0.0001848
0.0024847
0.0335058
0.013196
0.154178

MS

Number of obs
F( 7, 745)
6.97257969
Prob > F
0.18244255
R-squared
Adj R-squared
0.24564861
Root MSE
t
-2.35
5.15
6.96
-3.23
-6.48
-7.81
0.99
3.8

P>t
0.019
0
0
0.001
0
0
0.324
0

=
=
=
=
=
=

[95% Conf.
-0.0062488
0.023515
0.0283561
-0.0009591
-0.0209686
-0.3275875
-0.0128935
0.2828442

753
38.22
0
0.2642
0.2573
0.42713
Interval]
-0.0005616
0.0524756
0.0506287
-0.0002335
-0.011213
-0.1960335
0.0389179
0.8881943

. mfx
Marginal effects after regress
y = Fitted values (predict)
= .56839309
variable
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6
eststo m1
. esttab m1

dy/dx
-0.0034052
0.0379953
0.0394924
-0.0005963
-0.0160908
-0.2618105
0.0130122

-1
inlf
nwifeinc -0.00341*
(-2.35)
educ
0.0380***
-5.15
exper
0.0395***
-6.96
expersq -0.000596**
(-3.23)
age
-0.0161***
(-6.48)
kidslt6
-0.262***
(-7.81)
kidsge6
0.013
-0.99
_cons
0.586***
-3.8
N
753

Std. Err.
0.00145
0.00738
0.00567
0.00018
0.00248
0.03351
0.0132

z
-2.35
5.15
6.96
-3.23
-6.48
-7.81
0.99

P>z
0.019
0
0
0.001
0
0
0.324

[ 95%
-0.006244
0.023539
0.028374
-0.000958
-0.020961
-0.327481
-0.012851

C.I. ]
-0.000566
0.052452
0.050611
-0.000234
-0.011221
-0.19614
0.038876

X
20.129
12.2869
10.6308
178.039
42.5378
0.237716
1.35325

t statistics
in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. esttab m1, margin
-1
inlf
nwifeinc -0.00341*
(-2.35)
educ
0.0380***
-5.15
exper
0.0395***
-6.96
expersq -0.000596**
(-3.23)
age
-0.0161***
(-6.48)
kidslt6
-0.262***
(-7.81)
kidsge6
0.013
-0.99
N
753

Marginal effects; t statistics in parentheses


(d) for discrete change of dummy variable from 0 to 1
* p<0.05, ** p<0.01, *** p<0.001
reg inlf nwifeinc educ exper expersq age kidslt6 kidsge6, robust
Linear regression

inlf
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6
_cons

Coef.
-0.0034052
0.0379953
0.0394924
-0.0005963
-0.0160908
-0.2618105
0.0130122
0.5855192

Number of obs = 753


F( 7, 745)
= 62.48
Prob > F
= 0.0000
R-squared
= 0.2642
Root MSE
= .42713
Robust
Std. Err.
0.0015249
0.007266
0.00581
0.00019
0.002399
0.0317832
0.0135329
0.1522599

. mfx
Marginal effects after regress
y = Fitted values (predict)
= .56839309

t
-2.23
5.23
6.8
-3.14
-6.71
-8.24
0.96
3.85

P>t
0.026
0
0
0.002
0
0
0.337
0

[95% Conf.
-0.0063988
0.023731
0.0280864
-0.0009693
-0.0208004
-0.3242058
-0.013555
0.2866098

Interval]
-0.0004115
0.0522596
0.0508983
-0.0002233
-0.0113812
-0.1994152
0.0395795
0.8844287

variable
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6

dy/dx
-0.0034052
0.0379953
0.0394924
-0.0005963
-0.0160908
-0.2618105
0.0130122

Std. Err.
0.00152
0.00727
0.00581
0.00019
0.0024
0.03178
0.01353

eststo m2
. esttab m2

-1
inlf
nwifeinc -0.00341*
(-2.23)
educ
0.0380***
-5.23
exper
0.0395***
-6.8
expersq -0.000596**
(-3.14)
age
-0.0161***
(-6.71)
kidslt6
-0.262***
(-8.24)
kidsge6
0.013
-0.96
_cons
0.586***
-3.85
N
753
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. esttab m2, margin

nwifeinc
educ
exper
expersq
age

-1
inlf
-0.00341*
(-2.23)
0.0380***
-5.23
0.0395***
-6.8
-0.000596**
(-3.14)
-0.0161***

z
-2.23
5.23
6.8
-3.14
-6.71
-8.24
0.96

P>z
0.026
0
0
0.002
0
0
0.336

[ 95%
-0.006394
0.023754
0.028105
-0.000969
-0.020793
-0.324104
-0.013512

C.I. ]
-0.000416
0.052236
0.05088
-0.000224
-0.011389
-0.199517
0.039536

X
20.129
12.2869
10.6308
178.039
42.5378
0.237716
1.35325

(-6.71)
kidslt6
-0.262***
(-8.24)
kidsge6
0.013
-0.96
N
753
Marginal effects; t statistics in parentheses
(d) for discrete change of dummy variable from 0 to 1
* p<0.05, ** p<0.01, *** p<0.001
. esttab m1 m2, margin
-1
-2
inlf
inlf
nwifeinc
-0.00341* -0.00341*
(-2.35)
(-2.23)
educ
0.0380*** 0.0380***
-5.15
-5.23
exper
0.0395*** 0.0395***
-6.96
-6.8
expersq -0.000596** -0.000596**
(-3.23)
(-3.14)
age
-0.0161*** -0.0161***
(-6.48)
(-6.71)
kidslt6
-0.262*** -0.262***
(-7.81)
(-8.24)
kidsge6
0.013
0.013
-0.99
-0.96
N
753
753
Marginal effects; t statistics in parentheses
(d) for discrete change of dummy variable from 0 to 1
* p<0.05, ** p<0.01, *** p<0.001
. predict p_ls
(option xb assumed; fitted values)
.
. label var p_ls "Pr(inlf=1|x), lpm"
. logit inlf nwifeinc educ exper expersq age kidslt6 kidsge6
Iteration 0:
Iteration 1:
Iteration 2:
Iteration 3:
Iteration 4:

log likelihood = -514.8732


log likelihood = -402.38502
log likelihood = -401.76569
log likelihood = -401.76515
log likelihood = -401.76515

Logistic regression

Log likelihood = -401.76515

Number of obs
LR chi2(7)
Prob > chi2
Pseudo R2

=
=
=
=

753
226.22
0.0000
0.2197

inlf
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6
_cons

Coef.
-0.0213452
0.2211704
0.2058695
-0.0031541
-0.0880244
-1.443354
0.0601122
0.4254524

Std. Err.
0.0084214
0.0434396
0.0320569
0.0010161
0.014573
0.2035849
0.0747897
0.8603697

z
-2.53
5.09
6.42
-3.1
-6.04
-7.09
0.8
0.49

P>z
0.011
0
0
0.002
0
0
0.422
0.621

[95% Conf.
-0.0378509
0.1360303
0.1430391
-0.0051456
-0.116587
-1.842373
-0.086473
-1.260841

Interval]
-0.0048394
0.3063105
0.2686999
-0.0011626
-0.0594618
-1.044335
0.2066974
2.111746

mfx
Marginal effects after logit
y = Pr(inlf) (predict)
= .58277201
variable
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6

dy/dx
-0.0051901
0.0537773
0.0500569
-0.0007669
-0.021403
-0.3509498
0.0146162

Std. Err.
0.00205
0.01056
0.00782
0.00025
0.00354
0.04964
0.01819

z
-2.53
5.09
6.4
-3.1
-6.05
-7.07
0.8

P>z
0.011
0
0
0.002
0
0
0.422

. eststo m3
. esttab m3, margin

-1
inlf
inlf
nwifeinc

-0.00519*
(-2.53)
educ
0.0538***
-5.09
exper
0.0501***
-6.4
expersq -0.000767**
(-3.10)
age
-0.0214***
(-6.05)
kidslt6
-0.351***
(-7.07)
kidsge6
0.0146
-0.8
N
753
Marginal effects; t statistics in parentheses
(d) for discrete change of dummy variable from 0 to 1
* p<0.05, ** p<0.01, *** p<0.001

[ 95%
-0.009204
0.033078
0.034721
-0.001252
-0.028341
-0.448241
-0.021032

C.I. ]
-0.001176
0.074476
0.065393
-0.000281
-0.014465
-0.253658
0.050265

X
20.129
12.2869
10.6308
178.039
42.5378
0.237716
1.35325

. probit inlf nwifeinc educ exper expersq age kidslt6 kidsge6


Iteration 0:
Iteration 1:
Iteration 2:
Iteration 3:
Iteration 4:

log likelihood = -514.8732


log likelihood = -402.06651
log likelihood = -401.30273
log likelihood = -401.30219
log likelihood = -401.30219

Probit regression

Number of obs
LR chi2(7)
Prob > chi2
Pseudo R2

Log likelihood = -401.30219


inlf
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6
_cons

Coef.
-0.0120237
0.1309047
0.1233476
-0.0018871
-0.0528527
-0.8683285
0.036005
0.2700768

Std. Err.
0.0048398
0.0252542
0.0187164
0.0006
0.0084772
0.1185223
0.0434768
0.508593

z
-2.48
5.18
6.59
-3.15
-6.23
-7.33
0.83
0.53

=
=
=
=

753
227.14
0.0000
0.2206

P>z
0.013
0
0
0.002
0
0
0.408
0.595

[95% Conf.
-0.0215096
0.0814074
0.0866641
-0.003063
-0.0694678
-1.100628
-0.049208
-0.7267473

Interval]
-0.0025378
0.180402
0.1600311
-0.0007111
-0.0362376
-0.636029
0.1212179
1.266901

. mfx
Marginal effects after probit
y = Pr(inlf) (predict)
= .58154201

variable
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6

dy/dx
-0.0046962
0.0511287
0.0481771
-0.0007371
-0.0206432
-0.3391514
0.0140628

Std. Err.
0.00189
0.00986
0.00733
0.00023
0.00331
0.04636
0.01699

. eststo m4
. esttab m4, margin
-1
inlf
inlf
nwifeinc
educ

-0.00470*
(-2.48)
0.0511***
-5.19

z
-2.48
5.19
6.57
-3.14
-6.24
-7.32
0.83

P>z
0.013
0
0
0.002
0
0
0.408

[ 95%
-0.008401
0.031805
0.033815
-0.001197
-0.027127
-0.430012
-0.019228

C.I. ]
-0.000991
0.070452
0.062539
-0.000277
-0.01416
-0.248291
0.047353

X
20.129
12.2869
10.6308
178.039
42.5378
0.237716
1.35325

exper

expersq
age
kidslt6
kidsge6
N

0.0482***
-6.57
0.000737**
(-3.14)
-0.0206***
(-6.24)
-0.339***
(-7.32)
0.0141
-0.83
753

Marginal effects; t statistics in parentheses


(d) for discrete change of dummy variable from 0 to 1
* p<0.05, ** p<0.01, *** p<0.001
. esttab m1 m2 m3 m4, margin

main
nwifeinc
educ
exper
expersq
age
kidslt6
kidsge6
N

-1
inlf

-2
inlf

-3
inlf

-4
inlf

-0.00341*
(-2.35)
0.0380***
-5.15
0.0395***
-6.96

-0.00341*
(-2.23)
0.0380***
-5.23
0.0395***
-6.8

-0.00519*
(-2.53)
0.0538***
-5.09
0.0501***
-6.4

-0.00470*
(-2.48)
0.0511***
-5.19
0.0482***
-6.57

-0.000596** -0.000596** -0.000767** -0.000737**


(-3.23)
(-3.14)
(-3.10)
(-3.14)
-0.0161*** -0.0161*** -0.0214*** -0.0206***
(-6.48)
(-6.71)
(-6.05)
(-6.24)
-0.262***
-0.262***
-0.351***
-0.339***
(-7.81)
(-8.24)
(-7.07)
(-7.32)
0.013
0.013
0.0146
0.0141
-0.99
-0.96
-0.8
-0.83
753
753
753
753

predict p_probit
(option pr assumed; Pr(inlf))
. label var p_probit "Pr(inlf=1|x), probit"
. browse inlf p_probit
gen inlf_probit=(p_probit>=0.5)
. label var inlf_probit "1(p_probit>=0.5)"
. tab inlf inlf_probit

=1 if in
lab frce,
1(p_probit>=0.5)
1975
0
1
0
205
120
1
80
348
Total
285
468
. tab inlf inlf_probit, row col

Total
325
428
753

Key
frequency
row percentage
column percentag

1if in
lab frce
1975

1(p_probit>=0.5)
0
1
Total
205
120
325
0
63.08
36.92
100
71.93
25.64
43.16
80
348
428
1
18.69
81.31
100
28.07
74.36
56.84
285
468
753
Total
37.85
62.15
100
100
100
100
. dprobit inlf nwifeinc educ exper expersq age kidslt6 kidsge6

Iteration 0:
Iteration 1:
Iteration 2:
Iteration 3:
Iteration 4:

log likelihood = -514.8732


log likelihood = -405.78215
log likelihood = -401.32924
log likelihood = -401.30219
log likelihood = -401.30219

Probit regression, reporting marginal effects

Log likelihood = -401.30219

Number of obs = 753


LR chi2(7) = 227.14
Prob > chi2 = 0.0000
Pseudo R2 = 0.2206

inlf

dF/dx

Std. Err.

P>z

x-bar

[ 95%

C.I. ]

nwifeinc

-0.0046962

0.0018903

-2.48

0.013

20.129

-0.008401

-0.000991

educ

0.0511287

0.0098592

5.18

12.2869

0.031805

0.070452

exper

0.0481771

0.0073278

6.59

10.6308

0.033815

0.062539

expersq

-0.0007371

0.0002347

-3.15

0.002

178.039

-0.001197

-0.000277

age

-0.0206432

0.0033079

-6.23

42.5378

-0.027127

-0.01416

kidslt6

-0.3391514

0.0463581

-7.33

0.237716

-0.430012

-0.248291

kidsge6

0.0140628

0.0169852

0.83

0.408

1.35325

-0.019228

0.047353

obs. P

0.5683931

pred. P

0.581542

(at x-bar)

z and P>|z| correspond to the test of the underlying coefficient being 0

. gen pk2a=normal( _b[_cons] + _b[nwifeinc]*nwifeinc + _b[educ]*educ + _b[exper]*exper +


_b[expersq]*expersq + _b[age]*age
> + _b[kidslt6]*2 + _b[kidsge6]*kidsge6)
.
. gen pk1a=normal( _b[_cons] + _b[nwifeinc]*nwifeinc + _b[educ]*educ + _b[exper]*exper +
_b[expersq]*expersq + _b[age]*age
> +_b[kidslt6]*1 + _b[kidsge6]*kidsge6)
. gen effecta=pk2a-pk1a
. egen meffecta=mean(effecta)
.
. sum meffecta
Variable
meffecta

Obs
753

Mean
-0.2196508

Std.

Dev.
0

Min
Max
-0.2196508 -0.2196508

. egen m_nwifeinc=mean(nwifeinc)
.
. egen m_educ=mean(educ)
.
. egen m_exper=mean(exper)
.
. egen m_expersq=mean(expersq)
.
. egen m_age=mean(age)
.
. egen m_kidslt6=mean(kidslt6)
.
. egen m_kidsge6=mean(kidsge6)
.
. egen m_cons=mean(_cons)
. gen pk2b=normal( _b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +
_b[exper]*m_exper + _b[expersq]*m_expersq+_b[ag
> e]*m_age + _b[kidslt6]*2 + _b[kidsge6]*m_kidsge6)
.
. gen pk1b=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +
_b[exper]*m_exper + _b[expersq]*m_expersq +_b[ag
> e]*m_age + _b[kidslt6]*1 + _b[kidsge6]*m_kidsge6)
.sort kidslt6
. twoway line pk2b pk1b kidslt6, saving(pk2b.gph, replace)
(note: file pk2b.gph not found)
(file pk2b.gph saved)
.
. twoway line pk1b kidslt6, saving(pk1b.gph, replace)
(note: file pk1b.gph not found)
(file pk1b.gph saved)
. graph combine pk2b.gph pk1b.gph

. twoway line pk2b pk1b kidslt6, saving(pk2b.gph, replace)


(file pk2b.gph saved)
. gen effectb=pk2b-pk1b
.
. sum effectb
Variable |
Obs
Mean Std. Dev.
Min
Max
-------------+-------------------------------------------------------effectb |
753 -.2314838
0 -.2314838 -.2314838
. probit inlf nwifeinc educ exper expersq age kidslt6 kidsge6
Iteration 0:
Iteration 1:
Iteration 2:
Iteration 3:
Iteration 4:

log likelihood = -514.8732


log likelihood = -402.06651
log likelihood = -401.30273
log likelihood = -401.30219
log likelihood = -401.30219

Probit regression

Number of obs =
753
LR chi2(7) = 227.14
Prob > chi2 = 0.0000
Log likelihood = -401.30219
Pseudo R2
= 0.2206
-------------------------------------------------------------------------------------------------inlf |
Coef.
Std. Err.
z P>|z| [95% Conf. Interval]
-------------+-----------------------------------------------------------------------------------nwifeinc | -.0120237 .0048398 -2.48 0.013 -.0215096 -.0025378
educ | .1309047 .0252542 5.18 0.000 .0814074 .180402
exper | .1233476 .0187164 6.59 0.000 .0866641 .1600311
expersq | -.0018871 .0006
-3.15 0.002 -.003063 -.0007111
age | -.0528527 .0084772 -6.23 0.000 -.0694678 -.0362376
kidslt6 | -.8683285 .1185223 -7.33 0.000 -1.100628 -.636029
kidsge6
.036005 .0434768 0.83 0.408 -.049208 .1212179
_cons | .2700768 .508593
0.53 0.595 -.7267473 1.266901
--------------------------------------------------------------------------------------------------.
. gen p_educ=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*educ +
_b[exper]*m_exper + _b[expersq]*m_expersq +_b[ag
> e]*m_age + _b[kidslt6]*m_kidslt6 + _b[kidsge6]*m_kidsge6)
.
. gen p_kidslt6=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +
_b[exper]*m_exper + _b[expersq]*m_expersq +
> _b[age]*m_age + _b[kidslt6]*kidslt6 + _b[kidsge6]*m_kidsge6)
.
. gen p_exper=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +
_b[exper]*exper + _b[expersq]*expersq +_b[age
> ]*m_age + _b[kidslt6]*m_kidslt6 + _b[kidsge6]*m_kidsge6)
.
. label var p_educ "Participation probability"

.
. label var p_kidslt6 "Participation probability"
.
. label var p_exper "Participation probability"
.
.
.
. sort educ
twoway line p_educ educ, saving(g_educ.gph, replace)
(note: file g_educ.gph not found)
(file g_educ.gph saved)
.
. graph export g_educ.wmf, replace
(note: file g_educ.wmf not found)
(file D:\MAESTRIA\DATOS\PROGRAMAS DE ECONOMETRIA\Stata12 FULL\Stata12\g_educ.wmf
written in Windows Metafile format)

sort kidslt6
.
. twoway line p_kidslt6 kidslt6, saving(g_kidslt6.gph, replace)
(note: file g_kidslt6.gph not found)
(file g_kidslt6.gph saved)
.
. graph export g_kidslt6.eps, replace
(note: file g_kidslt6.eps not found)
(file g_kidslt6.eps written in EPS format)

sort exper
.
. twoway line p_exper exper, saving(g_exper.gph, replace)
(note: file g_exper.gph not found)
(file g_exper.gph saved)
.
. graph combine g_educ.gph g_kidslt6.gph g_exper.gph pk2b.gph, saving(probit_graphs.gph,
replace)title("Estimated particip
> ation probability (probit)")
(file probit_graphs.gph saved)
.
. graph export probit_graphs.wmf, replace
(file D:\MAESTRIA\DATOS\PROGRAMAS DE ECONOMETRIA\Stata12
FULL\Stata12\probit_graphs.wmf written in Windows Metafile format
>)

gen p_exper5=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +


_b[exper]*(exper+5) + _b[expersq]*expersq +_
> b[age]*m_age + _b[kidslt6]*m_kidslt6 + _b[kidsge6]*m_kidsge6)
.
. gen p_exper2=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +
_b[exper]*(exper+1) + _b[expersq]*expersq +_
> b[age]*m_age + _b[kidslt6]*m_kidslt6 + _b[kidsge6]*m_kidsge6)
.
. gen p_exper1=normal(_b[_cons] + _b[nwifeinc]*m_nwifeinc + _b[educ]*m_educ +
_b[exper]*1*exper + _b[expersq]*expersq +_b[
> age]*m_age + _b[kidslt6]*m_kidslt6 + _b[kidsge6]*m_kidsge6)
.
. sort exper
.
. twoway line p_exper5 p_exper2 p_exper1 exper, saving(experiencia, replace)
(note: file experiencia.gph not found)
(file experiencia.gph saved)

You might also like