received_634684906179639.jpeg
Document Details

Uploaded by LovelyMossAgate3491
Full Transcript
# Lecture 17 : Hypothesis Testing ## 1. Introduction This lecture covers hypothesis testing ## 2. Framework ### 2.1. Null Hypothesis - $H_0$ : "null" hypothesis - A statement about the population - We aim to *disprove* it - e.g., $H_0 : \mu = 0$ ### 2.2. Alternative Hypothesis - $H_1$ : alter...
# Lecture 17 : Hypothesis Testing ## 1. Introduction This lecture covers hypothesis testing ## 2. Framework ### 2.1. Null Hypothesis - $H_0$ : "null" hypothesis - A statement about the population - We aim to *disprove* it - e.g., $H_0 : \mu = 0$ ### 2.2. Alternative Hypothesis - $H_1$ : alternative hypothesis - e.g., $H_1 : \mu \ne 0$ or $H_1 : \mu > 0$ ### 2.3. Test Statistic - Function of the sample data - Want to choose a test statistic that will have different values depending on whether the null/alternative hypothesis is true ### 2.4. P-value - Probability of seeing our test statistic (or one more extreme) if the null hypothesis is true - e.g., $P(T \ge t \mid H_0)$ where $T$ is the test statistic and $t$ is the value we observed ### 2.5. Significance Level - $\alpha$ : significance level - If $p < \alpha$, we reject the null hypothesis - Common choices for $\alpha$ : 0.01, 0.05, 0.1 ## 3. Errors ### 3.1. Type I Error - Reject the null hypothesis when it is true - False positive - $P(\text{Type I Error}) = \alpha$ ### 3.2. Type II Error - Fail to reject the null hypothesis when it is false - False negative - $P(\text{Type II Error}) = \beta$ - Power $= 1 - \beta$ ### 3.3. Errors Table | | Accept $H_0$ | Reject $H_0$ | | :----------------- | :--------------- | :-------------- | | $H_0$ True | Correct | Type I Error | | $H_0$ False | Type II Error | Correct | ## 4. Math ### 4.1. Test Statistic $T = \frac{\bar{X} - \mu_0}{S / \sqrt{n}}$ where: - $\bar{X}$ is the sample mean - $\mu_0$ is the value of $\mu$ under the null hypothesis - $S$ is the sample standard deviation - $n$ is the sample size ### 4.2. P-value $P = 2 * P(T > |t|)$ where: - $t$ is the value of the test statistic we observed - We multiply by 2 because this is a two-sided test ## 5. Example ### 5.1. Question We observe the weights of 10 packages of cookies. The sample mean is 10.2 oz and the sample standard deviation is 0.5 oz. Test the hypothesis that the true mean weight of packages of cookies is 10 oz. Use a significance level of 0.05. ### 5.2. Answer 1. State the null and alternative hypotheses: - $H_0 : \mu = 10$ - $H_1 : \mu \ne 10$ 2. Calculate the test statistic: - $T = \frac{10.2 - 10}{0.5 / \sqrt{10}} = 1.265$ 3. Calculate the p-value: - $P = 2 * P(t_9 > 1.265) = 0.237$ 4. Conclusion: - Since $p > \alpha$, we *fail to reject* the null hypothesis. - We do not have enough evidence to conclude that the true mean weight of packages of cookies is different from 10 oz.