290 likes | 303 Views
March 28. Analyses of binary outcomes 2 x 2 tables Relative Risks and Relative Odds (Odds Ratio) Lee 6.1 through 6.5 C & S Chapter 3 (G, I, K, L, M, O). Estimating a Single Proportion. p = proportion in population with characteristic Take random sample of size n
E N D
March 28 • Analyses of binary outcomes • 2 x 2 tables • Relative Risks and Relative Odds (Odds Ratio) • Lee 6.1 through 6.5 • C & S Chapter 3 (G, I, K, L, M, O)
Estimating a Single Proportion • p = proportion in population with characteristic • Take random sample of size n • x = number in sample with characteristic • p = x/n estimate of p • SE(p) = • SE(p) = Assumptions: n is large enough for CLT Then p is normally distributed 95% CI for p: p ± 1.96 SE(p) p – p0 Z = SQRT(p(1-p) (1/n))
Example • p = proportion favoring a certain candidate • n = 625 • x = 300 favor the candidate • p = 300/625 = 0.48 is estimate of p SE(p) = = 0.020 95% CI for p: 0.48 ± 1.96 (0.02) 0.48 ± 0.04 Note: Samplers use n=625 frequently
1-Sample Z-Test: Matched Pair Data Control Positive Control Negative Pos Case Neg Analyses is done on discordant pairs b and c Called McNemar’s chi-square Ho: p = 0.5 where n=b+c and x=b Z = (b/(b+c) – 0.5)/sqrt(.5*.5/(b+c)) Z = (b-c)/sqrt(b+c) c2 = (b-c)2/(b+c)
Example – Vitamin Use/Disease(440 Pairs) Control Vitamin + Control Vitamin - Vit + Case Vit - Ho: p = 0.5 where n=140 and b = 50 c2 = (50-90)2/(50+90) = 11.43 (p=.0007)
Comparing Two Proportions Ho: p1 = p2 Ha: p1 ≠ p2 p1 = x1/ n1 p2 = x2 / n2 p = (x1+x2)/(n1+n2) This is the pooled proportion p2 – p1 Z = p(1-p) (1/n1 + 1/n2) Compare to standard normal distribution Assume n1 and n2 are large enough to use normal approximation
CI: Difference in Proportions 95% CI for difference in proportions:
Example – Asthma and SES Ho: p1 = p2 Ha: p1 ≠ p2 p1 = 30/ 160 = 0.188 p2 = 40/ 140 = 0.286 p = 70/300 = 0.233 This is the pooled proportion 0.286 – 0.188 Z = 0.233(.767) (1/160 + 1/140) c2 = Z2 = 4.03 X1 is number with asthma in high SES group X2 is number with asthma in low SES group = 0.098/0.049 = 2.01
2 by 2 Table Factor Present Factor Absent Sample 1 n1 = a + b Sample 2 n2 = c + d a + c b+ d c2 = ( a + b + c + d ) (ad – bc)2 ( a + c) (b + d) (a + b) (c + d)
2 by 2 Table Have Asthma No Asthma High SES n1 =160 Low SES n2 =140 70 230 c2 = ( 30 + 130 + 40 + 100 ) (3000 – 5200)2 ( 70) (230) (160) (140) = 4.02
Relative Risks and Relative Odds Factor Present Factor Absent Sample 1 n1 = a + b Sample 2 n2 = c + d a + c b + d RR = a/(a+b) c/(c+d) RO = a/b c/d = ad/bc If a+b is approximately equal to b and If c+d is approximately equal to d then RR will be close to RO
RO = 30/130 40/100 RR = 30/160 40/140 = 0.58 = 0.66 Calculation RR and RO Have Asthma No Asthma High SES 160 Low SES 140 70 140 RR Asthma (High v Low SES) RO Asthma (High v Low SES) 34% Lower risk of asthma in high SES compared to low SES
Confidence Interval for Relative Risk • This CI looks a little different from usual form • It is calculated on log scale • Distribution of RR possible values is skewed • Can’t be less than zero • Can be extremely large positive values • Usually transformed back when presented • Calculated automatically by SAS
Confidence Interval for Odds Ratio • Similar to CI for relative risk • Can calculate by hand easily; • SAS calculates automatically
Notes About CI for RR and RO • Confidence intervals are not symmetric around the point estimate • Cannot use RR ± SE notation • Point estimate: 0.66 • 95% CI (0.43 – .99) 0.23 below 0.33 above
RO = 30/40 130/100 RO = 30/130 40/100 = 0.58 = 0.58 Odds Ratio Property Have Asthma No Asthma High SES 160 Low SES 140 70 140 RO Asthma (High v Low SES) RO High SES (Asthma v No Asthma) Same Answer – Not true for RR
Cohort Versus Case Control Study • Cohort (Prospective) • Find a population of low SES persons and a population of high SES persons • For each person determine if he/she has asthma • Case-Control (Retrospective) • Find a group of persons with asthma and a group of persons without asthma. • Determine if person is of low or high SES
What Can Be Estimated • Cohort (Prospective) • Can estimate probability of asthma for both low and high SES groups • Can compute relative risk of asthma (high versus low SES) • Case-Control (Retrospective) • Can not estimate probability of asthma • Can not estimate relative risk of asthma (H versus L SES) • Can estimate relative odds (H versus L SES) • If disease is fairly rare the RO can estimate RR
Cohort Versus Case-Control • Cohort (Prospective) • May not be possible to do • Case-Control (Retrospective) • May be only way to assess risk factors for disease
USING SAS DATA asthma; INFILE DATALINES; INPUT ses asthma count; DATALINES; 1 1 30 1 2 130 2 1 40 2 2 100 ; PROCFREQDATA=asthma; TABLES ses*asthma/CHISQRELRISK; WEIGHT count; RUN; Insert 2 x 2 table. The variable count contains the number in each cell of the table Get c2 value Get RR and RO Very important statement !
Table of ses by asthma ses asthma Frequency| Percent | Row Pct | Col Pct | 1| 2| Total ---------+--------+--------+ 1 | 30 | 130 | 160 | 10.00 | 43.33 | 53.33 | 18.75 | 81.25 | | 42.86 | 56.52 | ---------+--------+--------+ 2 | 40 | 100 | 140 | 13.33 | 33.33 | 46.67 | 28.57 | 71.43 | | 57.14 | 43.48 | ---------+--------+--------+ Total 70 230 300 23.33 76.67 100.00 Ho: p1 = p2 p1 = 30/160 = 0.1875 p2 = 40/140 = 0.2857 Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 4.0262 0.0448 Likelihood Ratio Chi-Square 1 4.0234 0.0449 Continuity Adj. Chi-Square 1 3.4959 0.0615 Mantel-Haenszel Chi-Square 1 4.0128 0.0452
Table of ses by asthma ses asthma Frequency| Percent | Row Pct | Col Pct | 1| 2| Total ---------+--------+--------+ 1 | 30 | 130 | 160 | 10.00 | 43.33 | 53.33 | 18.75 | 81.25 | | 42.86 | 56.52 | ---------+--------+--------+ 2 | 40 | 100 | 140 | 13.33 | 33.33 | 46.67 | 28.57 | 71.43 | | 57.14 | 43.48 | ---------+--------+--------+ Total 70 230 300 23.33 76.67 100.00 Ho: RR =1 or RO = 1 RR = 0.1875/0.2857 = 0.6563 RO = (30/130) / (40/100) = 0.5769 Row1 = High SES Row2 = Low SES Col1 = Have asthma Estimates of the Relative Risk (Row1/Row2) Type of Study Value 95% Confidence Limits ----------------------------------------------------------------- Case-Control (Odds Ratio) 0.5769 0.3361 0.9904 Cohort (Col1 Risk) 0.6563 0.4331 0.9943 Cohort (Col2 Risk) 1.1375 1.0003 1.2935
Adjusting for Other Factors • Other factors must be categorical • Estimated RR and RO are a pooled estimate across all combinations of adjustment variables • Analyses called Mentel-Haenszel c2 PROCFREQDATA=asthma; WEIGHT count; TABLES gender*ses*asthma/CHISQCMH; RUN; Dependent variable Risk factor of interest Adjustment Variable (s)
Adjusting for Other Factors • Perhaps some or all of the SES/ASTHMA relationship is due to sex/gender PROCFREQDATA=asthma; WEIGHT count; TABLES gender*ses*asthma/CHISQCMH; RUN; Dependent variable Risk factor of interest Adjustment Variable (s)
USING SAS DATA asthma; INFILE DATALINES; INPUT gender ses asthma count; DATALINES; 1 1 1 10 1 1 2 70 1 2 1 10 1 2 2 30 2 1 1 20 2 1 2 60 2 2 1 30 2 2 2 70 ; PROCFREQDATA=asthma; TABLES gender*ses*asthma/CHISQCMH; WEIGHT count; 2 x 2 table for men 2 x 2 table for women
Table of ses by asthma ses asthma Frequency| Percent | Row Pct | Col Pct | 1| 2| Total ---------+--------+--------+ 1 | 10 | 70 | 80 | 8.33 | 58.33 | 66.67 | 12.50 | 87.50 | | 50.00 | 70.00 | ---------+--------+--------+ 2 | 10 | 30 | 40 | 8.33 | 25.00 | 33.33 | 25.00 | 75.00 | | 50.00 | 30.00 | ---------+--------+--------+ Total 20 100 120 16.67 83.33 100.00 Estimates of the Relative Risk (Row1/Row2) Type of Study Value 95% Confidence Limits ----------------------------------------------------------------- Case-Control (Odds Ratio) 0.4286 0.1616 1.1366 Cohort (Col1 Risk) 0.5000 0.2269 1.1018 Analysis for men
Table of ses by asthma ses asthma Frequency| Percent | Row Pct | Col Pct | 1| 2| Total ---------+--------+--------+ 1 | 20 | 60 | 80 | 11.11 | 33.33 | 44.44 | 25.00 | 75.00 | | 40.00 | 46.15 | ---------+--------+--------+ 2 | 30 | 70 | 100 | 16.67 | 38.89 | 55.56 | 30.00 | 70.00 | | 60.00 | 53.85 | ---------+--------+--------+ Total 50 130 180 27.78 72.22 100.00 Estimates of the Relative Risk (Row1/Row2) Type of Study Value 95% Confidence Limits ----------------------------------------------------------------- Case-Control (Odds Ratio) 0.7778 0.4010 1.5087 Cohort (Col1 Risk) 0.8333 0.5139 1.3513 Analysis for women
POOLED ANALYSES Estimates of the Common Relative Risk (Row1/Row2) Type of Study Method Value 95% Confidence Limits ------------------------------------------------------------------------- Case-Control Mantel-Haenszel 0.6491 0.3749 1.1241 (Odds Ratio) Logit 0.6443 0.3725 1.1147 Cohort Mantel-Haenszel 0.7222 0.4794 1.0879 (Col1 Risk) Logit 0.7251 0.4801 1.0951 Breslow-Day Test for Homogeneity of the Odds Ratios ------------------------------ Chi-Square 0.9880 DF 1 Pr > ChiSq 0.3202 Pooled Analyses Tests if Odds Ratio is same for men and women
Class Exercise • Among the 668 patients in TOMHS randomized to active treatment 74 experienced a CVD event during the study. Among the 234 patients randomized to placebo 38 had a CVD event. • Compute the RR of CVD, for active versus placebo • Compute the RO of CVD, for active versus placebo • Use SAS to create the 2 x 2 table • Using SAS compute the c2 statistic • Using SAS compute the 95% for the RR and RO above