STATA Regresi Logistik

20
1 Stata: REGRESI LOGISTIK BESRAL Departemen Biostatistik FKM-UI

description

Analisis data regersi dengan stata

Transcript of STATA Regresi Logistik

Page 1: STATA Regresi Logistik

1

Stata:REGRESI LOGISTIK

BESRALDepartemen Biostatistik FKM-UI

Page 2: STATA Regresi Logistik

2

REGRESI LOGISTIK

Regresi Logistik: Model matematis untuk menganalisis hubunganantara satu atau beberapa variabel independentyang bersifat binary atau dikotom maupunkontinu dengan satu variabel dependent yang bersifat binary (sehat/sakit, hidup/mati)

Regresi Logistik: - Sederhana hanya satu variabel independen

- Ganda/multiple lebih dari satu variabelindependen

Page 3: STATA Regresi Logistik

3

REGRESI LOGISTIKPersamaan RegresiLogistik:

).....()(log)(111

11

1kk xbxbaitYY

ExpExpP

+++−−+

=+

=

)()()( bbb elExponensiaExpOR ===

P = Probabilitas OR = Odds Ratio

kbxbaYLogit kx+++= ....)( 11

Page 4: STATA Regresi Logistik

4

REGRESI LOGISTIK

1. Sex (0=P/1=L)

2. Umur (0=<40/1=40+)

3. Rokok (1=Y,2=K, 3=P, 4=T)

4. Desa=0/Kota=1

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

Hipertensi (0=T/1=Y)

Page 5: STATA Regresi Logistik

5

REGRESI LOGISTIKStatistics-->Binary outcomes-->Logistic reg (Reported OR)

Dependen-->hiper_s

Independen:

-->sex

-->um_x

-->rokok

-->kd_kota

-->imt_x

Page 6: STATA Regresi Logistik

6

REGRESI LOGISTIK (Sederhana)

Laki memiliki peluang lebih kecil untuk menderita hipertensi dibandingkan perempuan OR=0,87 nilai-p=0,055

. logistic hiper_s sexLogistic regression Number of obs = 4635

LR chi2(1) = 3.70Prob > 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------------------------------------------------------------------------------

Page 7: STATA Regresi Logistik

7

REGRESI LOGISTIK (Sederhana)

Umur 40 th keatas memiliki peluang 2,8 kali lebih besar untuk menderita hipertensi dibandingkan umur dibawah 40 th (OR=2,8 nilai-p=0,000)

. logistic hiper_s um_xLogistic regression Number of obs = 4635

LR chi2(1) = 220.79Prob > 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-----------------------------------------------------------------------------

Page 8: STATA Regresi Logistik

8

REGRESI LOGISTIK (Sederhana). xi:logistic hiper_s i.rokoki.rokok _Irokok_1-4 (naturally coded; _Irokok_1 omitted)Logistic regression Number of obs = 4635

LR chi2(3) = 10.27Prob > 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)

Page 9: STATA Regresi Logistik

9

REGRESI LOGISTIK (Sederhana)

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

. logistic hiper_s imt_xLogistic regression Number of obs = 4635

LR chi2(1) = 84.58Prob > 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------------------------------------------------------------------------------

Page 10: STATA Regresi Logistik

10

REGRESI LOGISTIK (Sederhana)

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)

. logistic hiper_s kd_kotaLogistic regression Number of obs = 4635

LR chi2(1) = 8.34Prob > 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------------------------------------------------------------------------------

Page 11: STATA Regresi Logistik

11

REGRESI LOGISTIK (Ganda)

Independen Variabel:

1. Sex2. Umur3. Rokok4. IMT5. Kota/Desa

Seleksi variabel

Nilai-p < 0,25

Keluar

Tidak

YaKandidat Model

Nilai-p < 0,25

Modelling:

1.Determinants

2.Risk Factors

Determinants =Faktor-faktor yang secara statistik berhubungan dengan var dependen (hipertensi)

Page 12: STATA Regresi Logistik

12

REGRESI LOGISTIK (Ganda)

. xi:logistic hiper_s sex um_x kd_kota imt_x i.rokoki.rokok _Irokok_1-4 (naturally coded; _Irokok_1 omitted)Logistic regression Number of obs = 4635

