STAT 200 Lesson 8; Inference for One Sample - Z and T Distributions

Introduction to Inference for One Sample

  • Stat 200 Lesson 8 focuses on applying common distributions, such as the zz and tt distributions, to construct confidence intervals and conduct hypothesis tests.

  • This lesson transitions from using bootstrapping and randomization distributions (as seen in StatKey) to using mathematical formulas.

  • The general form of a confidence interval is: Sample Statistic±(Z Multiplier×Standard Error)\text{Sample Statistic} \pm (\text{Z Multiplier} \times \text{Standard Error}).

  • The general form of a test statistic is: Test Statistic=Sample Statistic−Null ParameterStandard Error\text{Test Statistic} = \frac{\text{Sample Statistic} - \text{Null Parameter}}{\text{Standard Error}}.

  • The study will cover three specific parameters: one proportion, one mean, and paired means.

Inference for One Proportion

  • The Rule of Sample Proportions: The zz distribution can be used to approximate the sampling distribution if the following conditions are met:

    • n×p≥10n \times p \ge 10 (Number of successes)

    • n×(1−p)≥10n \times (1 - p) \ge 10 (Number of failures)

  • If these assumptions are met, the sampling distribution will have a standard error defined by the formula: SE=p(1−p)nSE = \sqrt{\frac{p(1-p)}{n}}.

  • For confidence intervals, the sample proportion (p^\hat{p}) is used as an estimate for pp. For hypothesis tests, the hypothesized population parameter (p0p_0) is used.

Constructing a Confidence Interval for a Proportion by Hand

  • Assumption Checklist: Both n×p^≥10n \times \hat{p} \ge 10 and n×(1−p^)≥10n \times (1 - \hat{p}) \ge 10 must be true. If not met, options include bootstrapping or the exact method.

  • Formula: p^±z∗×p^(1−p^)n\hat{p} \pm z^* \times \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}.

  • Example 1: Women Customers

    • Sample: 34 women in a random sample of 50 customers.

    • Check: Successes = 34, Failures = 16. Both are ≥10\ge 10. Assumption met.

    • p^=3450=0.68\hat{p} = \frac{34}{50} = 0.68.

    • For a 95% confidence interval, the zz multiplier is 1.961.96.

    • Calculation: 0.68±1.96×0.68(1−0.68)500.68 \pm 1.96 \times \sqrt{\frac{0.68(1 - 0.68)}{50}}.

    • Interval: 0.5510.551 to 0.8090.809. (95% confident the proportion of all customers who are women is between 55.1% and 80.9%).

  • Example 2: Passing Students

    • Sample: 88 students passed in a sample of 100.

    • Check: Successes = 88, Failures = 12. Both are ≥10\ge 10.

    • p^=88100=0.88\hat{p} = \frac{88}{100} = 0.88.

    • For a 98% confidence interval, the zz multiplier is 2.3262.326.

    • Interval: 0.8040.804 to 0.9560.956.

Proportions in Minitab Express

  • Summarized Data: Go to Statistics > One Sample > Proportion (PC) or Statistics > One Sample Inference > Proportion (Mac). Input number of events (successes) and number of trials (total sample size). Under Options, change the Method to "Normal approximation".

  • Raw Data: Example using "bike commute" dataset. To check assumptions with raw data, use Frequency Table (Statistics > Describe > Tally). If there are at least 10 in each category (e.g., 26 carbon bikes, 30 steel), assumptions are met. Select the column containing categorical data and specify the "event" to estimate (e.g., carbon).

