Latihan Logit Probit

Unduh sebagai doc, pdf, atau txt
Unduh sebagai doc, pdf, atau txt
Anda di halaman 1dari 11

Latihan Limited Dependent Variable

Model Umum Logit dan Probit: Pr( y = 1 | x) = 0 + 1 x1 + 2 x2 + .... + k xk +


1. Gunakan data MROZ.dta untuk soal berikut. Deskripsi variable adalah
sebagai berikut
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.

inlf
hours
kidslt6
kidsge6
age
educ
wage
repwage
hushrs
husage
huseduc
huswage
faminc
mtr
motheduc
fatheduc
unem
city
exper
nwifeinc
lwage
expersq

=1 if in labor force, 1975


hours worked, 1975
# kids < 6 years
# kids 6-18
woman's age in yrs
years of schooling
estimated wage from earns., hours
reported wage at interview in 1976
hours worked by husband, 1975
husband's age
husband's years of schooling
husband's hourly wage, 1975
family income, 1975
fed. marginal tax rate facing woman
mother's years of schooling
father's years of schooling
unem. rate in county of resid.
=1 if live in SMSA
actual labor mkt exper
(faminc - wage*hours)/1000
log(wage)
exper^2

Seorang analis berusaha mencari faktor-faktor yang menentukan seseorang berada


pada angkatan kerja (infl) berdasarkan serangkaian variabel (nwifeinc, educ, exper,
exper^2, age, kidslt6, dan kidsge6). Spesifikasi modelnya sebagai berikut;
Pr(inf li ) = 0 + 1nwifeinci + 2educi + 3 exp eri + 4 exp er ^ 2i + 5 agei + 6 kidslt 6i + 7 kidsgei + ui

a.
b.
c.
d.
e.

Estimasikan modelnya dengan logit, dan lakukan pengujian model


Cari odd ratio dari masing-masing variabel. Interpretasikan hasilnya
Estimasi dengan menggunakan model probit, dan lakukan pengujian model
Cari marginal effect dari masing-masing variabelInterpretasikan hasilnya.
Model mana yang lebih cocok (logit atau probit) secara statistik.

Jawab
Dengan STATA:
. use "E:\05Ekonometri\PIA_Ekmet2\Pertemuan3\mroz.dta", clear
MODEL LOGIT
. logit inlf
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:

nwifeinc educ exper expersq age kidslt6 kidsge6


log
log
log
log
log

likelihood
likelihood
likelihood
likelihood
likelihood

Logistic regression
Log likelihood = -401.76515

=
=
=
=
=

-514.8732
-406.94123
-401.85151
-401.76519
-401.76515
Number of obs
LR chi2(7)
Prob > chi2
Pseudo R2

=
=
=
=

753
226.22
0.0000
0.2197

------------------------------------------------------------------------------

inlf |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------nwifeinc | -.0213452
.0084214
-2.53
0.011
-.0378509
-.0048394
educ |
.2211704
.0434396
5.09
0.000
.1360303
.3063105
exper |
.2058695
.0320569
6.42
0.000
.1430391
.2686999
expersq | -.0031541
.0010161
-3.10
0.002
-.0051456
-.0011626
age | -.0880244
.014573
-6.04
0.000
-.116587
-.0594618
kidslt6 | -1.443354
.2035849
-7.09
0.000
-1.842373
-1.044335
kidsge6 |
.0601122
.0747897
0.80
0.422
-.086473
.2066974
_cons |
.4254524
.8603696
0.49
0.621
-1.260841
2.111746
-----------------------------------------------------------------------------Dalam logistic yang dibaca odds ratio coefnya tidak di baca
MENCARI ODDS RATIO
. logistic inlf nwifeinc educ exper expersq age kidslt6 kidsge6
Logistic regression
Number of obs
LR chi2(7)
Prob > chi2
Log likelihood = -401.76515
Pseudo R2

=
=
=
=

753
226.22
0.0000
0.2197

-----------------------------------------------------------------------------inlf | Odds Ratio


Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------nwifeinc |
.978881
.0082436
-2.53
0.011
.9628565
.9951723
educ |
1.247536
.0541925
5.09
0.000
1.145717
1.358404
exper |
1.228593
.0393849
6.42
0.000
1.153775
1.308263
expersq |
.9968509
.0010129
-3.10
0.002
.9948676
.9988381
age |
.9157386
.0133451
-6.04
0.000
.8899527
.9422715
kidslt6 |
.2361344
.0480734
-7.09
0.000
.158441
.3519257
kidsge6 |
1.061956
.0794234
0.80
0.422
.9171603
1.22961
-----------------------------------------------------------------------------CARA MWNTWRJEMAHKAN ODDS RATIO
Nwifeinc: jika pendapatan naik satu2an maka peluang kerjanya meningkat 0,03 kali
pendapatan sebelumnya
OR (Pendidikan)=1.247 Apabila pendidikan bertambah satu tahun, maka peluang bekerja
meningkat 0,247 (1.247-1) kali pendidikan sebelumnya

