Tabel Kontingensi 2x2 (3) - pika...

18
09/10/2014 1 Tabel Kontingensi 2x2 (3) Rasio Odds dan Uji Kebebasan Khi- K d t Kuadrat Rasio ODDS “It occurs as a parameter in the most important type of model for categorical data” Odds Sukses ( ) 1 odds π π = Odds bernilai positif Nilai odss lebih besar dari satu, saat “sukses” lebih dipilih dibandingkan “gagal” dibandingkan “gagal” odds = 4.0, a success is four times as likely as a failure 2

Transcript of Tabel Kontingensi 2x2 (3) - pika...

Page 1: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

1

Tabel Kontingensi 2x2 (3)

Rasio Odds dan Uji Kebebasan Khi-K d tKuadrat

Rasio ODDS“It occurs as a parameter in the most important type of model for categorical data”

Odds Sukses( )1

odds ππ

=−

• Odds bernilai positif• Nilai odss lebih besar dari satu, saat “sukses” lebih dipilih

dibandingkan “gagal”dibandingkan “gagal” • odds = 4.0, a success is four times as likely as a failure

2

Page 2: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

2

Rasio Odds Pada Tabel 2x2

A1 A2

B1 π1 1-π1

B2 π2 1-π2

( )1

111

odds ππ

=−

( )2

221

odds ππ

=−

Rasio Odds

Values of θ farther from 1.0 in a given direction represent stronger association.

3

Properties of OR

• The odds ratio does not change value when the table orientation reverses so that the rowstable orientation reverses so that the rows become the columns and the columns become the rows.

• Thus, it is unnecessary to identify one classification as a response variable in order to estimate θ.

• By contrast, the relative risk requires this, and its value also depends on whether it is applied to the first or to the second outcome category.

4

Page 3: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

3

Both variables are response variables

The odds ratio is also called the cross-product ratio, because it equals the ratio of the products π11π22 and π12π21 of cell probabilities from diagonally opposite cells.

The sample odds ratio equals the ratio of the sample odds in the two rowsThe sample odds ratio equals the ratio of the sample odds in the two rows,

5

Ilustasi: kasus aspirin dan serangan jantung

This also equals thecross-product ratio (189 × 10, 933)/(10,845 ×104).

111

12

189 0.017410845

noddsn

= = =

212

22

104 0.009510933

noddsn

= = =

1

2

0.0174 1.8320.0095

OddsOROdds

θ= = = =

)

The estimated odds were 83% higher for the placebogroup. 6

Page 4: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

4

Inferensia Rasio Odds dan Log Rasio Odds

• Kecuali pada ukuran sampel sangat besar, sebaran percontohan dari OR

(hi hl k d)sangat menceng (highly skewed).

• Karena kemiringan ini, statistika inferensia untuk rasio odds menggunakan alternatif dengan ukuran yang setara - logaritma natural, log (θ). Dengan log (θ)=0.

• Artinya θ =1 setara dengan log (θ) dari 0.

7

• Log(OR) simetrik di sekitar nilai 0.

• Artinya, jika kita menukar posisi baris dan kolom akan

mengubah tandanya. Misal: log(2.0) = 0.7 dan log(0.5) = −0.7,

k d il i i i kili k k t i ikedua nilai ini mewakili kekuatan asosiasi yang sama

• Doubling a log odds ratio corresponds to squaring an odds

ratio.

• Sebaran dari log(θ) tidak terlalu menceng, menyerupai bentuk

loncenglonceng

• Sebaran log (θ) mendekati sebaran normal dengan nilai

tengah log(θ) dan galat baku

8

The SE decreases as the cell counts increase.

Page 5: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

5

Selang Kepercayaan untuk log(θ)( )

2

ˆlog Z SEαθ ±Ilustrasi: data aspirin

• log(1.832) = 0.605

• Galat baku =• SK 95% untuk log (θ)

0.605 ± 1.96(0.123)(0 365 0 846)

9

(0.365, 0.846)• SK 95% untuk θ

[exp(0.365), exp(0.846)] = (e0.365, e0.846) = (1.44, 2.33)• karena θ tidak mengandung 1, kemungkinan

serangan jantung berbeda untuk kedua kelompok.

Kita menduga bahwa odds serangan

jantung setidaknya 44% lebih tinggi j g y gg

pada subjek yang mengkonsumsi

placebo dibandingkan dengan

subjek yang mengkonsumsi aspirin

10

Page 6: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

6

Catatan

• Bila terdapat nilai nij=0, maka perhitungan OR d l hadalah

11

Hubungan antara OR dan RR

Jika p1 dan p2 mendekati nol, maka nilai OR akan sama dgr RR

12

This relationship between the odds ratio and the relative risk is useful.For some data sets direct estimation of the relative risk is not possible,yet one can estimate the odds ratio and use it to approximate therelative risk.

Page 7: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

7

Rasio Odds pada studi case-control• Table 2.4 refers to a study that

investigated the relationship

between smoking and myocardial

infarction.

• The first column refers.

• Each case was matched with two

to 262 young and middle-aged women (age < 69) admitted to 30 coronary care units in northern Italy with acute MI during a 5-year period

control patients admitted to the

same hospitals with other acute

disorders.

• The controls fall in the second 13

with acute MI during a 5 year period

