# Lecture_31
Author: Zheyuan Wu
Date: 2023-04-07

#### Zheyuan Wu

#### 2023-04-07

### Hypothesis Tests for Proportions

Example: In 1995, 40% of adults aged 18 years or older reported that they had “a great deal” of confidence in the public schools. On June 1, 2005, the Gallup Organization released results of a poll in which 372 of 1004 adults aged 18 years or older stated that they had “a great deal” of confidence in public schools. Does the evidence suggest at the \(\alpha\) = 0.05 significance level that the proportion of adults aged 18 years or older having “a great deal” of confidence in the public schools is lower in 2005 than in 1995?

\(p=\) percentage of adults having “a great deal” of confidence in the public schools.

Let \(X\sim Bin(n,p)\) and let \(\hat p={X\over n}\) be the sample proportion. (The number of adults being confidence in public school among the sampled 1004 adults)

1. State the hypotheses

We assume \(p_0\) be 40%

\[ H_0;p=p_0~~~H_0:p=p_0~~~H_0:p=p_0\\ H_a;p>p_0~~~H_a:p<p_0~~~H_a:p\neq p_0\\ \]

The first is called one-sided right/upper test

The second is called one-sided left/lower test

The third is called two-sided test/two tail test

Example:

\(H_0:p=0.4\)

\(H_a:p<0.4\)

2. Computer the test statistic

\[ Z_{H_0}={\hat p-p_0\over \sqrt{p_0(i-p_0)\over n}} \]

\(\sqrt{p_0(i-p_0)\over n}\) is the standard error of \(\hat p\)

Condition: \(np_0\geq 5\) and \(n(i-p_0)\geq5\)

Example:

\[ \hat p={372\over 1004}=0.371\\ Z_{H_0}={\hat p-p_0\over \sqrt{p_0(i-p_0)\over n}}={0.371-0.4\over\sqrt{0.4(1-0.4)\over 1004} }=-1.876 \]

3. Reach a conclusion

- If \(H_0\) is true, \(Z_{H_0}\dot \sim N(0,1)\).

- We want to determine if the observed value of \(Z_{H_0}\) is unusual for a \(N(0,1)\) random variable.

- If the observed value of \(Z_{H_0}\) is unusual, then we reject \(H_0\).

    i.    Rejection rule or region:

      $H_a:p>p_0$

      *   Reject $H_0$ if $z_{H_0}\geq z_{\alpha}$

      $H_a:p<p_0$

      *   Reject $H_0$ if $z_{H_0}\leq z_{\alpha}$

      $H_a:p\neq p_0$

      *   Reject $H_0$ if $z_{H_0}\leq z_{\alpha/2} or z_{H_0}\geq z_{\alpha/2} $

    ii.   p-value:

      -   Using a p-value conveys the strength of the evidence agianst $H_0$.

      -   The p-value is the probability of observing what was obserbed if $H_0$ is true.

      $H_a:p>p_0$

      *   p-value=$P(z\geq z_{H_0})$

      $H_a:p<p_0$

      *   p-value=$P(z\leq z_{H_0})$

      $H_a:p\neq p_0$

      *   p-value=$P(z\geq abs(z_{H_0})+$P(z\leq -abs(z_{H_0})$

      -   Reject $H_0$ if p-value $\leq \alpha$

Example:

4. State the conclusion in the context of the problem.

Example:

### Hypothesis test for Means

Example: The Centers for Disease Control (CDC) reported on trends in weight, height and body mass index from the 1960’s through 2002. The general trend was that Americans were much heavier and slightly taller in 2002 as compared to 1960. In 2002, the mean weight for men was reported at 191 pounds. Suppose that an investigator hypothesizes that weights are even higher in 2006 (i.e., that the trend continued over the subsequent 4 years). A random sample of 45 American males was recruited in 2006 and their weights were measured. The sample mean weight was 197.1 pounds, and the sample standard deviation was 25.6 pounds. Use \(\alpha\) = 0.01.

Let \(X_1,...,X_n\) be a simple random sample form a popluation and let \(\bar X\) and \(S^2\) denote the sample mean and sample variance, respectively.

1. State the hypotheses