• Home
  • Swinburne University of Technology
  • Foundations of statistics
  • Analyzing Categorical Data with Chi-Square and Risk Ratios

Analyzing Categorical Data with Chi-Square and Risk Ratios

Crosstab/ chi-square exercise: What do we do when we have 2 categorical variables? 1. Crosstab 2. Chi-square test Open up tutorialsurveycategorical.sav We want to investigate the relationship/association b/t mode of transport and travel time in categories. Analyse> descriptive statistics> crosstabs - Put mode of transport (IV) in columns - Put travel time (DV) in rows - Under cells, ask for column percentages - Under statistics, ask for chi-square .. (always want percentage of IV) Case Processing Summary Cases Valid N Missing Percent N Percent Travel time category * Mode of Transport 51 98.1% 1 1.9% Total N Percent 100.0% 52 Travel time category * Mode of Transport Crosstabulation Mode of Transport Private Travel time category 30 minutes or less Public 13 6 Walking 4 30.0% 14 66.7% 2 28 more than 30 minutes Count Count % within Mode of Transport % within Mode of Transport Count % within Mode of Transport 100.0% 52.0% 12 Total 48.0% 25 70.0% 33.3% 20 100.0% 6 100.0% Total 23 45.1% 54.9% 51 100.0% Ans: It was hypothesized that there is an association b/t travel time and mode of transport In a sample of 51, first yr statistic student, public transport users were more likely than either private transport users or those who walked to take more than 30min to get to Swinburne. While 70% of statistic students who used public transport took more than 30min to get to Swinburne, on 48% of private transport users and 33.3% of those who walk, took more than 30min to get to Swinburne. However, a Chi-square test reveal no significant relationship b/t travel time and mode of transport. X2 (2) = 3.45, p =. 178. There is insufficient evidence to suggest that there is no relationship b/t mode of transport and travel time to university. Chi-Square Tests Pearson Chi-Square Likelihood Ratio 3.520 Linear-by-Linear Association .031 1 .861 N of Valid Cases 51 Value df 3.450ª Asymptotic Significance (2- sided) 2 .178 2 .172 a. 2 cells (33.3%) have expected count less than 5. The minimum expected count is 2.71. Odds and Risk ratio Exercise Open up smoking_Intervention.sav - Looking at the relationship b/t attendance at an intervention program and still smoking - (IV) Intervention Program (Attendance at the program) - (DV) Smoking Status - As we are doing a risk ratio, we put the DV in the colums - And the IV in the rows, and ask for row percentages. o ALWAYS PERCENTAGES OF THE IV. - Also under statistics ask for risks. Case Processing Summary Valid N Percent Cases Missing N Percent Total N Percent Intervention Program attended * Smoking Status Intervention Program attended 218 100.0% 0 0.0% 218 Total Count Yes Count % within Intervention Program attended Count % within Intervention Program attended No % within Intervention 53.7% 46.3% Program attended Risk Estimate 95% Confidence Interval Odds Ratio for Intervention Program attended (Yes / No) For cohort Smoking Status = 686 .526 .894 Still Smoking For cohort Smoking Status = 1.529 1.145 2.042 Stopped Smoking N