• All subjects were classified according to whether they had ever

been smokers.

• The “yes” group consists of women who were current smokers or

ex-smokers, whereas the “no” group consists of women who never

were smokers.We refer to this variableas smoking status.

• The study, which uses a retrospective design to look into the past, is

called a case–control study.

• Such studies are common in health-related applications, for

instance to ensure a sufficiently large sample ofsubjects having the

disease studied.

14

Page 8: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

8

Tidak bisa menghitung proporsi penderita MI

pada kelompok smoker (atau non-smoker)

Peubah respon

penj

elas

Karena untuk setiap penderita MI kita

pasangkan dengan 2 orang kontrol

Peub

ah

When the sampling design is When the sampling design is retrospective, we can construct

conditional distributions

15

Untuk wanita penderita MI, proporsi yang merupakan perokok sebesalr172/262 = 0.656,

Sedangkan untuk wanita bukan penderita MI, proporsi perokok sebesar 173/519 = 0.333

levels of the fixed response.for the explanatory variable, within levels of the fixed response.

• In Table 2.4, the sample odds ratio is [0.656/(1 − 0.656)]/[0.333/(1 − 0.333)] = (172 × 346)/(173 ×90) = 3.8.

• The estimated odds of ever being a smoker weref gabout 2 for the MI cases (i.e., 0.656/0.344) and about 1/2 for the controls (i.e.,0.333/0.667), yielding an odds ratio of about 2/(1/2) = 4.

• For Table 2.4, we cannot estimate the relative riskof MI or the difference of proportions suffering MIMI.

• Binomial sample column, dependent because 1MI paired with 2 control

16

Page 9: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

9

Types of Observational study

T !!Tugas!!Cari tahu macam2 tipe studi

observasi beserta penjelasan dan contohnya!!

17

Bagaimana mengukur keeratan hubungan 2 peubah??

K l iKorelasi Hubungan linear

Data

18

pearson spearman

Nominal ?

Page 10: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

10

Tahun 1900

19

Pearson chi-squared statisticKarl Pearson

Uji Kebebasan Khi - Kuadrat• Mengukur asosiasi antara dua peubah.• Korelasi Pearson and Spearman tidak dapat• Korelasi Pearson and Spearman tidak dapat

diterapkan pada data degan skala pengukuran nominal

• Khi-kuadrat digunakan untuk data nominal dalam tabel kontingensi

A contingency table is a two-way table showing the contingency between two variables where the variables have been classified into mutually exclusive categories and the cell entries are frequencies.

Page 11: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

11

Statistik Uji (pearson chi-squared & likelihood chi squared)

• Pearson statistic X2 is a score statistic. (This means that X2 is based on a covariance matrix for the counts that is estimated under H0.)

22

• The Pearson X2 and likelihood-ratio G2 provide separate test statistics, but they share many properties and usually provide the same conclusions.

• When H0 is true and the expected frequencies are large, the two statistics have the same chi-squared distribution, and their numerical values are similar.

Page 12: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

12

• The convergence is quicker for X2 than G2.• The chi-squared approximation is often poor

for G2 when some expected frequencies areless than about 5.

23

Party Identification

Menghitung Nilai Harapan

Democrat

Independent Republican

Total

Females 762 327 468 1577

Males 484 293 477 1200

703,7

Males 484 293 477 1200

Total 1246 566 945 2757

1. 1246*1577= 1940022 2. 1940022/2757 = 703,7

Page 13: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

13

25

Ilustrasi: Data smoker-lung cancer

Lung Cancer TotalYes No

Smoker 120 30 150Non Smoker

40 50 90

Total 160 80 240Total 160 80 240

26

Page 14: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

14

HipotesisH0: Tidak ada asosiasi antara kebiasaan merokok

dan penyakit kanker paru-paruH : Ada asosiasi antara kebiasaan merokok danH1: Ada asosiasi antara kebiasaan merokok dan

penyakit kanker paru-paru

Nilai Rasio Odds (120 50) 5(40 30)

xx

θ = =

27

Syntax SASData aspirin;input smoking $ cancer $ frec ;cards;smoker yes 120smoker no 30non_smoker yes 40non_smoker no 50;proc freq data=aspirin order=data;p q ptables smoking*cancer/nopercent nocol norow expected;exact or chisq;weight frec;run;

28

Page 15: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

15

Output

29

30

Page 16: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

16

31

Mengubah posisi tabel kontingensi

32

Page 17: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

17

33

Warning !!

Lebih dari 20% cell dengan nilaiharapan > 5, kita tidak bisa

menggunakan Chi Square test

Dua Solusi:1. Menggabungkan kategori2. Gunakan Exact Fisher test

Page 18: Tabel Kontingensi 2x2 (3) - pika silviantipikasilvianti.staff.ipb.ac.id/.../09/Tabel-Kontingensi-2x2-3-OR-dan... · Tabel Kontingensi 2x2 (3) ... Rasio Odds Pada Tabel 2x2 A1 A2 B1

09/10/2014

18

Menggabungkan Kategori

Daya Listik Penghasilan Total

300 000 1 000 000>300.000-750.000

> 1.000.000-2.000.000

450 & 900 watt 37 11 481300 & 3500 watt 2 10 12Total 39 21 50

35

Uji Pasti Fisher ?

Pertemuan Selanjutnya

36