1. Interpretasi dan Inferensia regresi logistik · t Z / v K Z ] } M v } ] } ] v ] Z } Á u µ Z u } o ] l o Ç U Á ] Z } } U ] v À v } µ ] v

Post on 18-Mar-2020

20 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

Respon Biner

Regresi Logistik4.1 INTERPRETING THE LOGISTIC REGRESSION MODEL

4.2 INFERENCE FOR LOGISTIC REGRESSION

Model regresi logistik menggunakan peubahpenjelas, baik kategorik atau kontinu, untukmemprediksi peluang dari hasil yang spesifik.

Dengan kata lain, regresi logistik dirancang untukmenggambarkan peluang yang terkait dengan nilai-nilai peubah respon.

• Kurva regresi logistik dan regresi linier

• β>0 maka kurva akan naik• β<0 maka kurva akan turun• Jika β= 0 maka nilai π (x) tetap pada berapapun nilai x kurva akan menjadi garis horisontal

• X Peubah penjelas kuantitatif• Y Peubah respon biner• π(x) peluang sukses peubah X• Model Logit (log odds)

4.1 INTERPRETING THE LOGISTIC REGRESSION MODEL

Interpretasi β• Odds akan meningkat secara multiplikatif sebesar eβ untuk setiap kenaikan 1 unit x• eβ rasio odds

)()1(

xXoddsxXoddsRasioOdds

logit akan meningkat sebesarβ untuk setiap kenaikan 1 cm x

InterpretasialternatifNot familiar

What Is an Odds Ratio?An odds ratio indicates how much more likely, with respect to odds, a certain event occurs in one group relative to its occurrence in another group.Example: How much more likely are females to purchase 100 dollars or more in products compared to males?

4.1.1 Linear Approximation Interpretationsβ→ 0, kurva datar horizontalβ = 0 , Y bebas terhadap XΒ > 0, kurva π(x) membentuk fkp sebaran logistik

Kemiringan curam terjadi pada x yang π (x) = 0,50. Nilai x tersebut berhubungan dengan p arameter regresi logistik dengan x =-α / β. nilai x ini disebut tingkat median efektif (EL50). Ini merupakan tingkat di mana masing-masing Hasil memiliki kesempatan 50%.

4.1.2 Horseshoe Crabs: Viewing and Smoothing a Binary Outcome

The study investigated factors that affect whether the female crab had any othermales, called satellites, residing nearby her. The response outcome for each femalecrab is her number of satellites. An explanatory variable thought possibly to affectthis was the female crab’s shell width, which is a summary of her size. In the sample,this shell width had a mean of 26.3 cm and a standard deviation of 2.1 cm.Y indicate whether a female crab has any satellites (other males who could mate with her). That is, Y = 1 if a female crab has at least one satellite, and Y = 0 if she has no satellite.We first use the female crab’s width (in cm) as the sole predictor.

ilustrasi

• Suatu penelitian mengenai faktor-faktor yang mempengaruhi banyaknya satellite yang dipunyai kepiting betina (Y)• Y= 1 jika kepiting betina memiliki paling tidak 1 satellite

Y=0 jika tidak memiliki satellite. • X= lebar cangkang kepiting betina (dalam cm)

ilustrasi

• Data yang belum dikelompokkan

Syntax SASData crab; input width sat;datalines; 28.3 126.0 125.6 0...24.5 0; proc logistic data=crab descending; model sat=width/expb; run;

Output

At the minimum width in this sample of 21.0 cm, the estimated probability isexp(−12.351 + 0.497(21.0))/[1 + exp(−12.351 + 0.497(21.0))] = 0.129

At the maximum width of 33.5 cm, the estimated probability equalsexp(−12.351 + 0.497(33.5))/[1 + exp(−12.351 + 0.497(33.5))] = 0.987

• lebar minimum x= 21 cm,

= 0.129• lebar maksimum x= 33.5 cm

= 0.987

Interpretasi Output

• Dugaan π(x) =0.5 saat• Dugaan odds = kepiting betina yang memiliki lebar 1 cm lebih besar, memiliki kecenderungan 1.64 kali mempunyai satelit

8.24497.0/351.12ˆ/ˆ x 64.1497.0expˆexp

• Pada mean sampel lebar 26,3 cm, π (x) = 0,674. • (Bab 4.1.1), perubahan kenaikan peluang pada titik mean

• Untuk kepiting betina dengan lebar badan dekat lebar rata-rata, peluang kenaikan satelit pada tingkat 0,11 per 1 cm peningkatan lebar.

• tingkat dugaan perubahan terbesar pada nilai x (24,8) di mana π (x) = 0,50; peluang diperkirakan meningkat pada tingkat (0,497) (0,50) (0,50) = 0,12 per 1 cm peningkatan lebar

0.11 = (0.326) (0.674) 0.497ˆ1ˆˆ xx

Berbeda dengan model peluang linier, model regresi logistikmemungkinkan laju perubahan bervariasi sebagaimana perubahan x

Regression Fit• Model paling sederhana untuk interpretasi adalah model peluang π(x) = α + βx.• Menggunakan pendekatan OLS (software GLM dengan asumsi respon normal dengan fungsi penghubung identitas) menghasilkan model

Proc GLMproc genmod data=crab;

model sat=width/ dist = norlink = identitylrci;

run;

4.1.3 Horseshoe Crabs: Interpreting the Logistic Regression Fit

• π(x) adalah peluang kepiting betina memiliki satelit dengan lebar badan x cm• Dugaan peluang (adanya) satelit akan meningkat 0.092 untuk setiap peningkatan 1 cm lebar badan kepiting• Interpretasi lebih sederhana, namun tidak sesuai untuk nilai ekstrim• Misalkan pada contoh ini lebar badan maksimal 33.5 cm. Dugaan peluangnya= −1.766 + 0.092(33.5) = 1.3.

GroupingUntuk mendapatkan gambar dengan bentuk yang lebih jelas, dilakukan pengelompokan untuk lebar badan kepiting betina sbb:

Lalu hitung rataan contoh di masing-masing kategori

Figure 4.2 contains eight dots representing the sample proportions of female crabs having satellites plotted against the mean widths for the eight categories.

4.1.4 Odds Ratio InterpretationOdds

Odds sukses (respon =1)

However, this is a 64% increase;

07.2674.01674.0;674.0ˆ;3.26 oddsxx

40.37731773.0;773.0ˆ;3.27 oddsxx

64.107.24.3

3.26 3.27 RasioOdds

4.1.5 Logistic Regression with Retrospective Studies

• Regresi logistik juga dapat digunakan pada data hasilstudi restrospektif Peubah X yang acak (bukanpeubah Y)

• Dapat digunakan bila salah satu respon kategorijarang terjadi, dan sebuah studi prospektif mungkinmemiliki terlalu sedikit kasus untuk untuk dapatmenduga pengaruh dari prediktor dengan baik.

Retros pective

Case-control biomedis

Y1(kasus) dan 0(kontrol)X diamati

Odds Ratio

Inferensia Regresi Logistik

4.2 INFERENCE FOR LOGISTIC REGRESSION

• 4.2.1 Binary Data can be Grouped or Ungrouped

254 subjects reported snoring every night, of whom 30 had heart disease

Data crab grupdata crab2;input width y n;cards;22.69 5 1423.84 4 1424.78 17 2825.84 21 3926.79 15 2227.74 20 2428.67 15 1830.41 14 14;proc logistic data=crab2;model y/n=width/influence stb expb;output out=predict p=pi_hat lower=LCL upper=LCL;run;

confidence interval for effectA large-sample Wald confidence interval for the parameter β in the logistic regression model, logit[π(x)] = α + βx, is

SEz 2ˆ

Ilustrasi data kepiting

• Selang kepercayaan 95% untuk β adalah 0.497± 1.96(0.102) = [0.298, 0.697]

• Selang kepercayaan berdasarkan likelihood ratio = (0.308, 0.709).• Interval likelihood ratio untuk pengaruh pada odds setiap kenaikan 1 cm lebar cangkang = (e308, e709)= (1.36, 2.03).• Berarti setiap kenaikan 1 cm lebar cangkang, akan menaikkan odds satellite paling sedikit 1.36 kali dan paling banyak 2 kali

Hypothesis Testing about Effect of X• Test for parameter model (). • Simultanious test G-test• Partial test Wald-test

Uji SimultanStatistik uji-G adalah uji rasio kemungkinan (likelihood ratio test) yang digunakan untuk menguji peranan variabelpenjelas di dalam model secara bersama-sama (Hosmer & Lemeshow, 1989). Rumus umum uji-G untuk mengujihipotesis :H0 : 1 = 2 = … = k = 0H1 : minimal ada satu yang tidak sama dengan 0adalahStatistik G ini, secara teoritis mengikuti sebaran 2 dengan derajat bebas k.

bebaspeubahdenganlikelihoodbebaspeubahpalikelihoodG tanln2

Partial TestSementara itu, uji Wald digunakan untuk menguji parameter i secara parsial. Hipotesis yang diuji adalah:H0 : i = 0H1 : i 0Formula statistik Wald adalah:Secara teori, statistik Z ini mengikuti sebaran normal baku jika H0 benar.Atau menggunakan statistik uji yang mengikuti sebaran dengan db=1

)ˆ(ˆ

ii

SEZ

Uji Hipotesi Data Kepiting• Hipotesis H0 : = 0 vs H1 : 0• Statistik Uji : Z= 0.497/0.102 = 4.9.

(This shows strong evidence of a positive effect of width on the presence of satellites (P <0.0001))• The equivalent chi-squared statistic, z2 = 23.9, has df = 1.• Software reports that the maximized log likelihoods equal L0 =

−112.88 under H0: β = 0 and L1 = −97.23 for the full model. The likelihood-ratio statistic equals −2(L0 − L1) = 31.3, with df = 1.

• This also provides extremely strong evidence of a width effect (P < 0.0001).

Confidence Intervals for Probabilities

• Ilustrasi dengan memperkirakan probabilitas dari satelit untukkepiting betina lebar x = 26,5, yang dekat lebar rata-rata

• Persamaan regresi logistiknya:πˆ = exp(−12.351 + 0.497(26.5))/[1 + exp(−12.351 + 0.497(26.5))] = 0.695

• Output software: selang kepercayaan 95% untuk probability sesungguhnya (0.61, 0.77).

Kenapa menggunakan model untuk menduga peluang??

X=26,5 cm 6 kepiting, 4 memiliki satelit Binom

p= 4/6=0.67

SK 95% untuk π(x) : (0.22, 0.96)

Reality is more complicated. In practice, any model will not exactly represent thetrue relationship between π(x) and x.

Ilustrasi Menggunakan SAS

Data CHD;input age $ CHD @@;cards;<=55 1 <=55 1 >55 1 >55 0 >55 0<=55 1 <=55 0 >55 1 >55 0 >55 0<=55 1 <=55 0 >55 1 >55 0 >55 0<=55 1 <=55 0 >55 1 >55 0 >55 0<=55 1 <=55 0 >55 1 >55 0 >55 0<=55 1 <=55 0 >55 1 >55 0 >55 0<=55 1 <=55 0 >55 1 >55 0 >55 0<=55 1 >55 1 >55 1 >55 0 >55 0<=55 1 >55 1 >55 1 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0<=55 1 >55 1 >55 0 >55 0 >55 0;

proc freq data=CHD;tables age;tables CHD;

tables age*CHD/nopercent nocol norowexpected chisq;run;

proc logistic data=CHD;class age;model chd=age/expb;

run;

Tabulasi Silang

Tugas KelompokKelompok 1• Prediktor Kategorik• Uji Cochran-Mantel Haenszel• Uji Kehomogenan Rasio Odd(Bab 4.3)

Kelompok 2 (RegLog Berganda)• Contoh Regresi Logistik Ganda• Pembandingan Model(4.4.1, 4.4.2)

Tugas Kelompok (lanjutan)Kelompok 3 (RegLog Berganda)• Prediktor Kuantitatif dalam Regresi Logistik• Model dengan Interaksi(Bab 4.4.3, 4.4.4)

Kelompok 4• Strategi Pemilihan Model• Pemeriksaan Kecocokan Model(Bab 5.1, 5.2)

top related