Download presentation
Presentation is loading. Please wait.
Published byCharlotte Ramsey Modified over 9 years ago
1
header= Verdana 28 pt., Red 1 STA 517 – Chapter 3: Inference for Contingency Tables 3. Inference for Contingency Tables 3.1 Confidence Intervals for Association Parameters, 70 confidence intervals for measures of association 3.2 Testing Independence in Two-Way Contingency Tables, 78 chi-squared tests of the hypothesis of independence 3.3 Following-Up Chi-Squared Tests, 80 using residuals or the partitioning property of chi-squared to extract components 3.4 Two-Way Tables with Ordered Classifications, 86 inference applicable with ordered categories. 3.5 Small-Sample Tests of Independence, 91 Fisher’s Exact Test
2
header= Verdana 28 pt., Red 2 STA 517 – Chapter 3: Inference for Contingency Tables 3.1 CONFIDENCE INTERVALS FOR ASSOCIATION PARAMETERS The accuracy of estimators of association parameters is characterized by standard errors of their sampling distributions. Odds Ratios Interval Estimation of Difference of Proportions Interval Estimation of Relative Risk Deriving Standard Errors with the Delta Method*
3
header= Verdana 28 pt., Red 3 STA 517 – Chapter 3: Inference for Contingency Tables 3.1.1 Interval Estimation of Odds Ratios The sample odds ratio equals 0 or if any the amended estimators
4
header= Verdana 28 pt., Red 4 STA 517 – Chapter 3: Inference for Contingency Tables standard error The estimators and have the same asymptotic normal distribution around . Unless n is quite large, however, their distributions are highly skewed. The log transform, having an additive rather than multiplicative structure, converges more rapidly to normality. Wald CI:
5
header= Verdana 28 pt., Red 5 STA 517 – Chapter 3: Inference for Contingency Tables Why distributions are highly skewed? (1)Theoretically derive the skewness of (2)Simulation study: Let’s simulate one case where true =1, n=100, and 11=0.3, 12=0.2, 21=0.3, 22=0.2 Repeat 5,000 simulations to find out the theta hat distribution
6
header= Verdana 28 pt., Red 6 STA 517 – Chapter 3: Inference for Contingency Tables Data simulation; n=100; p11=0.3; p12=0.2; p21=0.3; p22=0.2; do i=1 to 5000; n11=0; n12=0;n21=0;n22=0; do j=1 to n; x=UNIFORM(-1); if x<p11 then n11=n11+1; else if x<(p11+p12) then n12=n12+1; else if x<(p11+p12+p21) then n21=n21+1; else n22=n22+1; end; OR=n11*n22/(n12*n21); r1=n11/(n11+n12); r2=n21/(n21+n22); RR=r1/r2; logOR=log(OR); logRR=log(RR); output; end; keep n11 n12 n21 n22 OR logOR RR logRR; run; /*histogram*/ proc univariate; var OR logOR RR logRR; histogram OR logOR RR logRR; run;
7
header= Verdana 28 pt., Red 7 STA 517 – Chapter 3: Inference for Contingency Tables Simulated data
8
header= Verdana 28 pt., Red 8 STA 517 – Chapter 3: Inference for Contingency Tables OR and log(OR)
9
header= Verdana 28 pt., Red 9 STA 517 – Chapter 3: Inference for Contingency Tables
10
header= Verdana 28 pt., Red 10 STA 517 – Chapter 3: Inference for Contingency Tables
11
header= Verdana 28 pt., Red 11 STA 517 – Chapter 3: Inference for Contingency Tables RR and log(RR)
12
header= Verdana 28 pt., Red 12 STA 517 – Chapter 3: Inference for Contingency Tables
13
header= Verdana 28 pt., Red 13 STA 517 – Chapter 3: Inference for Contingency Tables
14
header= Verdana 28 pt., Red 14 STA 517 – Chapter 3: Inference for Contingency Tables 3.1.2 Aspirin and Myocardial Infarction Example The study randomly assigned 1360 patients who had already suffered a stroke to an aspirin treatment (one low-dose tablet a day) or to a placebo treatment. follow-up 3 years
15
header= Verdana 28 pt., Red 15 STA 517 – Chapter 3: Inference for Contingency Tables OR =1.56 =1.55 95% confidence interval The corresponding interval for is
16
header= Verdana 28 pt., Red 16 STA 517 – Chapter 3: Inference for Contingency Tables Since the confidence interval for contains 1.0, it is plausible that the true odds of death due to myocardial infarction are equal for aspirin and placebo. If there truly is a beneficial effect of aspirin but the odds ratio is not large, it may require a large sample size to show that benefit because of the relatively small number of myocardial infarction cases
17
header= Verdana 28 pt., Red 17 STA 517 – Chapter 3: Inference for Contingency Tables 3.1.3 Interval Estimation of Difference of Proportions The difference of proportions and the relative risk compare conditional distributions of a response variable for two groups. For these measures, we treat the samples as independent binomials. For group i, y i has a binomial distribution with sample size n i and a probability i of a ‘‘success’’ response. and variance Since independence between two groups
18
header= Verdana 28 pt., Red 18 STA 517 – Chapter 3: Inference for Contingency Tables =0.0409 =0.0266 =0.0143 =0.00978 95% CI =(-0.00487, 0.0335)
19
header= Verdana 28 pt., Red 19 STA 517 – Chapter 3: Inference for Contingency Tables 3.1.4 Interval Estimation of Relative Risk The sample relative risk is Like the odds ratio, it converges to normality faster on the log scale. The asymptotic standard error of log r is The Wald interval =0.0409/0.0266=1.54, =0.297 CI or (0.86, 2.75) We infer that the death rate for those taking placebo was between 0.86 and 2.75 times that for those taking aspirin.
20
header= Verdana 28 pt., Red 20 STA 517 – Chapter 3: Inference for Contingency Tables SAS code data table3_1; input treatment $ y n; MI='yes'; count=y; output; /*death due to myocardial */ MI='no '; count=n; output; cards; Placebo 28 656 Aspirin 18 658 ; proc freq data=table3_1; WHERE treatment ='Placebo' OR treatment='Aspirin'; weight Count; tables treatment*MI / chisq relrisk RISKDIFF MEASURES ; title 'Swedish Study on Aspirin Use and Myocardial Infarction'; run;
21
header= Verdana 28 pt., Red 21 STA 517 – Chapter 3: Inference for Contingency Tables
22
header= Verdana 28 pt., Red 22 STA 517 – Chapter 3: Inference for Contingency Tables
23
header= Verdana 28 pt., Red 23 STA 517 – Chapter 3: Inference for Contingency Tables
24
header= Verdana 28 pt., Red 24 STA 517 – Chapter 3: Inference for Contingency Tables OR
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.