# One-sided confidence intervals

## Confidence intervals

We motivated CI’s as all values of \(\mu_0\) that would not be rejected in a **two-sided** hypothesis test of \(H_0: \mu = \mu_0\).

**Two-sided** p-values, **two-sided** rejection regions and **two-sided** confidence intervals are generally equivalent: \[
\begin{aligned}
p < \alpha &\iff \text{Reject } H_0: \mu = \mu_0 \text{ at level } \alpha \\ &\iff \mu_0 \text{ is outside} (1-\alpha)100 \text{\% confidence interval} \\
p > \alpha &\iff \text{Fail to reject } H_0: \mu = \mu_0 \text{ at level } \alpha \\
&\iff \mu_0 \text{ is inside} (1-\alpha)100 \text{\% confidence interval}
\end{aligned}
\]

## One-sided confidence intervals

You can motivate them from one-sided tests too.

You end up with an infinite bound on one end.

## So, why not report one sided CIs?

You don’t always do a hypothesis test. A plausible range for a parameter value should be two-sided. (If there isn’t a value of interest, how could there be a direction of interest?)

Should a plausible range for depend on *your* hypothesis of interest? More useful for others to give a 95% two-sided interval.

Yes, this means your one-sided test might not agree with your two-sided confidence interval.

**Should we ever do one-sided tests?** Some people argue “No, we should never do one sided tests”. I’d say, you can, but you better have a really good reason, or someone will accuse you of doing it just to get a smaller p-value.

# Binomial Proportions

## Data Setting

**Population:** \(Y \sim \text{Bernoulli}(p)\), i.e. \[
Y = \begin{cases}
1, & \text{with probability } p \\
0, & \text{with probability } 1 - p
\end{cases}
\]

\(E(Y) = p\), \(Var(Y) = p(1-p)\) When mean and variance share parameters we say there is a **mean-variance relationship**.

**Parameter**: \(\mu = E(Y) = p\), the population proportion

**Sample:** \(n\) i.i.d from population: \(Y_1, \ldots, Y_n\)

**Statistic:** \(\overline{Y} = \frac{1}{n}\sum_{i=1}^n Y_i = \hat{p}\), the sample proportion.

## Testing

Null hypothesis: \(H_0:p = p_0\)

Exact test: use fact that \[ n\overline{Y} \sim \text{Binomial}(n, p) \]

Approximate test: use fact that \[ \overline{Y} \dot\sim N\left( E(Y) , \frac{Var(Y)}{n}\right) = N\left( p , \frac{p(1-p)}{n}\right) \]

## Exact Binomial Test:

Complete worksheet (Charlotte will provide)

Get into groups according to number on worksheet at numbered whiteboard

Write answers to bold questions on whiteboard as you complete them (so I can see where you are up to)