Download presentation
Presentation is loading. Please wait.
Published byAnnabelle Blankenship Modified over 8 years ago
1
Chapter 10 Categorical Data Analysis
2
Inference for a Single Proportion ( ) Goal: Estimate proportion of individuals in a population with a certain characteristic ( ). This is equivalent to estimating a binomial probability Sample: Take a SRS of n individuals from the population and observe y that have the characteristic. The sample proportion is y/n and has the following sampling properties:
3
Large-Sample Confidence Interval for Take SRS of size n from population where is true (unknown) proportion of successes. –Observe y successes –Set confidence level (1- ) and obtain z /2 from z-table
4
Example - Ginkgo and Azet for AMS Study Goal: Measure effect of Ginkgo and Acetazolamide on occurrence of Acute Mountain Sickness (AMS) in Himalayan Trackers Parameter: = True proportion of all trekkers receiving Ginkgo&Acetaz who would suffer from AMS. Sample Data: n=126 trekkers received G&A, y=18 suffered from AMS
5
Wilson-Agresti-Coull Method For moderate to small sample sizes, large-sample methods may not work well wrt coverage probabilities Simple approach that works well in practice: –Adjust observed number of Successes (y) and sample size (n)
6
Example: Lister’s Tests with Antiseptic Experiments with antiseptic in patients with upper limb amputations (John Lister, circa 1870) n=12 patients received antiseptic y=1 died
7
Sample Size for Margin of Error = E Goal: Estimate within E with 100(1- Confidence Confidence Interval will have width of 2E
8
Significance Test for a Proportion Goal test whether a proportion ( ) equals some null value 0 H 0 : Large-sample test works well when n 0 and n(1- 0 ) 5
9
Ginkgo and Acetaz for AMS Can we claim that the incidence rate of AMS is less than 25% for trekkers receiving G&A? H 0 : =0.25 H a : < 0.25 Strong evidence that incidence rate is below 25% ( < 0.25)
10
Comparing Two Population Proportions Goal: Compare two populations/treatments wrt a nominal (binary) outcome Sampling Design: Independent vs Dependent Samples Methods based on large vs small samples Contingency tables used to summarize data Measures of Association: Absolute Risk, Relative Risk, Odds Ratio
11
Contingency Tables Tables representing all combinations of levels of explanatory and response variables Numbers in table represent Counts of the number of cases in each cell Row and column totals are called Marginal counts
12
2x2 Tables - Notation n1+n2n1+n2 (n 1 +n 2 )- (y 1 +y 2 ) y1+y2y1+y2 Outcome Total n2n2 n2-y2n2-y2 y2y2 Group 2 n1n1 n1-y1n1-y1 y1y1 Group 1 Group Total Outcome Absent Outcome Present
13
Example - Firm Type/Product Quality 17213438 Outcome Total 84795 Vertically Integrated 885533 Not Integrated Group Total Low Quality High Quality Groups: Not Integrated (Weave only) vs Vertically integrated (Spin and Weave) Cotton Textile Producers Outcomes: High Quality (High Count) vs Low Quality (Count) Source: Temin (1988)
14
Notation Proportion in Population 1 with the characteristic of interest: 1 Sample size from Population 1: n 1 Number of individuals in Sample 1 with the characteristic of interest: y 1 Sample proportion from Sample 1 with the characteristic of interest: Similar notation for Population/Sample 2
15
Example - Cotton Textile Producers 1 - True proportion of all Non-integretated firms that would produce High quality 2 - True proportion of all vertically integretated firms that would produce High quality
16
Notation (Continued) Parameter of Primary Interest: 1 - 2, the difference in the 2 population proportions with the characteristic (2 other measures given below) Estimator: Standard Error (and its estimate): Pooled Estimated Standard Error when :
17
Cotton Textile Producers (Continued) Parameter of Primary Interest: , the difference in the 2 population proportions that produce High quality output Estimator: Standard Error (and its estimate): Pooled Estimated Standard Error when :
18
Significance Tests for Deciding whether can be done by interpreting “plausible values” of from the confidence interval: –If entire interval is positive, conclude ( > 0) –If entire interval is negative, conclude ( < 0) –If interval contains 0, do not conclude that Alternatively, we can conduct a significance test: –H 0 : H a : (2-sided) H a : (1-sided) –Test Statistic: –RR: |z obs | z /2 (2-sided) z obs z (1-sided) –P-value: 2P(Z |z obs |) (2-sided) P(Z z obs ) (1-sided)
19
Example - Cotton Textile Production Again, there is strong evidence that non-integrated performs are more likely to produce high quality output than integrated firms
20
Fisher’s Exact Test Method of testing for testing whether 2 = 1 when one or both of the group sample sizes is small Measures (conditional on the group sizes and number of cases with and without the characteristic) the chances we would see differences of this magnitude or larger in the sample proportions, if there were no differences in the populations
21
Example – Echinacea Purpurea for Colds Healthy adults randomized to receive EP (n 1 =24) or placebo (n 2 =22, two were dropped) Among EP subjects, 14 of 24 developed cold after exposure to RV-39 (58%) Among Placebo subjects, 18 of 22 developed cold after exposure to RV-39 (82%) Out of a total of 46 subjects, 32 developed cold Out of a total of 46 subjects, 24 received EP Source: Sperber, et al (2004)
22
Example – Echinacea Purpurea for Colds Conditional on 32 people developing colds and 24 receiving EP and 22 receiving placebo, the following table gives the outcomes that would have been as strong or stronger evidence that EP reduced risk of developing cold (1- sided test). P-value from SPSS is.079 (next slide).
23
Example - SPSS Output
24
McNemar’s Test for Paired Samples Common subjects (or matched pairs) being observed under 2 conditions (2 treatments, before/after, 2 diagnostic tests) in a crossover setting Two possible outcomes (Presence/Absence of Characteristic) on each measurement Four possibilities for each subject/pair wrt outcome: –Present in both conditions –Absent in both conditions –Present in Condition 1, Absent in Condition 2 –Absent in Condition 1, Present in Condition 2
25
McNemar’s Test for Paired Samples
26
Data: n 12 = # of pairs where the characteristic is present in condition 1 and not 2 and n 21 # where present in 2 and not 1 H 0 : Probability the outcome is Present is same for the 2 conditions ( 1 = 2 ) H A : Probabilities differ for the 2 conditions ( 1 ≠ 2 )
27
Example - Reporting of Silicone Breast Implant Leakage in Revision Surgery Subjects - 165 women having revision surgery involving silicone gel breast implants Conditions (Each being observed on all women) –Self Report of Presence/Absence of Rupture/Leak –Surgical Record of Presence/Absence of Rupture/Leak Source: Brown and Pennello (2002), “Replacement Surgery and Silicone Gel Breast Implant Rupture”, Journal of Women’s Health & Gender-Based Medicine, Vol. 11, pp 255-264
28
Example - Reporting of Silicone Breast Implant Leakage in Revision Surgery H 0 : Tendency to report ruptures/leaks is the same for self reports and surgical records H A : Tendencies differ
29
Multinomial Experiment / Distribution Extension of Binomial Distribution to experiments where each trial can end in exactly one of k categories n independent trials Probability a trial results in category i is i n i is the number of trials resulting in category I 1 +…+ k = 1 n 1 +…+n k = n
30
Multinomial Distribution / Test for Cell Probabilities
31
Goodness of Fit Test for a Probability Distribution Data are collected and wish to be determined whether it comes from a particular probability distribution (e.g. Poisson, Normal, Gamma) Estimate any unknown model parameters (p estimates) Break down the range of data values into k > p intervals (typically where ≥ 80% have expected counts ≥ 5) obtain observed (n) and expected (E) values for each interval
32
Associations Between Categorical Variables Case where both explanatory (independent) variable and response (dependent) variable are qualitative Association: The distributions of responses differ among the levels of the explanatory variable (e.g. Party affiliation by gender)
33
Contingency Tables Cross-tabulations of frequency counts where the rows (typically) represent the levels of the explanatory variable and the columns represent the levels of the response variable. Numbers within the table represent the numbers of individuals falling in the corresponding combination of levels of the two variables Row and column totals are called the marginal distributions for the two variables
34
Example - Cyclones Near Antarctica Period of Study: September,1973-May,1975 Explanatory Variable: Region (40-49,50-59,60-79) (Degrees South Latitude) Response: Season (Aut(4),Wtr(5),Spr(4),Sum(8)) (Number of months in parentheses) Units: Cyclones in the study area Treating the observed cyclones as a “random sample” of all cyclones that could have occurred Source: Howarth(1983), “An Analysis of the Variability of Cyclones around Antarctica and Their Relation to Sea-Ice Extent”, Annals of the Association of American Geographers, Vol.73,pp519-537
35
Example - Cyclones Near Antarctica For each region (row) we can compute the percentage of storms occuring during each season, the conditional distribution. Of the 1517 cyclones in the 40-49 band, 370 occurred in Autumn, a proportion of 370/1517=.244, or 24.4% as a percentage.
36
Example - Cyclones Near Antarctica Graphical Conditional Distributions for Regions
37
Guidelines for Contingency Tables Compute percentages for the response (column) variable within the categories of the explanatory (row) variable. Note that in journal articles, rows and columns may be interchanged. Divide the cell totals by the row (explanatory category) total and multiply by 100 to obtain a percent, the row percents will add to 100 Give title and clearly define variables and categories. Include row (explanatory) total sample sizes
38
Independence & Dependence Statistically Independent: Population conditional distributions of one variable are the same across all levels of the other variable Statistically Dependent: Conditional Distributions are not all equal When testing, researchers typically wish to demonstrate dependence (alternative hypothesis), and wish to refute independence (null hypothesis)
39
Pearson’s Chi-Square Test Can be used for nominal or ordinal explanatory and response variables Variables can have any number of distinct levels Tests whether the distribution of the response variable is the same for each level of the explanatory variable (H 0 : No association between the variables r = # of levels of explanatory variable c = # of levels of response variable
40
Pearson’s Chi-Square Test Intuition behind test statistic –Obtain marginal distribution of outcomes for the response variable –Apply this common distribution to all levels of the explanatory variable, by multiplying each proportion by the corresponding sample size –Measure the difference between actual cell counts and the expected cell counts in the previous step
41
Pearson’s Chi-Square Test Notation to obtain test statistic –Rows represent explanatory variable (r levels) –Cols represent response variable (c levels) n.. n.c …n.2 n.1 Total n r. n rc …n r2 n r1 r ……………… n 2. n 2c …n 22 n 21 2 n 1. n 1c …n 12 n 11 1 Totalc…21
42
Pearson’s Chi-Square Test Observed frequency (n ij ): The number of individuals falling in a particular cell Expected frequency (E ij ): The number we would expect in that cell, given the sample sizes observed in study and the assumption of independence. –Computed by multiplying the row total and the column total, and dividing by the overall sample size. –Applies the overall marginal probability of the response category to the sample size of explanatory category
43
Pearson’s Chi-Square Test Large-sample test (at least 80% of E ij > 5) H 0 : Variables are statistically independent (No association between variables) H a : Variables are statistically dependent (Association exists between variables) Test Statistic: P-value: Area above in the chi-squared distribution with (r-1)(c-1) degrees of freedom. (Critical values in Table 8)
44
Example - Cyclones Near Antarctica Note that overall: (1876/9165)100%=20.5% of all cyclones occurred in Autumn. If we apply that percentage to the 1517 that occurred in the 40-49S band, we would expect (0.205)(1517)=310.5 to have occurred in the first cell of the table. The full table of E ij : Observed Cell Counts (n ij ):
45
Example - Cyclones Near Antarctica Computation of
46
Example - Cyclones Near Antarctica H 0 : Seasonal distribution of cyclone occurences is independent of latitude band H a : Seasonal occurences of cyclone occurences differ among latitude bands Test Statistic: RR: obs 2 .05,6 2 = 12.59 P-value: Area in chi-squared distribution with (3- 1)(4-1)=6 degrees of freedom above 71.2 From Table 8, P( 2 22.46)=.001 P<.001
47
Likelihood Ratio Statistic Note: The formula on page 512 of textbook is incorrect
48
SPSS Output - Cyclone Example P-value
49
Misuses of chi-squared Test Expected frequencies too small (at least 80% of expected counts should be above 5, not necessary for the observed counts) Dependent samples (the same individuals are in each row, see McNemar’s test) Can be used for nominal or ordinal variables, but more powerful methods exist for when both variables are ordinal and a directional association is hypothesized
50
Ordinal Explanatory and Response Variables Pearson’s Chi-square test can be used to test associations among ordinal variables, but more powerful methods exist When theories exist that the association is directional (positive or negative), measures exist to describe and test for these specific alternatives from independence: –Gamma –Kendall’s b
51
Concordant and Discordant Pairs Concordant Pairs - Pairs of individuals where one individual scores “higher” on both ordered variables than the other individual Discordant Pairs - Pairs of individuals where one individual scores “higher” on one ordered variable and the other individual scores “higher” on the other C = # Concordant Pairs D = # Discordant Pairs –Under Positive association, expect C > D –Under Negative association, expect C < D –Under No association, expect C D
52
Example - Alcohol Use and Sick Days Alcohol Risk (Without Risk, Hardly any Risk, Some to Considerable Risk) Sick Days (0, 1-6, 7) Concordant Pairs - Pairs of respondents where one scores higher on both alcohol risk and sick days than the other Discordant Pairs - Pairs of respondents where one scores higher on alcohol risk and the other scores higher on sick days Source: Hermansson, et al (2003)
53
Example - Alcohol Use and Sick Days Concordant Pairs: Each individual in a given cell is concordant with each individual in cells “Southeast” of theirs Discordant Pairs: Each individual in a given cell is discordant with each individual in cells “Southwest” of theirs
54
Example - Alcohol Use and Sick Days
55
Measures of Association Goodman and Kruskal’s Gamma: Kendall’s b : When there’s no association between the ordinal variables, the population based values of these measures are 0. Statistical software packages provide these tests.
56
Example - Alcohol Use and Sick Days
57
Measures of Association Absolute Risk (AR): Relative Risk (RR): Odds Ratio (OR): o 1 / o 2 (o = /(1- )) Note that if (No association between outcome and grouping variables): –AR=0 –RR=1 –OR=1
58
Relative Risk Ratio of the probability that the outcome characteristic is present for one group, relative to the other Sample proportions with characteristic from groups 1 and 2:
59
Relative Risk Estimated Relative Risk: 95% Confidence Interval for Population Relative Risk:
60
Relative Risk Interpretation –Conclude that the probability that the outcome is present is higher (in the population) for group 1 if the entire interval is above 1 –Conclude that the probability that the outcome is present is lower (in the population) for group 1 if the entire interval is below 1 –Do not conclude that the probability of the outcome differs for the two groups if the interval contains 1
61
Example - Concussions in NCAA Athletes Units: Game exposures among college socer players 1997-1999 Outcome: Presence/Absence of a Concussion Group Variable: Gender (Female vs Male) Contingency Table of case outcomes: Source: Covassin, et al (2003)
62
Example - Concussions in NCAA Athletes There is strong evidence that females have a higher risk of concussion
63
Odds Ratio Odds of an event is the probability it occurs divided by the probability it does not occur Odds ratio is the odds of the event for group 1 divided by the odds of the event for group 2 Sample odds of the outcome for each group:
64
Odds Ratio Estimated Odds Ratio: 95% Confidence Interval for Population Odds Ratio
65
Odds Ratio Interpretation –Conclude that the probability that the outcome is present is higher (in the population) for group 1 if the entire interval is above 1 –Conclude that the probability that the outcome is present is lower (in the population) for group 1 if the entire interval is below 1 –Do not conclude that the probability of the outcome differs for the two groups if the interval contains 1
66
Osteoarthritis in Former Soccer Players Units: 68 Former British professional football players and 136 age/sex matched controls Outcome: Presence/Absence of Osteoathritis (OA) Data: Of n 1 = 68 former professionals, y 1 =9 had OA, n 1 -y 1 =59 did not Of n 2 = 136 controls, y 2 =2 had OA, n 2 -y 2 =134 did not Source: Shepard, et al (2003) Interval > 1
67
Mantel-Haenszel Test / CI for Multiple Tables Data collected from q studies or strata in 2x2 contingency tables with common groupings/outcomes Each table has 4 cells: n h11, n h12, n h21, n h21 h=1,…,q They can be combined for an overall Chi-square statistic or odds ratio and confidence Interval
68
Mantel-Haenszel Computations
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.