40
Asosiasi 2 peubah X Y Sering dibahas X Y Z

2.2 Tabel Kontingensi 3 arah - stat.ipb.ac.id PKS/5_1 tabel... · w/ ô ì õ l^ ] v p î ì ì ô î î ^ ^ k µ µ 7kh )5(4 3urfhgxuh 6xppdu\ 6wdwlvwlfv iru 7uhdwphqw e\ 5hvsrqvh

  • Upload
    others

  • View
    44

  • Download
    1

Embed Size (px)

Citation preview

Asosiasi 2 peubahX YSering dibahas

X Y Z

Confounding• In statistics, a confounding variable (also confounding factor, a

confound, or confounder) is an extraneous variable in a statisticalmodel that correlates (directly or inversely) with both thedependent variable and the independent variable.

• Confounding variables are variables that the researcher fail tocontrol, or eliminate, damaging the internal validity of anexperiment.

Confounding: Contoh

Tabel Kontingensi 3 arah

Usia

Tingkat PrestasiJenis Kelamin

Analisis Rumit??

Analisis dengan tabel yang lebih sederhana:1. Tabel Parsial ( Partial Table) : tabel yang lebih sederhana yang diperoleh dengan hanya melihat pada salah satu kategori peubah lain2. Tabel Marginal (Marginal Table) : adalah tabel yang lebih sederhana yang diperoleh tanpa melihat kategori peubah lain (kategori peubah lain digabungkan).

Tabel Parsial

Tabel Parsial (lanjutan)• Pengujian hipotesis tentang ada/tidaknya hubungan antar variabel kategorik dapat dilakukan pada tabel parsial seperti dengan uji chi-square. • Ukuran asosiasi pada tabel parsial disebut dengan conditional association. Ukuran asosiasi disini bisa seperti odds ratio, relative risk atau koefisien gamma

Tabel Marginal

Tabel Marginal (lanjutan)• Pengujian hipotesis tentang ada/tidaknya hubungan antar variabel kategorik dapat dilakukan pada tabel marginal seperti dengan uji chi-square. Ukuran asosiasi pada tabel parsial disebut dengan marginal association. Ukuran asosiasi disini bisa seperti odds ratio, relative risk atau koefisien gamma.

• Uji Breslow-Day digunakan untuk menguji ada/tidaknya terdapat hubungan yang homogen antar 3 variabel pada tabel 3 arah dengan hopotesis awal adanya asosiasi homogen. • UjiCochran–Mantel–Haenszel (CMH) untuk menguji ada/tidaknya conditional associatian pada tabel 3 arah dengan hipotesis awal semua conditional odds ratios bernilai 1.

EPI 809/Spring 2008 14

Ilustrasi

• The data set Migraine contains hypothetical data for a clinical trial of migraine treatment. Subjects of both genders receive either a new drug therapy or a placebo. Assess the effect of new drug adjusting for gender.• SAS manual

EPI 809/Spring 2008 15

Example - MigraineResponse

Treatment Better Same TotalActive 28 27 55

Placebo 12 39 51Total 40 66 106

Pearson Chi-squares test p = 0.0037But after stratify by sex, it will be different for male vs female.

EPI 809/Spring 2008 16

Example – Migraine Male ResponseTreatment Better Same TotalActive 12 16 28 p = 0.2205Placebo 7 19 26

Total 19 35 54

Female ResponseTreatment Better Same TotalActive 16 11 27 p = 0.0039Placebo 5 20 25

Total 21 31 52

Breslow Day-Test

uji ini digunakan untuk menguji ada tidaknya 3-way interaction/association (interaksi/asosiasi 3 arah)H0: Terdapat asosiasi homogen (tidak ada 3-way interaction/association)vsH1: Tidak terdapat asosiasi homogen (ada 3-way interaction/association)H0 ditolak jika nilai p-value kurang dari taraf signifikansi yang digunakan (p-value<alpha). Tolak H0 berarti ada 3-way interaction. Jika H0 tidak ditolak berarti terjadi homogeneous association dan conditional association antar setiap 2 variabel adalah sama pada setiap level variabel ketiga (terdapat homogeneous associations dalam data). Akan tetapi uji ini hanya bisa digunakan pada tabel 2x2xK.

HipotesisH0: ORM=ORF Sebaran antara grup perlakuan dan respon yang dihasilkan sama (tidak berbeda ) pada jenis kelamin yang berbedaVS H1: ORM≠ ORFAda asosiasi keseluruhan antara grup perlakuan danrespon yang dihasilkan di kelompok jenis kelamin yang berbeda

Statistik Uji r

k MHkMHkkBD nVar

nEn1 11

211112

)ˆ;()ˆ;(

Under H0, Breslow-Day test statistics has a chi-squared distribution with degrees of freedom r-1.

Tolak H0, jika 21

2 rBD

EPI 809/Spring 2008 21

SAS- codesdata Migraine;input Gender $ Treatment $ Response $ Count @@;datalines;female Active Better 16 female Active Same 11female Placebo Better 5 female Placebo Same 20male Active Better 12 male Active Same 16male Placebo Better 7 male Placebo Same 19;

proc freq data=Migraine;weight Count;tables Gender*Treatment*Response / cmh noprint;title1 'Clinical Trial for Treatment of Migraine Headaches';run;************* In SAS, Need to put Exposure BEFORE Disease to generate right results for CMH results;

EPI 809/Spring 2008 22

SAS OutputThe FREQ Procedure

Summary Statistics for Treatment by ResponseControlling for GenderCochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic Alternative Hypothesis DF Value Probƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ1 Nonzero Correlation 1 8.3052 0.00402 Row Mean Scores Differ 1 8.3052 0.00403 General Association 1 8.3052 0.0040Estimates of the Common Relative Risk (Row1/Row2)

Type of Study Method Value 95% Confidence LimitsƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒCase-Control Mantel-Haenszel 3.3132 1.4456 7.5934(Odds Ratio) Logit 3.2941 1.4182 7.6515Cohort Mantel-Haenszel 2.1636 1.2336 3.7948(Col1 Risk) Logit 2.1059 1.1951 3.7108Cohort Mantel-Haenszel 0.6420 0.4705 0.8761(Col2 Risk) Logit 0.6613 0.4852 0.9013

Breslow-Day Test forHomogeneity of the Odds RatiosƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒChi-Square 1.4929DF 1Pr > ChiSq 0.2218Total Sample Size = 106

The large p-value for the Breslow-Day test (0.2218) indicates no significant gender difference in the odds ratios.tidak tolak hipotesis nol dan simpulkan terdapat asosiasi homogen atau tidak terdapat interaksi 3 variabel pada tabel 3 arah diatas.

However, for the Breslow-Day test to be valid, the sample size should be relatively large in each stratum, and at least 80% of the expected cell counts should be greater than 5.

Setelah di lakukan uji Breslow-Day dan ternyata terima hipotesis awal yang menunjukan adanya asosiasi homogen, maka bisa dilakukan uji Cochran–Mantel–Haenszel (CMH) testuntuk menguji ada/tidaknya conditional association dalam three-way tables (apakah terjadi two-way interaction).Hipotesis nol dari CMH test adalah semua conditional odds ratios bernilai 1. Jika H0 ditolak, berarti minimal ada satu conditional odds ratio ≠ 1 dan terjadi partial/conditional association dalam data.

The Cochran–Mantel–Haenszel Test

2 × 2 × K Contingency Tables

Digunakan ketika efek dari peubah penjelas terhadap peubah respon dipengaruhi oleh kovariat yang dapat dikendalikan.

untuk menguji ada/tidaknya conditional association dalam three-way tables (apakah terjadi two-way interaction)

Cochran- Mantel-Haenszel Test• Cochran- Mantel-Haenszel test is to test whether the common conditional (adjusted) odds ratio of y and x equals to one, i.e. • Of course, one can use the confidence interval of to test this null hypothesis. The problem with using confidence interval for hypothesis testing is the failure of obtaining p-value.

1:0 H

Cochran- Mantel-Haenszel Test• The idea of CMH test is similar to that of Breslow-Day test: under the null hypothesis, • is close to its mean for each k. As a result, the total is also close to its mean, r

kknE

111 )1;(

r

kkn

111

11kn )1;( 11knE

Cochran- Mantel-Haenszel Test• Cochran- Mantel-Haenszel test statistics takes the form:

• Under the null hypothesis, Cochran- Mantel-Haenszel test statistics has a chi-squared distribution with degrees of freedom 1.

)1;(

)1;(

111

1 1211112

kr

k

r

k

r

kkk

CMHnVar

nEn

HipotesisH0: ORM=ORF =1Tidak ada interaksiVS H1: Ada minimal 1 OR≠1, dan terjadi partial/conditional association

CMH Statistic 1: Nonzero Correlation• Tests the null hypothesis of no association vs. the alternative hypothesis that there is a linear association between the row and column variables in at least one stratum• Both row and column variables have to be ordinal• Under H0, ~ χ2 with 1 dfCMH Statistic 2: Row Mean Scores Differ• Tests the null hypothesis of no association vs. the alternative hypothesis that the mean scores of the table rows are unequal for at least one stratum• Useful only when the column variable is ordinal• Under H0, ~ χ2 with (r – 1) dfCMH Statistic 3: General Association• Tests the null hypothesis of no association vs. the alternative hypothesis that there is some kind of association between the row and column variables for at least one stratum• Does not require the row or column variable to be ordinal• Under H0, ~ χ2 with (r – 1)(c – 1) df

EPI 809/Spring 2008 33

SAS OutputThe FREQ Procedure

Summary Statistics for Treatment by ResponseControlling for GenderCochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic Alternative Hypothesis DF Value Probƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ1 Nonzero Correlation 1 8.3052 0.00402 Row Mean Scores Differ 1 8.3052 0.00403 General Association 1 8.3052 0.0040Estimates of the Common Relative Risk (Row1/Row2)

Type of Study Method Value 95% Confidence LimitsƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒCase-Control Mantel-Haenszel 3.3132 1.4456 7.5934(Odds Ratio) Logit 3.2941 1.4182 7.6515Cohort Mantel-Haenszel 2.1636 1.2336 3.7948(Col1 Risk) Logit 2.1059 1.1951 3.7108Cohort Mantel-Haenszel 0.6420 0.4705 0.8761(Col2 Risk) Logit 0.6613 0.4852 0.9013

Breslow-Day Test forHomogeneity of the Odds RatiosƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒChi-Square 1.4929DF 1Pr > ChiSq 0.2218Total Sample Size = 106

Kesimpulan • Tolak H0, Ada minimal 1 OR≠1, dan terjadi partial/conditional association

Ilustrasi

Breslow Day Test

CMH-Test

data acc;input location $ injury $ fatal $ Count;cards;Victim's_home suicide yes 45Victim's_home suicide no 20Victim's_home accident yes 15Victim's_home accident no 29Friend's_home suicide yes 13Friend's_home suicide no 12Friend's_home accident yes 14Friend's_home accident no 27other suicide yes 18other suicide no 11other accident yes 11other accident no 29;proc freq data=acc;weight Count;tables location*injury*fatal / cmh noprint;run;