Minimum Sample Size for a Proportion

  • Formula: n=p^(1−p^)×(z∗M)2n = \hat{p}(1 - \hat{p}) \times (\frac{z^*}{M})^2.

  • MM is the margin of error expressed as a decimal.

  • If no estimate of p^\hat{p} is available, use p~=0.5\tilde{p} = 0.5 (the most conservative estimate for the largest possible sample size).

  • Example 3: Previous Study Estimate

    • Confidence Level: 95% (z=1.96z = 1.96). Margin of Error (MM): 2% (0.020.02). Previous estimate: 68% (0.680.68).

    • n=0.68(1−0.68)×(1.960.02)2=2089.83n = 0.68(1 - 0.68) \times (\frac{1.96}{0.02})^2 = 2089.83.

    • Always round up: 20902090.

  • Example 4: No Previous Estimate

    • Confidence Level: 95% (z=1.96z = 1.96). MM: 5% (0.050.05). No estimate.

    • n=0.5(1−0.5)×(1.960.05)2=384.16n = 0.5(1 - 0.5) \times (\frac{1.96}{0.05})^2 = 384.16.

    • Round up: 385385.

Hypothesis Testing for One Proportion

  1. Step 1: Check Assumptions and Write Hypotheses

    • H0:p=p0H_0: p = p_0

    • Ha:p≠p0,p>p0, or p<p0H_a: p \neq p_0, p > p_0, \text{ or } p < p_0

    • Assumptions: n×p0≥10n \times p_0 \ge 10 and n×(1−p0)≥10n \times (1 - p_0) \ge 10.

  2. Step 2: Calculate Test Statistic

    • z=p^−p0p0(1−p0)nz = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1 - p_0)}{n}}}.

  3. Step 3: Determine p-value

    • Find the area under the zz distribution more extreme than the test statistic in the direction of the alternative hypothesis.

  4. Step 4: Make a Decision

    • If p-value≤αp \text{-value} \le \alpha (usually 0.05), reject H0H_0. Else, fail to reject.

  5. Step 5: State a Real-World Conclusion

    • Indicate if there is evidence to support the alternative hypothesis.

Introduction to the t distribution for One Mean

  • The tt distribution is similar to the zz distribution (symmetrical) but varies based on Degrees of Freedom (dfdf).

  • For one mean: df=n−1df = n - 1.

  • As degrees of freedom increase, the tt distribution becomes more similar to the zz distribution. At low degrees of freedom, the tt distribution has lower height in the center and thicker/higher tails.

  • Central Limit Theorem (CLT): For a single mean, a sample size or n≥30n \ge 30 is considered "sufficiently large" for the sampling distribution to be approximately normal regardless of population shape.

  • Flowchart for Selection:

    • Population normal and population σ\sigma known: Use zz distribution (rare).

    • Population normal but σ\sigma unknown: Use tt distribution.

    • Population NOT normal but n≥30n \ge 30: Use tt distribution.

    • Population NOT normal and n<30n < 30: Use bootstrapping/randomization.

Confidence Intervals for a Mean by Hand

  • Formula: xˉ±t∗×sn\bar{x} \pm t^* \times \frac{s}{\sqrt{n}}.

  • The standard error is: SE=snSE = \frac{s}{\sqrt{n}}.

  • Example 5: Mean Age

    • n=50n = 50 (at least 30, use tt). xˉ=31\bar{x} = 31. s=5s = 5. CL = 95%.

    • df=50−1=49df = 50 - 1 = 49.

    • Using Minitab Express to find t∗t^* for 49 dfdf and 95% middle area: t∗=2.00958t^* = 2.00958.

    • Calculation: 31±2.00958×(550)31 \pm 2.00958 \times (\frac{5}{\sqrt{50}}).

    • Interval: 29.57929.579 to 32.42132.421.

  • Example 6: Customer Spending

    • n=40n = 40. xˉ=20\bar{x} = 20. s=8s = 8. CL = 90%.

    • df=39df = 39.

    • t∗t^* for 39 dfdf and 90% middle area: 1.684881.68488.

    • Calculation: 20±1.68488×(840)20 \pm 1.68488 \times (\frac{8}{\sqrt{40}}).

    • Interval: 17.8717.87 to 22.1322.13.

