Interactive demo · Introduction to Mathematical Statistics · Chapter 11

The sampling distribution of the least squares estimates

In the simple linear model Yi = β0 + β1xi + εi the x values are fixed and only the errors are random. Choose where to put the twelve (or n) x values and how noisy the data are, and draw thousands of data sets (here β0 = 2 and β1 = 1). The top panel is the histogram of the least squares slope, with the normal curve of Theorem 11.3.2; the middle panel is the pivot (β̂1 − β1)/(S/√Sxx) against the Student t curve with n − 2 degrees of freedom; the bottom panel plots the estimated intercept against the estimated slope. The table compares the theory with the simulation and reports how often the 95% intervals for the slope, for the mean response at x0 and for a new observation at x0 contain their targets.

Placement of the x values

Sample size n

Error standard deviation σ

Quantile in the intervals

Point x0 for the mean and the new observation

Simulated data sets

Try these

Every draw uses a seeded generator, so a preset always shows the same values; 20 000 data sets give a coverage to about ±0.003. The histograms clip values beyond the plotted range (the count is shown). β0 = 2, β1 = 1 throughout.

In the lecture notes