Figure 3: Chi Square contingency table for my two categories (20s riders and 30s riders). I used the contingency table to calculate the expected ratio for each cell.
My calculated Chi-Square value was 16.6. I compared this value to the Chi-Square table for 1 degree of freedom and significance level = 0.05. The value obtained from the Chi-Square table for 1 degree of freedom and significance level = 0.05 was 3.84. Since my Chi-Square value 16.6 > 3.84, I rejected the null hypothesis that the proportion of people in their 30s who use CitiBike for commuting is independent of the proportion of people in their 20s who use CitiBike for commuting.
The code cells below show my calculation of the Chi-Square statistic using data from the contingency table.