Anda di halaman 1dari 20

Stata:

REGRESI LOGISTIK
BESRAL
Departemen Biostatistik FKM-UI

REGRESI LOGISTIK
Regresi Logistik:
Model matematis untuk menganalisis hubungan
antara satu atau beberapa variabel independent
yang bersifat binary atau dikotom maupun
kontinu dengan satu variabel dependent yang
bersifat binary (sehat/sakit, hidup/mati)
Regresi Logistik:
- Sederhana hanya satu variabel independen
- Ganda/multiple lebih dari satu variabel
independen
2

REGRESI LOGISTIK
Persamaan Regresi
Logistik:

Logit (Y ) = a + b1 x1 + .... + bk xk

1
1
P(Y ) =
=
(logitY )
( a+b1 x1 +.....+bk xk )
1+ Exp
1+ Exp
OR = Exp

(b )

= Exponensial

P = Probabilitas

(b )

=e

(b )

OR = Odds Ratio
3

REGRESI LOGISTIK
1. Sex (0=P/1=L)
2. Umur (0=<40/1=40+)
3. Rokok
(1=Y,2=K, 3=P, 4=T)

Hipertensi
(0=T/1=Y)

4. Desa=0/Kota=1
5. Status gizi
(0= IMT<22.5/1=IMT 22.5+)
4

REGRESI LOGISTIK
Statistics-->Binary outcomes-->Logistic reg (Reported OR)

Dependen-->hiper_s
Independen:
-->sex
-->um_x
-->rokok
-->kd_kota
-->imt_x

REGRESI LOGISTIK (Sederhana)


. logistic hiper_s sex
Logistic regression

Number of obs
=
4635
LR chi2(1)
=
3.70
Prob > chi2
=
0.0545
Log likelihood = -2550.7926
Pseudo R2
=
0.0007
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------sex |
.8760421
.0603296
-1.92
0.055
.7654311
1.002637
------------------------------------------------------------------------------

Laki memiliki peluang lebih kecil untuk menderita hipertensi


dibandingkan perempuan OR=0,87 nilai-p=0,055

REGRESI LOGISTIK (Sederhana)


. logistic hiper_s um_x
Logistic regression

Number of obs
=
4635
LR chi2(1)
=
220.79
Prob > chi2
=
0.0000
Log likelihood = -2442.2464
Pseudo R2
=
0.0432
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------um_x |
2.826001
.2014662
14.57
0.000
2.45748
3.249785
-----------------------------------------------------------------------------

Umur 40 th keatas memiliki peluang 2,8 kali lebih besar untuk


menderita hipertensi dibandingkan umur dibawah 40 th (OR=2,8 nilaip=0,000)

REGRESI LOGISTIK (Sederhana)


. xi:logistic hiper_s i.rokok
i.rokok
_Irokok_1-4
Logistic regression

(naturally coded; _Irokok_1 omitted)


Number of obs
=
4635
LR chi2(3)
=
10.27
Prob > chi2
=
0.0164
Log likelihood = -2547.5058
Pseudo R2
=
0.0020
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------_Irokok_2 |
1.051768
.1763477
0.30
0.763
.7571827
1.460963
_Irokok_3 |
1.653964
.2876303
2.89
0.004
1.176248
2.325697
_Irokok_4 |
1.18408
.0924609
2.16
0.030
1.016047
1.379903
------------------------------------------------------------------------------

Bila dibandingkan dengan Perokok, Kelompok yg Pernah merokok


punya peluang 1,65 kali lebih besar untuk hipertensi (nilai-p=0,004),
dan kelompok yg Tidak perokok punya peluang 1,18 kali lebih besar
untuk hipertensi (nilai-p=0,030). Tidak ada perbedaan risiko hipertensi
antara Perokok dengan Kadang-kadang merokok (nilai-p=0,763)
8

REGRESI LOGISTIK (Sederhana)


. logistic hiper_s imt_x
Logistic regression

Number of obs
=
4635
LR chi2(1)
=
84.58
Prob > chi2
=
0.0000
Log likelihood = -2510.3515
Pseudo R2
=
0.0166
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------imt_x |
1.889432
.1314754
9.14
0.000
1.648545
2.165518
------------------------------------------------------------------------------

Kelompok IMT diatas 22,5 punya kecenderungan 1,88 kali lebih besar
untuk hipertensi dibandingkan dengan IMT kurang atau sama dengan
22,5 (nilai-p=0,000)

REGRESI LOGISTIK (Sederhana)


. logistic hiper_s kd_kota
Logistic regression

