R Tutorial : Variability of coefficients

A visual walkthrough of what makes regression slopes bounce around across different samples. Using bike-trail data, the video shows how small samples (n=10) produce wildly different lines while larger ones stabilize, how tighter data around the true line reduces slope variability, and how removing extreme predictor values actually increases it because those outliers anchor the fit.
Chapters
In the previous example, you found the linear model output for a data set regressing the volume of bicycle riders on the external high temperature. As already pointed out, the variability associated with the slope is given in the output as the standard error. In the next few exercises we will investigate which parts of the model drive the variability of the sampling distribution of the slope. Using a data set taken from a bike trail in Massachusetts available in the Mosaic package in R, we've plotted the high temperature for the day and the volume of bicycle riders on the trail. The original regression of volume on high.
Temperature shows a reasonably strong positive linear association.
However, there is likely some variability associated with the difference between the sample and the population.
The source of the sample variability is what we will investigate in the next few exercises. In the images above, we consider the rail trail data again, but this time we've repeatedly sampled from the original data with smaller sample sizes. N equals 10 on the left and n equals 50 on the right. We can see that with very small sample sizes like n equals 10, the variability of the lines is much higher than with samples of size n equals 50. The original data set had 90 observations and so is likely to be even less variable in selecting from the population than the image on the right.
Here the data themselves have been modified such that the tighter data is less variable around the line. When samples of size 50 are taken from the tighter sample, each sample is mostly representative of the same model and so the lines vary much less than the lines given by samples from the original data. Now the data have been modified to have fewer observations in the extreme range of the X variable high temperature, that is there are no days in the low 50s or high 80s. The effect of a more narrow data set is to cause the variability in the regression lines to increase somewhat. Counterintuitively, the variability in the slope increases as the variability in the high temperature decreases. This is because the extreme values of high temperature no longer act as an anchor for the model. Thanks for following along with this video. To practice you will work with a hypothetical population. The population will change in specific ways that demonstrate when the sampling distribution is more or less variable.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