. estat class
Logistic model for inlf
-------- True -------Classified |
D
~D |
Total
-----------+--------------------------+----------+
|
347
118 |
465
|
81
207 |
288
-----------+--------------------------+----------Total
|
428
325 |
753
Classified + if predicted Pr(D) >= .5
True D defined as inlf != 0
-------------------------------------------------Sensitivity
Pr( +| D)
81.07%
Specificity
Pr( -|~D)
63.69%
Positive predictive value
Pr( D| +)
74.62%
Negative predictive value
Pr(~D| -)
71.88%
-------------------------------------------------False + rate for true ~D
Pr( +|~D)
36.31%
False - rate for true D
Pr( -| D)
18.93%
False + rate for classified +
Pr(~D| +)
25.38%
False - rate for classified Pr( D| -)
28.13%
-------------------------------------------------Correctly classified
73.57%
-------------------------------------------------. estat ic

----------------------------------------------------------------------------Model |
Obs
ll(null)
ll(model)
df
AIC
BIC
-------------+--------------------------------------------------------------. |
753
-514.8732
-401.7652
8
819.5303
856.5228
----------------------------------------------------------------------------Note: N=Obs used in calculating BIC; see [R] BIC note
Nilai AIC BIC lebih rendah lebih bagus
PROBIT
. probit inlf

nwifeinc educ exper expersq age kidslt6 kidsge6

Iteration
Iteration
Iteration
Iteration
Iteration

log
log
log
log
log

0:
1:
2:
3:
4:

likelihood
likelihood
likelihood
likelihood
likelihood

=
=
=
=
=

-514.8732
-405.78215
-401.32924
-401.30219
-401.30219

Probit regression

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

Log likelihood = -401.30219

=
=
=
=

753
227.14
0.0000
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
-.7267472
1.266901
-----------------------------------------------------------------------------MENCARI MARGINAL EFFECT
. dprobit inlf nwifeinc educ exper expersq age kidslt6 kidsge6
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:

log
log
log
log
log

likelihood
likelihood
likelihood
likelihood
likelihood

=
=
=
=
=

-514.8732
-405.78215
-401.32924
-401.30219
-401.30219

Probit regression, reporting marginal effects


Log likelihood = -401.30219

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

=
753
= 227.14
= 0.0000
= 0.2206

-----------------------------------------------------------------------------inlf |
dF/dx
Std. Err.
z
P>|z|
x-bar [
95% C.I.
]
---------+-------------------------------------------------------------------nwifeinc | -.0046962
.0018903
-2.48
0.013
20.129 -.008401 -.000991
educ |
.0511287
.0098592
5.18
0.000
12.2869
.031805 .070452
exper |
.0481771
.0073278
6.59
0.000
10.6308
.033815 .062539
expersq | -.0007371
.0002347
-3.15
0.002
178.039 -.001197 -.000277
age | -.0206432
.0033079
-6.23
0.000
42.5378 -.027127 -.01416
kidslt6 | -.3391514
.0463581
-7.33
0.000
.237716 -.430012 -.248291
kidsge6 |
.0140628
.0169852
0.83
0.408
1.35325 -.019228 .047353
---------+-------------------------------------------------------------------obs. P |
.5683931
pred. P |
.581542 (at x-bar)
-----------------------------------------------------------------------------z and P>|z| correspond to the test of the underlying coefficient being 0
. estat class
Probit model for inlf
-------- True -------Classified |
D
~D |
Total
-----------+--------------------------+-----------

+
|
348
120 |
468
|
80
205 |
285
-----------+--------------------------+----------Total
|
428
325 |
753
Classified + if predicted Pr(D) >= .5
True D defined as inlf != 0
-------------------------------------------------Sensitivity
Pr( +| D)
81.31%
Specificity
Pr( -|~D)
63.08%
Positive predictive value
Pr( D| +)
74.36%
Negative predictive value
Pr(~D| -)
71.93%
-------------------------------------------------False + rate for true ~D
Pr( +|~D)
36.92%
False - rate for true D
Pr( -| D)
18.69%
False + rate for classified +
Pr(~D| +)
25.64%
False - rate for classified Pr( D| -)
28.07%
-------------------------------------------------Correctly classified
73.44%
-------------------------------------------------Note: Nilai Logit dan Probit lebih tinggi lebih bagus
. estat ic
----------------------------------------------------------------------------Model |
Obs
ll(null)
ll(model)
df
AIC
BIC
-------------+--------------------------------------------------------------. |
753
-514.8732
-401.3022
8
818.6044
855.5969
----------------------------------------------------------------------------Note: N=Obs used in calculating BIC; see [R] BIC note

