Standard Error, Confidence Intervals, and Hypothesis Testing – STAT 5302, Ch. 1 – Study Notes
offline

Source: Weisberg, Applied Linear Regression, Ch. 1; STAT 5302 HW1

Difficulty: Intermediate | Prerequisites: Basic probability, familiarity with normal distribution, introductory R.

Tags: standard error, confidence interval, hypothesis testing, p-value, t-test, mheight, dheight, alr4, applied linear regression, STAT 5302

Big Picture

This material sits at the very start of a graduate-level applied regression course. Before you fit any regression line, you need to be comfortable summarising a single variable: its centre, its spread, and how confidently you can pin down the population mean from a sample. These problems walk through standard errors, confidence intervals, hypothesis tests (one-sample and paired), and normal-distribution calculations, all using height data for mothers and daughters from the alr4 package in R. If you can do these fluently, you have the inferential toolkit that every later chapter assumes.


TL;DR

The standard error tells you how much a sample mean wobbles from sample to sample. Confidence intervals wrap that wobble into a range that, over many repetitions, captures the true mean a stated percentage of the time. Hypothesis testing asks whether your observed data are surprising under some assumed truth about the population, and the p-value quantifies that surprise.


Key Terms

Standard error (SE)

The standard deviation of the sampling distribution of a statistic (usually the sample mean). It measures how precisely your sample mean estimates the population mean. In simple terms, it tells you how much your average would jump around if you repeated the study many times.

Confidence interval (CI)

An interval constructed from sample data such that, if you repeated the sampling procedure many times, a stated proportion (e.g. 90% or 95%) of those intervals would contain the true population parameter. Think of it as a net you cast around your estimate; the confidence level is how often, across many casts, the net lands on the truth.

P-value

The probability, assuming the null hypothesis is true, of observing a test statistic at least as extreme as the one you actually got. In simple terms, it answers: "If nothing interesting were really going on, how weird is my data?"

Null hypothesis (H₀)

A default claim about a population parameter (e.g. H₀: μ = 62.75). You test whether the data give enough evidence to reject it.

Alternative hypothesis (H₁ or Hₐ)

The claim that the null is wrong. In a two-sided test, it simply says the parameter is not equal to the null value.

T-statistic

A ratio that measures how far your sample statistic is from the null-hypothesis value, scaled by the standard error. Larger absolute values mean more evidence against H₀.

Paired t-test

A t-test applied to the differences within matched pairs (here, mother-daughter pairs) rather than to two independent groups. It accounts for the correlation between the paired observations. Think of it as: instead of comparing two separate lists, you subtract each pair and test whether the average difference is zero.

Significance level (α)

The threshold below which you reject the null hypothesis. Common choices are 0.05 and 0.10. It is set before looking at the data.


Core Content

Standard Error of the Sample Mean

  • The SE of the sample mean x̄ is SE(x̄) = s / √n, where s is the sample standard deviation and n is the sample size.

  • A smaller SE means your estimate of the population mean is more precise.

  • Unit conversion matters. If mheight is recorded in inches and you convert to feet (divide by 12), both the sample mean and the SE are divided by 12. The SE scales linearly with the units of measurement.

    • Example: if SE = 0.09 inches, then SE in feet = 0.09 / 12 = 0.0075 feet.

Confidence Intervals for the Mean

  • A two-sided CI for the population mean μ takes the form: x̄ ± t*(α/2, n−1) × SE(x̄).

  • The critical value t* comes from the t-distribution with n − 1 degrees of freedom.

  • For a 90% CI, α = 0.10 so you use the 0.05 and 0.95 quantiles of the t-distribution.

  • Interpretation (get this right on exams): "We are 90% confident that the true population mean of mother's height lies between [lower, upper]." This means that if you repeated the sampling and interval-construction procedure many times, about 90% of those intervals would contain the true μ.

    • It does not mean there is a 90% probability that μ is in this particular interval. μ is fixed; the interval is random.

Hypothesis Testing and P-values

  • Setup: H₀: μ = μ₀ vs Hₐ: μ ≠ μ₀ (two-sided).

  • Test statistic: t = (x̄ − μ₀) / SE(x̄), which follows a t-distribution with n − 1 degrees of freedom under H₀.

  • P-value: For a two-sided test, p = 2 × P(T > |t_obs|), where T ~ t(n − 1).

  • If p < α, reject H₀. If p ≥ α, fail to reject.

  • In Problem 1.4, you test H₀: E[mheight] = 62.75 inches. You compute the t-statistic from the sample, then find the two-tailed p-value.

Paired T-test (Problem 1.6)

  • When mother and daughter heights are paired (same family), the observations are correlated.

  • You cannot use an independent two-sample t-test. Instead, compute the difference dᵢ = mheightᵢ − dheightᵢ for each pair.

  • Then run a one-sample t-test on the differences: H₀: μ_d = 0, where μ_d is the population mean difference.

  • The test statistic is t = d̄ / (s_d / √n), where d̄ is the sample mean of the differences and s_d is their sample standard deviation.

  • In R: t.test(mheight, dheight, paired = TRUE).