Number of obs
=
4635
LR chi2(1)
=
8.34
Prob > chi2
=
0.0039
Log likelihood = -2548.4696
Pseudo R2
=
0.0016
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------kd_kota |
.8182428
.056991
-2.88
0.004
.7138312
.9379265
------------------------------------------------------------------------------

Penduduk yg tinggal di Urban/Kota memiliki kemungkinan lebih rendah


(0,8 kali) untuk hipertensi dibandingkan dengan penduduk yang
tinggal di Rural/Desa (OR=0,81 dan nilai-p=0,004)

10

REGRESI LOGISTIK (Ganda)


Independen
Variabel:
1.
2.
3.
4.
5.

Sex
Umur
Rokok
IMT
Kota/Desa

Kandidat Model
Seleksi variabel

Ya

Nilai-p < 0,25

Nilai-p < 0,25


Tidak

Keluar

Modelling:
1.Determinants
2.Risk Factors

Determinants =Faktor-faktor yang secara statistik berhubungan


dengan var dependen (hipertensi)
11

REGRESI LOGISTIK (Ganda)


Model-1 (Full model)
. xi:logistic hiper_s sex um_x
i.rokok
_Irokok_1-4
Logistic regression

kd_kota imt_x i.rokok


(naturally coded; _Irokok_1 omitted)
Number of obs
=
4635
LR chi2(7)
=
326.75
Prob > chi2
=
0.0000
Log likelihood = -2389.2655
Pseudo R2
=
0.0640
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------sex |
.9073994
.0903272
-0.98
0.329
.7465614
1.102888
um_x |
2.849128
.2068243
14.42
0.000
2.471277
3.284752
kd_kota |
.7576529
.055673
-3.78
0.000
.6560293
.8750188
imt_x |
1.978941
.1454135
9.29
0.000
1.713508
2.285491
_Irokok_2 |
1.018952
.1770726
0.11
0.914
.7248242
1.432435
_Irokok_3 |
1.350137
.2446273
1.66
0.098
.9465669
1.925771
_Irokok_4 |
1.062863
.1153874
0.56
0.574
.859149
1.31488
------------------------------------------------------------------------------

Variabel sex punya nilai-p paling besar (0,329) -->dikeluarkan


12

REGRESI LOGISTIK (Ganda)


Model-2 (sex keluar)
. xi:logistic hiper_s um_x kd_kota imt_x i.rokok
i.rokok
_Irokok_1-4
(naturally coded; _Irokok_1 omitted)
Logistic regression
Number of obs
=
4635
LR chi2(6)
=
325.79
Prob > chi2
=
0.0000
Log likelihood = -2389.7442
Pseudo R2
=
0.0638
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------um_x |
2.841401
.2060553
14.40
0.000
2.464929
3.275373
kd_kota |
.7549224
.0554008
-3.83
0.000
.6537866
.8717031
imt_x |
1.988014
.1457861
9.37
0.000
1.721864
2.295304
_Irokok_2 |
1.022987
.1776798
0.13
0.896
.7278257
1.437848
_Irokok_3 |
1.356732
.2457455
1.68
0.092
.9512953
1.934962
_Irokok_4 |
1.139386
.0930841
1.60
0.110
.970802
1.337246
------------------------------------------------------------------------------

Variabel rokok punya nilai-p paling besar (0,092) -->dikeluarkan


13

REGRESI LOGISTIK (Ganda)


Model-3 (sex & rokok keluar)
. xi:logistic hiper_s um_x
Logistic regression

kd_kota imt_x

Number of obs
=
4635
LR chi2(3)
=
321.47
Prob > chi2
=
0.0000
Log likelihood = -2391.907
Pseudo R2
=
0.0630
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------um_x |
2.841395
.2051403
14.46
0.000
2.466479
3.273301
kd_kota |
.758514
.0555725
-3.77
0.000
.657053
.8756424
imt_x |
2.023278
.1469938
9.70
0.000
1.754748
2.332902
------------------------------------------------------------------------------

Dari 5 variabel independen yg diuji, yang berhubungan dengan hipertensi


hanya 3 variabel yaitu umur, IMT, dan tempat tinggal (semua variabel
nilai-p-nya kecil dari 0,001).
Kelompok yg memiliki peluang lebih besar untuk hipertensi adalalah Umur
diatas 40th (OR=2,84), IMT diatas 22,5 (OR=2,02). Sedangkan yang
tinggal di Kota memiliki peluang lebih kecil untuk hipertensi (OR=0,75)
14

REGRESI LOGISTIK (Ganda)


Model-4 (uji interaksi)
. logistic hiper_s um_x imt_x
Logistic regression

kd_kota umXimt umXkota imtXkota


