document.write( "Question 1163238: Consider the following hypotheses: \r
\n" );
document.write( "\n" );
document.write( " H0: p ≥ 0.47
\n" );
document.write( " HA: p < 0.47 \r
\n" );
document.write( "\n" );
document.write( "Compute the p-value based on the following sample information. (You may find it useful to reference the appropriate table: z table or t table) (Round \"z\" value to 2 decimal places. Round intermediate calculations to at least 4 decimal places and final answers to 4 decimal places.)
\n" );
document.write( "
\n" );
document.write( " p value
\n" );
document.write( "a. x = 46; n = 118 _______ \n" );
document.write( "
Algebra.Com's Answer #854389 by CPhill(2264) You can put this solution on YOUR website! ```python?code_reference&code_event_index=2 \n" ); document.write( "import math \n" ); document.write( "from scipy.stats import norm\r \n" ); document.write( "\n" ); document.write( "p0 = 0.47 \n" ); document.write( "x = 46 \n" ); document.write( "n = 118\r \n" ); document.write( "\n" ); document.write( "# 1. Calculate sample proportion \n" ); document.write( "p_hat = x / n\r \n" ); document.write( "\n" ); document.write( "# 2. Calculate standard error \n" ); document.write( "se = math.sqrt(p0 * (1 - p0) / n)\r \n" ); document.write( "\n" ); document.write( "# 3. Calculate z-score \n" ); document.write( "z = (p_hat - p0) / se\r \n" ); document.write( "\n" ); document.write( "# Round z to 2 decimal places \n" ); document.write( "z_rounded = round(z, 2)\r \n" ); document.write( "\n" ); document.write( "# 4. Calculate p-value for a lower-tailed test \n" ); document.write( "# Using rounded z as per instructions \"Round 'z' value to 2 decimal places.\" \n" ); document.write( "p_value = norm.cdf(z_rounded)\r \n" ); document.write( "\n" ); document.write( "print(f\"{p_hat=}\") \n" ); document.write( "print(f\"{se=}\") \n" ); document.write( "print(f\"{z=}\") \n" ); document.write( "print(f\"{z_rounded=}\") \n" ); document.write( "print(f\"{p_value=}\")\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "``` \n" ); document.write( "```text?code_stdout&code_event_index=2 \n" ); document.write( "p_hat=0.3898305084745763 \n" ); document.write( "se=0.04594580447823873 \n" ); document.write( "z=-1.7448707762510565 \n" ); document.write( "z_rounded=-1.74 \n" ); document.write( "p_value=0.040929508978807365\r \n" ); document.write( "\n" ); document.write( "``` \n" ); document.write( "To compute the p-value for the given hypothesis test, we follow these steps:\r \n" ); document.write( "\n" ); document.write( "### 1. State the Hypotheses \n" ); document.write( "* **Null Hypothesis ($H_0$):** $p \geq 0.47$ \n" ); document.write( "* **Alternative Hypothesis ($H_A$):** $p < 0.47$ (This is a lower-tailed test)\r \n" ); document.write( "\n" ); document.write( "### 2. Identify Sample Information \n" ); document.write( "* Sample size ($n$) = $118$ \n" ); document.write( "* Number of successes ($x$) = $46$ \n" ); document.write( "* Hypothesized proportion ($p_0$) = $0.47$\r \n" ); document.write( "\n" ); document.write( "### 3. Calculate the Sample Proportion ($\hat{p}$) \n" ); document.write( "$$\hat{p} = \frac{x}{n} = \frac{46}{118} \approx 0.389831$$\r \n" ); document.write( "\n" ); document.write( "### 4. Calculate the Standard Error ($SE$) \n" ); document.write( "The standard error is calculated using the hypothesized proportion $p_0$: \n" ); document.write( "$$SE = \sqrt{\frac{p_0(1 - p_0)}{n}} = \sqrt{\frac{0.47(1 - 0.47)}{118}} = \sqrt{\frac{0.47 \times 0.53}{118}} \approx 0.045946$$\r \n" ); document.write( "\n" ); document.write( "### 5. Calculate the Test Statistic ($z$) \n" ); document.write( "$$z = \frac{\hat{p} - p_0}{SE} = \frac{0.389831 - 0.47}{0.045946} \approx -1.7449$$ \n" ); document.write( "Rounding the **$z$ value to 2 decimal places** as requested: \n" ); document.write( "$$z = -1.74$$\r \n" ); document.write( "\n" ); document.write( "### 6. Determine the p-value \n" ); document.write( "For a lower-tailed test, the p-value is the area to the left of our $z$-score in the standard normal distribution ($P(Z \leq -1.74)$). \r \n" ); document.write( "\n" ); document.write( "Using a standard normal ($z$) table: \n" ); document.write( "* $P(Z \leq -1.74) = 0.0409$\r \n" ); document.write( "\n" ); document.write( "**p-value:** **0.0409** \n" ); document.write( " |