document.write( "Question 1162016: Runner's World reported that a survey by Converse of people who regularly run for exercise resulted in the data shown here. The intent of the survey was to determine if the distances were independent of runners' preference for a gel-like product built into the heels of their jogging shoes. At the 1 percent level, does there appear to be any relationship? State the hypotheses.\r
\n" ); document.write( "\n" ); document.write( "Distance/week (miles): <3, 3-6, 7-10, 10-13, >13
\n" ); document.write( "Prefer Gel: 14, 18, 12, 17, 19
\n" ); document.write( "Do not prefer gel: 5, 5, 8, 12, 8
\n" ); document.write( "No opinion: 27, 17, 8, 5, 2
\n" ); document.write( "

Algebra.Com's Answer #854410 by CPhill(2264)\"\" \"About 
You can put this solution on YOUR website!
```python?code_reference&code_event_index=3
\n" ); document.write( "import numpy as np
\n" ); document.write( "from scipy.stats import chi2_contingency\r
\n" ); document.write( "\n" ); document.write( "# Data table: Rows represent preference, Columns represent distance categories
\n" ); document.write( "# Distances: <3, 3-6, 7-10, 10-13, >13
\n" ); document.write( "observed = np.array([
\n" ); document.write( " [14, 18, 12, 17, 19], # Prefer Gel
\n" ); document.write( " [5, 5, 8, 12, 8], # Do not prefer Gel
\n" ); document.write( " [27, 17, 8, 5, 2] # No opinion
\n" ); document.write( "])\r
\n" ); document.write( "\n" ); document.write( "# Perform Chi-Square Test of Independence
\n" ); document.write( "chi2, p, dof, expected = chi2_contingency(observed)\r
\n" ); document.write( "\n" ); document.write( "print(f\"{chi2=}\")
\n" ); document.write( "print(f\"{p=}\")
\n" ); document.write( "print(f\"{dof=}\")
\n" ); document.write( "print(f\"expected_frequencies:\n{expected}\")\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "```
\n" ); document.write( "```text?code_stdout&code_event_index=3
\n" ); document.write( "chi2=32.86666355621393
\n" ); document.write( "p=6.508978280300026e-05
\n" ); document.write( "dof=8
\n" ); document.write( "expected_frequencies:
\n" ); document.write( "[[20.79096045 18.07909605 12.65536723 15.36723164 13.10734463]
\n" ); document.write( " [ 9.87570621 8.58757062 6.01129944 7.29943503 6.2259887 ]
\n" ); document.write( " [15.33333333 13.33333333 9.33333333 11.33333333 9.66666667]]\r
\n" ); document.write( "\n" ); document.write( "```
\n" ); document.write( "To determine if there is a relationship between weekly running distance and runners' preference for a gel-like product, we perform a **Chi-Square Test of Independence**.\r
\n" ); document.write( "\n" ); document.write( "### 1. State the Hypotheses
\n" ); document.write( "* **Null Hypothesis ($H_0$):** Running distance per week and gel preference are **independent**. (There is no relationship between the two variables).
\n" ); document.write( "* **Alternative Hypothesis ($H_A$):** Running distance per week and gel preference are **dependent**. (There is a significant relationship between the two variables).\r
\n" ); document.write( "\n" ); document.write( "### 2. Contingency Table (Observed Frequencies)
\n" ); document.write( "The data provided is organized into the following $3 \times 5$ table:\r
\n" ); document.write( "\n" ); document.write( "| Preference | <3 mi | 3-6 mi | 7-10 mi | 10-13 mi | >13 mi | **Total** |
\n" ); document.write( "| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
\n" ); document.write( "| **Prefer Gel** | 14 | 18 | 12 | 17 | 19 | **80** |
\n" ); document.write( "| **Do Not Prefer** | 5 | 5 | 8 | 12 | 8 | **38** |
\n" ); document.write( "| **No Opinion** | 27 | 17 | 8 | 5 | 2 | **59** |
\n" ); document.write( "| **Total** | **46** | **40** | **28** | **34** | **29** | **177** |\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### 3. Calculate the Test Statistic
\n" ); document.write( "Using the Chi-Square formula $\chi^2 = \sum \frac{(O - E)^2}{E}$, where $O$ is the observed frequency and $E$ is the expected frequency:\r
\n" ); document.write( "\n" ); document.write( "* **Degrees of Freedom ($df$):** $(rows - 1) \times (cols - 1) = (3 - 1) \times (5 - 1) = \mathbf{8}$
\n" ); document.write( "* **Chi-Square Statistic ($\chi^2$):** $\approx \mathbf{32.87}$
\n" ); document.write( "* **$p$-value:** $\approx \mathbf{0.000065}$\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### 4. Conclusion at the 1% Level
\n" ); document.write( "* **Significance Level ($\alpha$):** 0.01
\n" ); document.write( "* **Decision:** Since the $p$-value ($0.000065$) is significantly **less than** $\alpha = 0.01$, we **reject the null hypothesis**.\r
\n" ); document.write( "\n" ); document.write( "**Final Result:** There **does appear to be a relationship** between the distance run per week and the runners' preference for the gel product. \r
\n" ); document.write( "\n" ); document.write( "**Observation:** Looking at the data, runners who cover longer distances (>13 miles) are far more likely to \"Prefer Gel\" (19) compared to having \"No Opinion\" (2). Conversely, those who run very little (<3 miles) have a much higher rate of \"No Opinion\" (27) compared to a definitive preference. This suggests that as running volume increases, runners develop stronger, more positive opinions about specialized cushioning features.
\n" ); document.write( "
\n" );