document.write( "Question 1165134: Let x be a random variable representing dividend yield of bank stocks. We may assume that x has a normal distribution with σ = 2.6%. A random sample of 10 bank stocks gave the following yields (in percents).
\n" ); document.write( "5.7 4.8 6.0 4.9 4.0 3.4 6.5 7.1 5.3 6.1
\n" ); document.write( "The sample mean is x bar = 5.38%. Suppose that for the entire stock market, the mean dividend yield is μ = 4.9%. Do these data indicate that the dividend yield of all bank stocks is higher than 4.9%? Use α = 0.01.\r
\n" ); document.write( "\n" ); document.write( "Compute the z value of the sample test statistic. (Enter a number. Round your answer to two decimal places.)\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "(c) Find (or estimate) the P-value. \r
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "

Algebra.Com's Answer #853113 by CPhill(2138)\"\" \"About 
You can put this solution on YOUR website!
```python?code_reference&code_event_index=2
\n" ); document.write( "import numpy as np
\n" ); document.write( "from scipy.stats import norm\r
\n" ); document.write( "\n" ); document.write( "# Given parameters
\n" ); document.write( "mu_0 = 4.9 # Hypothesized population mean (%)
\n" ); document.write( "sigma = 2.6 # Population standard deviation (%)
\n" ); document.write( "n = 10 # Sample size
\n" ); document.write( "x_bar = 5.38 # Sample mean (%)\r
\n" ); document.write( "\n" ); document.write( "# --- Part (a): Compute the Z value of the sample test statistic ---
\n" ); document.write( "# 1. Calculate the standard error of the mean
\n" ); document.write( "SE = sigma / np.sqrt(n)\r
\n" ); document.write( "\n" ); document.write( "# 2. Calculate the Z-score
\n" ); document.write( "Z_test = (x_bar - mu_0) / SE\r
\n" ); document.write( "\n" ); document.write( "# --- Part (c): Find the P-value ---
\n" ); document.write( "# Since H1 is mu > 4.9 (right-tailed test), P-value = 1 - P(Z < Z_test)
\n" ); document.write( "P_value = 1 - norm.cdf(Z_test)\r
\n" ); document.write( "\n" ); document.write( "# Output results rounded as requested
\n" ); document.write( "Z_rounded = round(Z_test, 2)
\n" ); document.write( "P_rounded = round(P_value, 4)\r
\n" ); document.write( "\n" ); document.write( "print(f\"Z-test statistic: {Z_test}\")
\n" ); document.write( "print(f\"Z-test statistic (rounded to 2 d.p.): {Z_rounded}\")
\n" ); document.write( "print(f\"P-value: {P_value}\")
\n" ); document.write( "print(f\"P-value (rounded to 4 d.p.): {P_rounded}\")\r
\n" ); document.write( "\n" ); document.write( "```\r
\n" ); document.write( "\n" ); document.write( "```text?code_stdout&code_event_index=2
\n" ); document.write( "Z-test statistic: 0.5838051064926233
\n" ); document.write( "Z-test statistic (rounded to 2 d.p.): 0.58
\n" ); document.write( "P-value: 0.27967572112728867
\n" ); document.write( "P-value (rounded to 4 d.p.): 0.2797\r
\n" ); document.write( "\n" ); document.write( "```\r
\n" ); document.write( "\n" ); document.write( "This is a one-sample $Z$-test for the mean.\r
\n" ); document.write( "\n" ); document.write( "### 1\. Compute the $Z$ value of the sample test statistic.\r
\n" ); document.write( "\n" ); document.write( "The formula for the $Z$-test statistic is:
\n" ); document.write( "$$Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$$\r
\n" ); document.write( "\n" ); document.write( "Given values: $\bar{x}=5.38$, $\mu_0=4.9$, $\sigma=2.6$, $n=10$.\r
\n" ); document.write( "\n" ); document.write( "1. **Calculate the Standard Error (SE):**
\n" ); document.write( " $$\text{SE} = \frac{2.6}{\sqrt{10}} \approx 0.82219$$\r
\n" ); document.write( "\n" ); document.write( "2. **Calculate the $Z$-score:**
\n" ); document.write( " $$Z = \frac{5.38 - 4.9}{0.82219} = \frac{0.48}{0.82219}$$
\n" ); document.write( " $$Z \approx 0.5838$$\r
\n" ); document.write( "\n" ); document.write( "Rounding the answer to two decimal places:
\n" ); document.write( "$$\mathbf{Z \approx 0.58}$$\r
\n" ); document.write( "\n" ); document.write( "-----\r
\n" ); document.write( "\n" ); document.write( "### 2\. Find the $P$-value.\r
\n" ); document.write( "\n" ); document.write( "Since the alternative hypothesis is $H_1: \mu > 4.9\%$ (a right-tailed test), the $P$-value is the area under the standard normal curve to the right of the test statistic $Z = 0.5838$.\r
\n" ); document.write( "\n" ); document.write( "$$P\text{-value} = P(Z \ge 0.5838)$$\r
\n" ); document.write( "\n" ); document.write( "Using the standard normal distribution calculation:
\n" ); document.write( "$$P\text{-value} \approx 0.279676$$\r
\n" ); document.write( "\n" ); document.write( "Rounding the answer to four decimal places:
\n" ); document.write( "$$\mathbf{P\text{-value} \approx 0.2797}$$\r
\n" ); document.write( "\n" ); document.write( "-----\r
\n" ); document.write( "\n" ); document.write( "### Conclusion (Optional)\r
\n" ); document.write( "\n" ); document.write( "Since the $P$-value $(0.2797)$ is much greater than the significance level $\alpha$ $(0.01)$, we fail to reject the null hypothesis. The data do not provide sufficient evidence to conclude that the dividend yield of all bank stocks is higher than $4.9\%$.
\n" ); document.write( "
\n" );