Linear Regression Fundamentals
- 55Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the goal of the mouse example in linear regression?
Use mouse weight to predict mouse size.
Or swipe the card
55 cards
What is the goal of the mouse example in linear regression?
Use mouse weight to predict mouse size.
What is a residual in linear regression?
The distance between a data point and the fitted line.
How is the sum of squared residuals calculated?
Square each residual—the distance from a data point to the line—and add the squared values.
How can you find the least-squares line by considering different line orientations?
Try different orientations, calculate the sum of squared residuals for each, and compare the results.
Which line is selected by the least-squares method?
The line with the smallest sum of squared residuals.
What two parameters does a simple least-squares line estimate?
The y-intercept and the slope.
What does a nonzero slope suggest in the mouse-weight example?
Mouse weight is related to mouse size and can help predict it.
What are the three main steps emphasized for linear regression?
Fit a line using least squares, calculate R2, and calculate a p-value for R2.
What does SSmean represent?
The sum of squared distances from the data values to their mean.
How do you calculate variation around the mean in the example?
Divide the sum of squares around the mean by the sample size: variation around mean=SSmean/N.
What does SSfit represent?
The sum of squared distances from the data points to the fitted line.
How do you calculate variation around a fitted line?
Divide the sum of squared residuals by the sample size: variation around fit=SSfit/N.
How can variance be understood in terms of a sum of squares?
As the sum of squares divided by the number of observations—the average squared deviation.
What does it mean if variation around a least-squares line is smaller than variation around the mean?
The fitted line leaves smaller residuals, so some of the outcome's variation is explained by the predictor.
What does R2 measure?
The proportion of variation in the outcome explained by the fitted model.
What is the formula for R2 using variation?
R2=variation around meanvariation around mean−variation around fit.
What is the equivalent R2 formula using sums of squares?
R2=SSmeanSSmean−SSfit. The sample-size terms cancel because both variations are divided by the same N.
If variation around the mean is 11.1 and variation around the fit is 4.4, what is R2 approximately?
R2≈0.6, or about 60%. The model reduces variation by about 60%.
If SSmean=100 and SSfit=40, what is R2?
R2=(100−40)/100=0.6, or 60%.
What does an R2 of 1 mean in the examples?
The fitted model predicts the outcome perfectly: the residual variation is zero, so it explains 100% of the variation.
What does an R2 of 0 mean?
The model explains none of the variation beyond what is accounted for by the mean; the variation around the fit equals the variation around the mean.
What line can be used to calculate variation around the mean?
A horizontal line at the mean outcome value, represented by y=mean(y).
Does the idea of R2 apply only to straight-line models?
No. Compare the sum of squared distances from the data to the mean with the sum of squared distances to the model; the idea also applies to more complicated equations.
In the example equation y=0.1+0.78x, what did an R2 of 60% mean?
The model explained 60% of the variation in mouse size using mouse weight.
Why is a three-dimensional plot used when predicting mouse body length from weight and tail length?
There are two predictors—weight and tail length—and one outcome—body length—so the data are represented in three dimensions.
What shape does least squares fit when modeling an outcome with two predictors?
A plane, rather than a line.
In a model predicting body length from weight and tail length, what does the intercept represent?
The predicted body length when both mouse weight and tail length are zero.
In a multiple regression equation, what does each predictor's coefficient represent?
The predictor's contribution to the model's prediction; for example, the weight and tail-length terms have separate coefficients.
How can a fitted multiple regression equation be used?
Substitute a mouse's predictor values, such as its weight and tail length, into the equation to predict its body length.
What does least squares do with a predictor that does not improve the fit?
It can assign that predictor a coefficient of zero, so the predictor has no effect on the model's predictions.
Why can adding predictors never make the best least-squares sum of squared residuals worse?
The expanded model can set the new predictors' coefficients to zero and reproduce the simpler model's fit.
Why can adding irrelevant predictors still make R2 look better?
Extra parameters create more opportunities for random patterns in the data to reduce the sum of squared residuals.
What is adjusted R2 intended to address?
The tendency for ordinary R2 to improve as parameters are added; adjusted R2 accounts for the number of parameters.
Why is an R2 of 100% from only two observations not necessarily meaningful?
A straight line can always connect two points, giving zero residual error and an apparent perfect fit even if the points are unrelated.
Why is a p-value needed in addition to R2?
A high R2 can arise by chance, especially with very little data; the p-value helps assess whether the relationship is statistically significant.
What does the F statistic compare in a regression model?
Variation explained by the model relative to variation left unexplained by the fitted model.
What is the general regression F-statistic formula using sums of squares and degrees of freedom?
F=SSfit/(N−pfit)(SSmean−SSfit)/(pfit−pmean).
How are the numerators of the R2 and F calculations related?
Both use the reduction in variation when the predictors are included: SSmean−SSfit.
What does the residual sum of squares measure in the F statistic?
SSfit measures the variation left unexplained by the fitted model.
What role do degrees of freedom play in the F calculation?
They scale the sums of squares into variance estimates, accounting for the model parameters.
What does pfit count?
The number of parameters in the fitted model.
How many parameters does a simple line with an intercept and slope have?
Two: the y-intercept and the slope, so pfit=2.
How many parameters does the mean-only model have?
One: the intercept, which is the mean outcome, so pmean=1.
For a simple regression with one predictor, what does pfit−pmean equal?
2−1=1. The fitted model adds one predictor parameter beyond the mean-only model.
If a model adds two predictors beyond the intercept, what does pfit−pmean equal?
It equals 2, representing the two additional predictor parameters.
Why is the residual sum of squares divided by N−pfit in the F statistic?
The denominator accounts for the degrees of freedom remaining after estimating the model's parameters.
Why do models with more parameters generally require more data?
More data are needed to estimate more parameters reliably; for example, estimating a line requires fewer points than estimating a plane.
What happens to the F statistic when the model explains a lot of variation and leaves little unexplained?
The F statistic becomes large because its explained-variation component is large relative to its residual-variation component.
Conceptually, how can random data be used to assess an observed F statistic?
Generate random datasets, calculate an F statistic for each, and compare the observed statistic with the resulting distribution.
How is a p-value described in the randomization approach?
The fraction of randomized statistics that are as extreme as or more extreme than the observed statistic.
If the observed F statistic is 6, which example randomized values count as more extreme in the explanation?
Values such as F=6 and F=7 are counted in the example's extreme-value tail.
Why are F distributions used to calculate regression p-values in practice?
They approximate the distribution obtained by repeatedly generating random data, avoiding the need to simulate a very large number of datasets.
What determines the shape of an F distribution used for a regression test?
The degrees of freedom, which depend on the sample size and the number of model parameters.
How can having more samples relative to the number of fitted parameters affect the p-value, as described in the content?
The F distribution can taper off faster, making the p-value smaller for the observed statistic.
What two results are needed for an interesting regression finding?
A large R2 to indicate a substantial relationship and a small p-value to indicate that the relationship is statistically reliable.

Ask anything
We've read this whole study set, so questions about it get the best answers.