DENGAN EVIEWS
Quick Estimate Equation
Equation specification: inlf nwifeinc educ exper expersq age kidslt6 kidsge6 c

Output Model Logit


Dependent Variable: INLF
Method: ML - Binary Logit (Quadratic hill climbing)
Date: 10/04/12 Time: 11:09
Sample: 1 753
Included observations: 753
Convergence achieved after 5 iterations
Covariance matrix computed using second derivatives
Variable

Coefficient

Std. Error

z-Statistic

Prob.

NWIFEINC
EDUC
EXPER
EXPERSQ
AGE
KIDSLT6
KIDSGE6
C

-0.021345
0.221170
0.205870
-0.003154
-0.088024
-1.443354
0.060112
0.425452

0.008421
0.043440
0.032057
0.001016
0.014573
0.203585
0.074790
0.860370

-2.534620
5.091442
6.422001
-3.104093
-6.040232
-7.089692
0.803749
0.494500

0.0113
0.0000
0.0000
0.0019
0.0000
0.0000
0.4215
0.6210

McFadden R-squared
S.D. dependent var
Akaike info criterion
Schwarz criterion
Hannan-Quinn criter.
LR statistic
Prob(LR statistic)
Obs with Dep=0
Obs with Dep=1

0.219681
0.495630
1.088354
1.137481
1.107280
226.2161
0.000000
325
428

Mean dependent var


S.E. of regression
Sum squared resid
Log likelihood
Restr. log likelihood
Avg. log likelihood

Total obs

0.568393
0.425963
135.1762
-401.7652
-514.8732
-0.533553

753

View Prediction Expectation Evaluation degan probability 0.5


Expectation-Prediction Evaluation for Binary Specification
Equation: UNTITLED
Date: 10/04/12 Time: 11:14
Success cutoff: C = 0.5
Estimated Equation
Dep=0
Dep=1
Total
P(Dep=1)<=C
P(Dep=1)>C
Total
Correct
% Correct
% Incorrect
Total Gain*
Percent Gain**