LR chi2(7) = 326.75Prob > 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.102888um_x | 2.849128 .2068243 14.42 0.000 2.471277 3.284752

kd_kota | .7576529 .055673 -3.78 0.000 .6560293 .8750188imt_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

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

Model-1 (Full model)

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

Page 13: STATA Regresi Logistik

13

REGRESI LOGISTIK (Ganda)

Model-2 (sex keluar)

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

. xi:logistic hiper_s um_x kd_kota imt_x i.rokoki.rokok _Irokok_1-4 (naturally coded; _Irokok_1 omitted)Logistic regression Number of obs = 4635

LR chi2(6) = 325.79Prob > 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.275373kd_kota | .7549224 .0554008 -3.83 0.000 .6537866 .8717031imt_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

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

Page 14: STATA Regresi Logistik

14

REGRESI LOGISTIK (Ganda)Model-3 (sex & rokok keluar)

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 yangtinggal di Kota memiliki peluang lebih kecil untuk hipertensi (OR=0,75)

. xi:logistic hiper_s um_x kd_kota imt_x Logistic regression Number of obs = 4635

LR chi2(3) = 321.47Prob > 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.273301kd_kota | .758514 .0555725 -3.77 0.000 .657053 .8756424imt_x | 2.023278 .1469938 9.70 0.000 1.754748 2.332902

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

Page 15: STATA Regresi Logistik

15

REGRESI LOGISTIK (Ganda)Model-4 (uji interaksi)

Dari ke-3 variabel, dilihat interaksinya, ternyata tidak ada interaksi, semua nilai-p > 0,05

. logistic hiper_s um_x imt_x kd_kota umXimt umXkota imtXkotaLogistic regression Number of obs = 4635

LR chi2(6) = 325.32Prob > 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.282311imt_x | 1.967103 .2477358 5.37 0.000 1.536835 2.517833

kd_kota | .6045189 .0863164 -3.53 0.000 .4569523 .7997403umXimt | .9476818 .1396486 -0.36 0.715 .7099554 1.26501umXkota | 1.299761 .193574 1.76 0.078 .9707189 1.740336

imtXkota | 1.150678 .1708901 0.95 0.345 .8600821 1.539459-----------------------------------------------------------------------------

Page 16: STATA Regresi Logistik

16

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:

Page 17: STATA Regresi Logistik

17

REGRESI LOGISTIK (Non-SRS)

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

3.Option:- Odds ratio(s)

4.OK

Page 18: STATA Regresi Logistik

18

REGRESI LOGISTIK (Non-SRS)

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

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

svylogit hiper_s sex um_x imt_x kd_kota rokok, orSurvey logistic regression------------------------------------------------------------------------------

hiper_s | Odds Ratio Std. Err. t P>|t| [95% Conf. Interval]-------------+----------------------------------------------------------------

sex | .9152686 .0930591 -0.87 0.384 .7497308 1.117356um_x | 2.810169 .2208519 13.15 0.000 2.408577 3.27872imt_x | 1.99889 .1649283 8.39 0.000 1.700109 2.35018

kd_kota | .7658542 .0627721 -3.25 0.001 .652078 .8994822rokok | 1.022564 .0371156 0.61 0.539 .9522694 1.098048

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

Page 19: STATA Regresi Logistik

19

REGRESI LOGISTIK (Non-SRS)Model-1 (Full model)

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

. xi:svylogit hiper_s sex um_x imt_x kd_kota i.rokok, ori.rokok _Irokok_1-4 (naturally coded; _Irokok_1 omitted)Survey logistic regression

F( 7, 1064) = 34.78Prob > 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.245443imt_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

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

Page 20: STATA Regresi Logistik

20

REGRESI LOGISTIK (Non-SRS)Model-2 (sex keluar)

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

. xi:svylogit hiper_s um_x imt_x kd_kota i.rokok, ori.rokok _Irokok_1-4 (naturally coded; _Irokok_1 omitted)Survey logistic regressionPSU: psu_rev Number of PSUs = 1129

Population size = 4635F( 6, 1065) = 40.63Prob > 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.229968imt_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

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