# Statistical Inference Methods

Source: https://cca.twango.dev/AP-Statistics/inference

# Statistical Inference Methods

Use a confidence interval to estimate a parameter and a hypothesis test to assess evidence against a specified null value. Random sampling, independence, and the relevant distribution conditions matter throughout.

## Proportions

### One-sample $z$ interval

Conditions: random sample; approximately independent observations (10% condition when sampling without replacement); at least 10 successes and 10 failures, $n\hat p\ge10$ and $n(1-\hat p)\ge10$.

$$
\hat p\pm z^\star\sqrt{\frac{\hat p(1-\hat p)}n}.
$$

Interpretation: “We are [confidence level]% confident that the population proportion of [context] lies between [lower] and [upper].” The confidence level describes the long-run coverage of the procedure.

### Two-sample $z$ interval

Require two independent random samples/groups, approximate independence within each, and at least 10 successes and failures in **each** sample.

$$
(\hat p_1-\hat p_2)\pm z^\star\sqrt{
\frac{\hat p_1(1-\hat p_1)}{n_1}+
\frac{\hat p_2(1-\hat p_2)}{n_2}}.
$$

Interpret the interval for $p_1-p_2$ in the specified group order.

### One-sample $z$ test

$$
H_0:p=p_0,\qquad H_a:p>p_0,\ p<p_0,\text{ or }p\ne p_0,
$$

$$
z=\frac{\hat p-p_0}{\sqrt{p_0(1-p_0)/n}}.
$$

Use the appropriate one- or two-sided normal-tail probability. Check **null expected counts**, $np_0\ge10$ and $n(1-p_0)\ge10$, along with sampling and independence.

### Two-sample $z$ test

For $H_0:p_1=p_2$, choose $H_a:p_1>p_2$, $p_1<p_2$, or $p_1\ne p_2$.

$$
\hat p_c=\frac{n_1\hat p_1+n_2\hat p_2}{n_1+n_2},
$$

$$
z=\frac{\hat p_1-\hat p_2}
{\sqrt{\hat p_c(1-\hat p_c)(1/n_1+1/n_2)}}.
$$

Check success/failure counts under the pooled null probability in both groups, plus independence within and between groups. Pool for the equality test, **not** for the two-proportion interval.

> [!warning] Review correction
> The original proportion-test conditions used only $n\ge30$, which does not ensure enough expected successes and failures. The original two-sample test also copied an interval conclusion; a test conclusion concerns evidence against $H_0$, not a confidence interval.

## Means

### Conditions for $t$ procedures

Use an appropriate random sample/design, approximately independent observations, and a nearly normal population or a sufficiently large sample without severe skew/outliers. For paired data, assess the **differences**, not the two sets separately. Independence between groups applies only to the independent two-sample method.

### One-sample $t$ interval and test

$$
\bar x\pm t^\star\frac{s}{\sqrt n},\qquad df=n-1,
$$

$$
t=\frac{\bar x-\mu_0}{s/\sqrt n}.
$$

### Paired $t$ interval and test

Define each paired difference consistently, $d_i=x_{1i}-x_{2i}$. Let $n$ be the number of **complete pairs**.

$$
\bar d\pm t^\star\frac{s_d}{\sqrt n},\qquad df=n-1,
$$

$$
t=\frac{\bar d-d_0}{s_d/\sqrt n}.
$$

Typically $d_0=0$. This is a one-sample procedure on differences; do not use independent-group standard errors. See [NIST paired observations](https://www.itl.nist.gov/div898/handbook/prc/section3/prc311.htm).

### Independent two-sample $t$ interval and test

$$
(\bar x_1-\bar x_2)\pm t^\star
\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}},
$$

$$
t=\frac{(\bar x_1-\bar x_2)-\Delta_0}
{\sqrt{s_1^2/n_1+s_2^2/n_2}}.
$$

Typically $\Delta_0=0$. Use Welch degrees of freedom, or a justified conservative course convention; an equal-variance pooled test needs an additional assumption.

## Decisions, $p$-values, and power

A **$p$-value** is the probability, assuming $H_0$ and the model assumptions, of a test statistic at least as extreme in the alternative’s direction. It is not the probability that $H_0$ is true.

Reject $H_0$ when $p<\alpha$; otherwise fail to reject. State whether there is convincing evidence for the alternative **in context**. Failing to reject does not prove the null.

- $\hat p$: sample proportion.
- $p_0$: null hypothesized proportion.
- $p$: population proportion.
- Type I error: reject a true null; probability controlled by $\alpha$ under the model.
- Type II error: fail to reject a false null; probability $\beta$ at a specified alternative.
- **Power:** probability of rejecting a false null, $1-\beta$, at that alternative.

Increasing $n$ generally increases power by **decreasing** standard error. Increasing $\alpha$ enlarges the rejection region and increases power, while increasing Type I error risk. Larger true effects also increase power, other conditions held fixed.

> [!warning] Review correction
> The original power note said increasing $n$ increases SE. Standard errors generally shrink as $1/\sqrt n$. Test statistics use $t$; $t^\star$ denotes an interval’s critical value.

Related: [[chapter-8|Sampling distributions]] · [[chi-squared-tests|Categorical-data tests]] · [[S2-Final-Project/s2-report|Paired-test reproducibility issue]]
