Question: The table below gives the frequency with which a sample of women drink tea and coffee (Arab, Lenore et al. Gender differences in tea, coffee,
The table below gives the frequency with which a sample of women drink tea and coffee (Arab, Lenore et al. "Gender differences in tea, coffee, and cognitive decline in the elderly: the Cardiovascular Health Study." Journal of Alzheimer's disease : JAD vol. 27,3 (2011): 553-66. doi:10.3233/JAD-2011-110431). Do women drink tea and coffee with the same frequency at the alpha = 0.01 significance level?
| Freq | Tea | Coffee |
|---|---|---|
| < 5 / year | 580 | 1019 |
| 5 - 10 / year | 289 | 169 |
| 1 - 3 / month | 503 | 178 |
| 1 - 4 / week | 618 | 208 |
| > 5 / week | 742 | 1148 |
- Enter the data into an array.
- Calculate the chi-square statistic and p-value
- Write an if statement to determine if the null hypothesis that women drink tea and coffee with the same frequency is rejected or not.
Ex: If the data for men is used,
| Freq | Tea | Coffee |
|---|---|---|
| < 5 / year | 551 | 637 |
| 5 - 10 / year | 244 | 139 |
| 1 - 3 / month | 387 | 152 |
| 1 - 4 / week | 452 | 225 |
| > 5 / week | 443 | 915 |
the output is:
377.6187409281143 1.9030487979418984e-80 The hypothesis that tea and coffee are drunk with the same frequency is rejected.
Template:
# Import the necessary modules
# Construct a contingency table
# Calculate the test statistic and p-value chi2, p, df, ex = # Code for calculating test statistic and p-value print(chi2) print(p)
# Determine if null hypothesis is rejected or not if # Write appropriate if statement print("The hypothesis that tea and coffee are drunk with the same frequency is rejected.") else: print("The hypothesis that tea and coffee are drunk with the same frequency is not rejected.")
Reference:
https://learn.zybooks.com/zybook/Applications_of_Business_Analytics_II_-_61113/chapter/7/section/10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