Number of obs
=
4635
LR chi2(6)
=
325.32
Prob > chi2
=
0.0000
Log likelihood = -2389.9793
Pseudo R2
=
0.0637
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------um_x |
2.613621
.3037875
8.27
0.000
2.081159
3.282311
imt_x |
1.967103
.2477358
5.37
0.000
1.536835
2.517833
kd_kota |
.6045189
.0863164
-3.53
0.000
.4569523
.7997403
umXimt |
.9476818
.1396486
-0.36
0.715
.7099554
1.26501
umXkota |
1.299761
.193574
1.76
0.078
.9707189
1.740336
imtXkota |
1.150678
.1708901
0.95
0.345
.8600821
1.539459
-----------------------------------------------------------------------------

Dari ke-3 variabel, dilihat interaksinya, ternyata tidak ada interaksi,


semua nilai-p > 0,05
15

REGRESI LOGISTIK (Non-SRS)


Statistics-->Survey data-->Distribution-specific..-->Logistic regression..

1.Dependent-->hiper_s
2.Independent-->
sex um_x imt_x kota rokok
3.Option:

16

REGRESI LOGISTIK (Non-SRS)


Statistics-->Survey data-->Distribution-specific..-->Logistic regression..

3.Option:
- Odds ratio(s)
4.OK

17

REGRESI LOGISTIK (Non-SRS)


Statistics-->Survey data-->Distribution-specific..-->Logistic regression..
svylogit hiper_s sex um_x imt_x kd_kota rokok, or
Survey logistic regression
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------sex |
.9152686
.0930591
-0.87
0.384
.7497308
1.117356
um_x |
2.810169
.2208519
13.15
0.000
2.408577
3.27872
imt_x |
1.99889
.1649283
8.39
0.000
1.700109
2.35018
kd_kota |
.7658542
.0627721
-3.25
0.001
.652078
.8994822
rokok |
1.022564
.0371156
0.61
0.539
.9522694
1.098048
------------------------------------------------------------------------------

Hasil yang ditampilkan tidak sesuai dengan permintaan, dimana rokok


diperlakukan sebagai data numerik, padahal harusnya kategorik.
Lakukan perubahan pada perintah, menjadi sbb:
xi:svylogit hiper_s sex um_x imt_x kd_kota i.rokok, or
18

REGRESI LOGISTIK (Non-SRS)


Model-1 (Full model)
. xi:svylogit hiper_s sex um_x imt_x kd_kota i.rokok, or
i.rokok
_Irokok_1-4
(naturally coded; _Irokok_1 omitted)
Survey logistic regression
F(
7,
1064) =
34.78
Prob > F
=
0.0000
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------sex |
.8749617
.0936331
-1.25
0.212
.7092436
1.0794
um_x |
2.782501
.2182423
13.05
0.000
2.385595
3.245443
imt_x |
1.993143
.164274
8.37
0.000
1.695521
2.343006
kd_kota |
.7607737
.0623269
-3.34
0.001
.6478004
.893449
_Irokok_2 |
.9442919
.1940589
-0.28
0.780
.6309284
1.413294
_Irokok_3 |
1.520525
.2775413
2.30
0.022
1.062791
2.175401
_Irokok_4 |
1.027775
.1147968
0.25
0.806
.825498
1.279618
------------------------------------------------------------------------------

Variabel sex memiliki nilai-p paling besar (0,212) sehingga dikeluarkan


dari model
19

REGRESI LOGISTIK (Non-SRS)


Model-2 (sex keluar)

. xi:svylogit hiper_s um_x imt_x kd_kota i.rokok, or


i.rokok
_Irokok_1-4
(naturally coded; _Irokok_1 omitted)
Survey logistic regression
PSU:
psu_rev
Number of PSUs
=
1129
Population size =
4635
F(
6,
1065) =
40.63
Prob > F
=
0.0000
-----------------------------------------------------------------------------hiper_s | Odds Ratio
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------um_x |
2.771343
.2162918
13.06
0.000
2.377838
3.229968
imt_x |
2.007456
.1662104
8.42
0.000
1.706435
2.361579
kd_kota |
.7577325
.0619718
-3.39
0.001
.645388
.8896331
_Irokok_2 |
.94851
.1949683
-0.26
0.797
.6336909
1.419732
_Irokok_3 |
1.530898
.2812656
2.32
0.021
1.067533
2.195387
_Irokok_4 |
1.130607
.0962198
1.44
0.149
.9567277
1.336087
------------------------------------------------------------------------------

Variabel rokok memiliki salah satu kelompok yang bermakna (nilaip=0,021), sehingga rokok tetap ada dalam model

20

Anda mungkin juga menyukai