Introduction to Confidence Intervals

A confidence interval (CI) provides a range of values that is likely to contain a population parameter.

It can estimate the population mean, population standard deviation, or proportion based on a sample.

Example: A 95% confidence level means that if we take 100 different samples, approximately 95 of the confidence intervals calculated would contain the true population mean.

Common levels: 90%, 95%, and 99%.

Formula: \[ \text{Confidence Level} = (1 - \alpha) \times 100\% \]

Types of Confidence Intervals

Confidence Intervals can be in three forms:

\[ \hat{L}\lt \mu <\hat{U} \text{ (2-Sided)} \] \[ \hat{L}\lt \mu \text{ (1-Sided Lower)} \] \[ \mu <\hat{U} \text{ (1-Sided Upper)} \]

  • \(\hat{L}\) is the point estimate of the lower bound based on the n items in the random sample
  • \(\hat{U}\) is the point estimate of the upper bound based on the n items in the random sample

There is a probability of \(1-\alpha\) that the CI will contain the true value of \(\mu\)

Understanding \(z_{\alpha/2}\) and \(z_{\alpha}\)

Z is a standard normal variable, with a normal distribution Z has an expected value of 0 and a variation of 1

\(z_{\alpha/2}\) is the value of z on the z-axis where the area above it under the Z pdf graph are equal to \(z_{\alpha/2}\)

\(z_{\alpha}\) is the value of z on the z-axis where the area above it under the Z pdf graph are equal to \(z_{\alpha}\)

Example: Let’s look at the \(Z\) pdf curve and \(z_{0.01}\)

The shaded part has an area of 0.01

The non-shaded part has an area of 1-0.01 = 0.99

Calculating z values

We can use both R and our calculators to solve for z values!

Calculator: invNorm(1-\(\alpha\), \(\mu\), \(\sigma\))

\(z_{0.01} = \text{invNorm(}1-0.01,0,1) = 2.3263\)

R: qnorm(\(\alpha\))

z_0.01 <- qnorm(0.99)
z_0.01
## [1] 2.326348

Checking our work

We can show that our z value is correct by simply using it to calculate the area under the curve

The area should equal the value of \(\alpha\)

Example

\(z_{\alpha} = z_{0.05} = \text{invnorm(}1-0.05,0,1) = 1.6449\)

\(\text{normalcdf(}1.6449,\infty, 0,1) = 0.05\)

Formulas

Two Sided Confidence Interval:

\(\hat{L} = \bar{x} - z_{\alpha/2}\frac{\sigma}{\sqrt{n}}\) \(\hat{U} = \bar{x} + z_{\alpha/2}\frac{\sigma}{\sqrt{n}}\)

One Sided Lower Confidence Interval:

\(\hat{L} = \bar{x} - z_{\alpha}\frac{\sigma}{\sqrt{n}}\)

One Sided Upper Confidence Interval:

\(\hat{U} = \bar{x} + z_{\alpha}\frac{\sigma}{\sqrt{n}}\)

Visual Representation of Confidence Intervals