E(# of Dep=0)
E(# of Dep=1)
Total
Correct
% Correct
% Incorrect
Total Gain*
Percent Gain**

207
118
325
207
63.69
36.31
63.69
63.69

81
347
428
347
81.07
18.93
-18.93
NA

288
465
753
554
73.57
26.43
16.73
38.77

Constant Probability
Dep=0
Dep=1
Total
0
325
325
0
0.00
100.00

0
428
428
428
100.00
0.00

0
753
753
428
56.84
43.16

Estimated Equation
Dep=0
Dep=1
Total

Constant Probability
Dep=0
Dep=1
Total

190.18
134.82
325.00
190.18
58.52
41.48
15.36
27.02

140.27
184.73
325.00
140.27
43.16
56.84

134.82
293.18
428.00
293.18
68.50
31.50
11.66
27.02

325.00
428.00
753.00
483.35
64.19
35.81
13.25
27.02

184.73
243.27
428.00
243.27
56.84
43.16

325.00
428.00
753.00
383.54
50.94
49.06

Output Model Probit


Dependent Variable: INLF
Method: ML - Binary Probit (Quadratic hill climbing)
Date: 10/04/12 Time: 11:18
Sample: 1 753
Included observations: 753
Convergence achieved after 4 iterations
Covariance matrix computed using second derivatives
Variable

Coefficient

Std. Error

z-Statistic

Prob.

NWIFEINC
EDUC
EXPER
EXPERSQ
AGE
KIDSLT6
KIDSGE6
C

-0.012024
0.130905
0.123348
-0.001887
-0.052853
-0.868329
0.036005
0.270077

0.004840
0.025254
0.018716
0.000600
0.008477
0.118522
0.043477
0.508593

-2.484327
5.183485
6.590348
-3.145205
-6.234656
-7.326288
0.828142
0.531027

0.0130
0.0000
0.0000
0.0017
0.0000
0.0000
0.4076
0.5954

McFadden R-squared

0.220581

Mean dependent var

0.568393

S.D. dependent var


Akaike info criterion
Schwarz criterion
Hannan-Quinn criter.
LR statistic
Prob(LR statistic)

0.495630
1.087124
1.136251
1.106050
227.1420
0.000000

Obs with Dep=0


Obs with Dep=1

325
428

S.E. of regression
Sum squared resid
Log likelihood
Restr. log likelihood
Avg. log likelihood

0.425945
135.1646
-401.3022
-514.8732
-0.532938

Total obs

753

Expectation-Prediction Evaluation for Binary Specification


Equation: UNTITLED
Date: 10/04/12 Time: 11:18
Success cutoff: C = 0.5
Estimated Equation
Dep=0
Dep=1
Total
P(Dep=1)<=C
P(Dep=1)>C
Total
Correct
% Correct
% Incorrect
Total Gain*
Percent Gain**

E(# of Dep=0)
E(# of Dep=1)
Total
Correct
% Correct
% Incorrect
Total Gain*
Percent Gain**

205
120
325
205
63.08
36.92
63.08
63.08

80
348
428
348
81.31
18.69
-18.69
NA

285
468
753
553
73.44
26.56
16.60
38.46

Constant Probability
Dep=0
Dep=1
Total
0
325
325
0
0.00
100.00

0
428
428
428
100.00
0.00

0
753
753
428
56.84
43.16

Estimated Equation
Dep=0
Dep=1
Total

Constant Probability
Dep=0
Dep=1
Total

189.60
135.40
325.00
189.60
58.34
41.66
15.18
26.70

140.27
184.73
325.00
140.27
43.16
56.84

134.11
293.89
428.00
293.89
68.67
31.33
11.83
27.40

323.71
429.29
753.00
483.48
64.21
35.79
13.27
27.05

184.73
243.27
428.00
243.27
56.84
43.16

325.00
428.00
753.00
383.54
50.94
49.06

2. Gunakan data pelanggaran pajak simulasi.dta untuk latihan berikut. Data


tersebut berasal dari hasil simulasi.

variable
Educ

deskripsi
Lama masa pendidikan formal individu i (tahun)

Service

Index kepuasan palayanan publik yang diberikan oleh individu i.


Nilainya antara 0 sampai 10 (continuous), dimana 0 sangat tidak
puas, 10 sangat puas

Mtr

tarif pajak marginal individu i (%)

Sex

Indikator jenis kelamin individu i , 1 = Laki-laki, 0= Perempuan

VIOL

Indikator pelanggaran pajak individu i, 1 = melanggar, 0 = Tidak


melanggar
a. Estimasi perilaku pelanggaran pajak dengan menggunakan model logit,
dengan spesifikasi sebagai berikut;
Pr(VIOLi ) = 0 + 1 Educi + 2 Servicei + 3 MTRi + 4 SEX i + u i

b. Cari odd ratio dari masing-masing variabel. Interpretasikan hasilnya.


c. Estimasi perilaku pelanggaran pajak dengan menggunakan model probit,
dengan spesifikasi sebagai berikut;
Pr(VIOLi ) = 0 + 1 Educi + 2 Servicei + 3 MTRi + 4 SEX i + u i

d. Cari marginal effect dari masing-masing variabel, dievaluasi pada nilai


tengah. Interpretasikan hasilnya.
e. Hitung perbedaan probabilitas pelanggaran pajak yang dilakukan oleh Ahmad
dan Maia, jika mereka memiliki karakteristik seperti dibawah ini.
Educ
11
12

Ahmad
Maia

Service
3
3

MTR
0.25
0.25

Sex
1
0

Jawab:
Estimasi LOGIT:
logit

viol educ service mtr sex

Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

log
log
log
log
log
log

likelihood
likelihood
likelihood
likelihood
likelihood
likelihood

Logistic regression
Log likelihood = -4699.5369

=
=
=
=
=
=

-7246.3443
-5293.5223
-4765.2154
-4701.7883
-4699.5407
-4699.5369
Number of obs
LR chi2(4)
Prob > chi2
Pseudo R2

=
=
=
=

20000
5093.61
0.0000
0.3515

-----------------------------------------------------------------------------viol |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ | -.6274836
.0125418
-50.03
0.000
-.6520651
-.6029022
service | -.9220601
.029517
-31.24
0.000
-.9799123
-.864208
mtr |
.9877184
.5326701
1.85
0.064
-.0562959
2.031733
sex |
.4556379
.0540524
8.43
0.000
.349697
.5615787
_cons |
4.548163
.1702511
26.71
0.000
4.214477
4.881849
------------------------------------------------------------------------------

ODD RATIO
. logistic viol educ service mtr sex
Logistic regression

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

Log likelihood = -4699.5369

=
=
=
=

20000
5093.61
0.0000
0.3515

-----------------------------------------------------------------------------viol | Odds Ratio


Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.5339337
.0066965
-50.03
0.000
.5209688
.5472212
service |
.3976989
.0117389
-31.24
0.000
.375344
.4213852
mtr |
2.685101
1.430273
1.85
0.064
.9452594
7.62729
sex |
1.577179
.0852504
8.43
0.000
1.418638
1.753438

Estimasi PROBIT
. probit viol educ service mtr sex
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

log
log
log
log
log
log

likelihood
likelihood
likelihood
likelihood
likelihood
likelihood

Probit regression
Log likelihood = -4690.1149

=
=
=
=
=
=

-7246.3443
-5077.4429
-4728.1689
-4690.6948
-4690.115
-4690.1149
Number of obs
LR chi2(4)
Prob > chi2
Pseudo R2

=
=
=
=

20000
5112.46
0.0000
0.3528

-----------------------------------------------------------------------------viol |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ | -.3407488
.0065509
-52.02
0.000
-.3535884
-.3279091
service | -.4989346
.0156772
-31.83
0.000
-.5296613
-.4682078
mtr |
.5544322
.2885814
1.92
0.055
-.0111769
1.120041
sex |
.2416716
.0292332
8.27
0.000
.1843757
.2989676
_cons |
2.431004
.092101
26.39
0.000
2.250489
2.611519
-----------------------------------------------------------------------------Note: 4 failures and 0 successes completely determined.

MARGINAL EFFECT
. mfx

Marginal effects after probit


y = Pr(viol) (predict)
=
.0351314
-----------------------------------------------------------------------------variable |
dy/dx
Std. Err.
z
P>|z| [
95% C.I.
]
X
---------+-------------------------------------------------------------------educ | -.0264108
.00079 -33.54
0.000 -.027954 -.024868
7.99085
service | -.0386714
.0015 -25.79
0.000 -.041611 -.035732
3.50946
mtr |
.042973
.02239
1.92
0.055 -.000915 .086861
.200073
sex*|
.0188052
.00233
8.07
0.000
.014238 .023372
.50365
-----------------------------------------------------------------------------(*) dy/dx is for discrete change of dummy variable from 0 to 1

3. Gunakan data FERTIL2.dta untuk latihan 3 berikut. Deskripsi variable


adalah sebagai berikut
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.

mnthborn
yearborn
age
electric
radio
tv
bicycle
educ
ceb
agefbrth
children
knowmeth
usemeth
monthfm
yearfm
agefm
idlnchld
heduc
agesq
urban
urbeduc
spirit
protest
catholic
frsthalf
educ0
evermarr

bulan lahir
tahun lahir
umur
=1 jika punya akses listrik
=1 jika punya radio
=1 jika punya TV
=1 jika punya sepeda
lama pendidikan formal (tahun)
pernah melahirkan
umur saat kelahiran pertama
jumlah anak yang hidup
=1 jika tau tentang kontrasepsi
=1 jika pernah menggunakan kontrasepsi
bulan pernikahan pertama
tahun pernikahan pertama
umur saat pernikahan pertama
jumlah anak ideal
lama pendidikan formal suami (tahun)
kuadrat dari umur
=1 jika tinggal di perkotaan
urban*educ
=1 jika agama adalah animisme
=1 jika beragama protestant
=1 jika beragama katholik
=1 jika mnthborn <= 6
=1 jika educ == 0
=1 jika pernah menikah

Seorang analis berusaha mencari faktor-faktor yang menentukan jumlah anak yang
dimiliki oleh satu keluarga. Dengan menggunakan data FERTIL2, dia melakukan regresi
dengan spesifikasi sebagai berikut;
childreni = 0 + 1 agei + 2 agesqi + 3 agefbrthi + 4 educi + 5 urbani + u i

a. Estimasi model tersebut dengan menggunakan model Poisson.


Interpretasikan arti masing-masing koefisien
b. Estimasi ulang model diatas, dengan menggunakan variable tambahan
urbeduc, dimana urbeduc = urban * educ, sehingga persamaan menjadi;

childreni = 0 + 1 agei + 2 agesqi + 3 agefbrthi + 4 educi + 5 urbani + 5 urbeduci + u i

c. Interpretasikan koefisien urbeduc tersebut.

Anda mungkin juga menyukai