Minimum Sample Size for a Mean

  • Formula: n=(z∗×σtildeM)2n = (\frac{z^* \times \sigma_{tilde}}{M})^2.

  • Since nn is unknown, we cannot determine degrees of freedom for a tt multiplier, so we use the zz multiplier as an estimate.

  • Example 7: Mean Age Study

    • CL = 95% (z=1.96z = 1.96). M=2M = 2. Previously observed s=5s = 5.

    • n=(1.96×52)2=24.01n = (\frac{1.96 \times 5}{2})^2 = 24.01.

    • Round up: 2525.

Hypothesis Testing for One Mean

  1. Step 1: Check Assumptions and Write Hypotheses

    • H0:μ=μ0H_0: \mu = \mu_0

    • Ha:μ≠μ0,μ>μ0, or μ<μ0H_a: \mu \neq \mu_0, \mu > \mu_0, \text{ or } \mu < \mu_0

    • Assumption: n≥30n \ge 30 or population is normal.

  2. Step 2: Calculate Test Statistic

    • t=xˉ−μ0(s/n)t = \frac{\bar{x} - \mu_0}{(s / \sqrt{n})}.

  3. Step 3: Determine p-value

    • Find the area more extreme than tt on a tt distribution with n−1n - 1 degrees of freedom.

  • Example 8: Store Visit Length

    • $H_a: \mu > 10..n = 40..\bar{x} = 13..s = 4.\n * t = \frac{13 - 10}{(4 / \sqrt{40})} = 4.743.\n * df = 39.Areatotherightof. Area to the right of4.743onont_{39}distributionisdistribution is0.000014.\n * p < 0.05,reject, rejectH_0. Evidence the average visit is > 10 minutes.\n\n# Paired Means (Section 6.5)\n\n* **Definition**: Two observations for each case that are meaningfully matched. Common in pre-test/post-test designs or sibling/spousal pairs.\n* **Procedure**: Compute the differences (d) for each pair and treat the differences as a single-mean sample.\n* **Sampling Distribution**: Use tdistributionifdifferencesarenormalinthepopulationordistribution if differences are normal in the population orn \ge 30 pairs.\n* **Confidence Interval Formula**: \bar{x}_d \pm t^* \times \frac{s_d}{\sqrt{n}}.\n * n is the number of pairs.\n* **Example 9: Anxiety Scores**\n * n = 30participants.Meandifference(participants. Mean difference (\bar{x}_d):):3.733.StdDevofdifferences(. Std Dev of differences (s_d):):9.425.CL=95. CL = 95%.\n *df = 29..t^* = 2.04523.\n * Interval calculation: 3.733 \pm 2.04523 \times (\frac{9.425}{\sqrt{30}}).\n * Interval: 0.214toto7.252.(95. (95% confident the mean decrease is between 0.214 and 7.252 points).\n\n# Hypothesis Testing for Paired Means\n\n1. **Step 1: Check Assumptions/Hypotheses**\n *H_0: \mu_d = 0\n * H_a: \mu_d \neq 0 (or directional based on research question).\n2. **Step 2: Test Statistic**\n * t = \frac{\bar{x}_d - 0}{(s_d / \sqrt{n})}.\n* **Minitab Express for Paired Means**: Go to Statistics > Two Samples > Paired t. You can input summarized data (mean difference, std dev of differences, number of pairs) or raw data in two columns. For paired means, the null is always assumed to be zero.\n\n# Summary of Formulas and Assumptions\n\n* **General CI**: \text{Statistic} \pm \text{Multiplier} \times SE\n* **General Test Stat**: \text{Statistic} - \text{Null Parameter} / SE\n* **One Proportion SE**: \sqrt{\frac{p(1-p)}{n}}\n* **One Mean SE**: \frac{s}{\sqrt{n}}\n* **Paired Mean SE**: \frac{s_d}{\sqrt{n}}\n* **Important Repetition**: All procedures rely on the sample statistic, the hypothesized parameter, and the standard error. Use zforproportionsandfor proportions andtformeans(for means (df = n-1$$).