Formulas

\text{SE}(\bar{x}) = \frac{s}{\sqrt{n}}
\text{CI for } \mu: \quad \bar{x} \pm t^*_{\alpha/2,\, n-1} \times \text{SE}(\bar{x})
t = \frac{\bar{x} - \mu_0}{\text{SE}(\bar{x})}
\text{Paired } t: \quad t = \frac{\bar{d}}{s_d / \sqrt{n}}, \quad d_i = x_{1i} - x_{2i}

Real-World Applications

Confidence intervals and hypothesis tests are the backbone of clinical trials: a drug is approved when the CI for its treatment effect excludes zero (or the p-value clears the regulatory threshold). Paired tests specifically show up whenever "before and after" measurements are taken on the same subjects, for instance measuring blood pressure before and after medication in the same patients.


Common Misconceptions

  • Students often think a 95% CI means "there is a 95% probability μ is in this interval." It does not. The parameter is fixed; the interval is random. The 95% refers to the long-run success rate of the procedure.

  • Students often confuse standard deviation with standard error. SD measures spread in the raw data; SE measures precision of the sample mean. SE is always smaller than SD (by a factor of √n).

  • Students often use an independent two-sample t-test when data are paired. If observations are correlated (mother-daughter heights from the same family), you must use a paired test. An independent test ignores the pairing and typically has less power.

  • Students sometimes think "fail to reject H₀" means "H₀ is true." It does not. It means the data did not provide strong enough evidence to reject it.


Why It Matters / Exam Flags

⚠️ You will almost certainly be asked to interpret a confidence interval. The phrasing matters: say "we are X% confident," not "there is an X% probability."

⚠️ Unit conversion of the SE is a classic short question. Remember: SE scales with the same factor as the data.

⚠️ Paired vs independent t-test choice comes up whenever the problem says observations are "correlated," "matched," or "from the same subject." The homework explicitly warns you about this in Problem 1.6.

⚠️ Know when to use the t-distribution vs the z-distribution. When the population variance is unknown and estimated from the sample, use t.


Quick Self-Test

  1. True or False: The standard error of the mean increases as the sample size increases. (False: SE decreases as n increases.)

  1. Fill in the blank: A 90% confidence interval uses the ______ and ______ quantiles of the t-distribution. (0.05 and 0.95, i.e. the α/2 and 1 − α/2 quantiles.)

  1. True or False: If the p-value is 0.03 and α = 0.05, you reject the null hypothesis. (True.)

  1. Fill in the blank: When converting SE from inches to feet, you ______ the SE by ______. (Divide, 12.)

  1. True or False: A paired t-test is appropriate when the two samples are drawn independently from different populations. (False: paired t-test is for matched/correlated observations.)


Practice Q&A

Q: A sample of n = 1375 mothers has a sample mean height of 62.45 inches and a sample SD of 2.35 inches. What is the standard error of the sample mean?

A: SE = 2.35 / √1375 ≈ 0.0634 inches.

Q: Using the SE above, construct a 90% confidence interval for the mean mother's height. (Use t ≈ 1.646 for large n.)*

A: 62.45 ± 1.646 × 0.0634 = 62.45 ± 0.104, giving approximately (62.35, 62.55).

Q: You wish to test H₀: μ = 62.75 against Hₐ: μ ≠ 62.75. The sample mean is 62.45 and the SE is 0.0634. What is the t-statistic?

A: t = (62.45 − 62.75) / 0.0634 = −0.30 / 0.0634 ≈ −4.73. This is far into the tails, so the p-value will be very small and you reject H₀.

Q: Explain why a paired t-test, rather than an independent two-sample t-test, is required to compare E[mheight] and E[dheight] in the Heights data.

A: Each row in the data set is one family, so the mother's height and daughter's height are measured on related individuals. They are positively correlated. A paired test uses the within-pair differences, which accounts for the correlation and produces a valid test statistic.

Q: If the SE of the mean in inches is 0.0634, what is the SE when height is measured in feet?

A: 0.0634 / 12 ≈ 0.00528 feet. The SE transforms by the same linear factor as the data.


Connections to Other Topics

These single-variable inference tools reappear throughout regression. The standard error of a regression coefficient is built the same way (estimate / its SE = t-statistic), and every coefficient's CI and p-value follow the logic you practise here. The paired t-test is a special case of simple linear regression with an intercept-only model on the differences. Understanding these foundations makes the leap to multiple regression far smoother.


Related Terms / Search Tags

standard error of the mean, SEM, confidence interval interpretation, t-test, paired t-test, dependent samples t-test, correlated samples, p-value two-sided, hypothesis test one-sample, mheight, dheight, alr4 Heights data, Weisberg Applied Linear Regression Ch 1, STAT 5302, unit conversion standard error, sampling distribution