Linear Regression Fundamentals
- 48Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What are the three main steps or quantities emphasized in linear regression?
48 questions
- 1
What are the three main steps or quantities emphasized in linear regression?
Model answer
Fit a line using least squares, calculate R2, and calculate a p-value for R2.
Explanation
These steps describe fitting the relationship, assessing how much variation it explains, and assessing whether the result is statistically significant.
- 2
In the mouse example, which variable is used to predict which other variable?
Model answer
Mouse weight is used to predict mouse size.
Explanation
The fitted line represents a way to estimate a mouse’s size from its weight.
- 3
What is a residual in linear regression?
Model answer
A residual is the distance between an observed data point and the value predicted by the fitted line.
Explanation
Residuals measure the prediction errors left after fitting the line.
- 4
How does the least-squares method compare candidate lines?
Model answer
For each line, it squares each residual and adds the squared residuals; it selects the line with the smallest total.
Explanation
Squaring and summing the residuals gives the sum of squared residuals, which least squares minimizes.
- 5
Why is the method called least squares?
Model answer
It chooses the fitted line that has the least sum of squared residuals.
Explanation
Different candidate lines produce different sums of squared residuals, and the least-squares line minimizes that quantity.
- 6
What does the slope of a fitted line indicate in the mouse weight and size example?
Model answer
It represents the relationship between mouse weight and mouse size; a nonzero slope means weight can help predict size.
Explanation
The line’s slope is the parameter that captures how the predicted size changes with weight.
- 7
What two parameters does a simple least-squares line estimate?
Model answer
It estimates a y-intercept and a slope.
Explanation
The intercept sets the line’s value when the predictor is zero, while the slope describes the predictor’s relationship to the response.
- 8
How does the least-squares fitting procedure find a good line, as described in the content?
Model answer
It considers different line rotations, calculates the sum of squared residuals for each, and selects the rotation with the smallest sum.
Explanation
Plotting each rotation against its sum of squared residuals makes the minimizing rotation identifiable.
- 9
How is variation around the mean calculated in the mouse-size example?
Model answer
Calculate each mouse’s distance from the mean size, square the distances, and sum them; divide that sum by the sample size to obtain the variation.
Explanation
The sum is called the sum of squares around the mean, or SSmean, and the content defines variation as SSmean/N.
- 10
How is variation around a fitted line calculated?
Model answer
Square and sum the distances between the observed data and the fitted line, then divide by the sample size.
Explanation
The sum of squared distances is SSfit, so the variation around the fit is SSfit/N.
- 11
How does the content interpret variance in terms of squared deviations?
Model answer
Variance is the sum of squared deviations divided by the number of observations, so it is an average of squared deviations.
Explanation
For the mean or fitted line, the relevant deviations are from that mean or line, respectively.
- 12
What does it mean for a fitted line to explain some of the variation in mouse size?
Model answer
The residual variation around the fitted line is smaller than the variation around the mean, so using mouse weight accounts for part of the variation in size.
Explanation
In the example, heavier mice tend to be bigger and lighter mice tend to be smaller.
- 13
What does R2 measure?
Model answer
R2 measures the proportion of variation in the response that is explained by taking the predictor or predictors into account.
Explanation
It compares variation around the mean with the smaller or equal variation remaining around the fitted model.
- 14
Give the formula for R2 in terms of variation around the mean and variation around the fit.
Model answer
R2=VmeanVmean−Vfit, where Vmean is variation around the mean and Vfit is variation around the fitted model.
Explanation
The numerator is the reduction in variation achieved by fitting the model, and the denominator is the original variation around the mean.
- 15
Why can R2 be calculated using sums of squares instead of variations in the examples described?
Model answer
Both variations are their corresponding sums of squares divided by the same sample size, so the common division by N cancels in the R2 calculation.
Explanation
Thus the ratio can be calculated directly from SSmean and SSfit.
- 16
If variation around the mean is 11.1 and variation around the fit is 4.4, what is R2 and how should it be interpreted?
Model answer
R2=11.111.1−4.4≈0.6, so about 60% of the variation is explained by the predictor.
Explanation
This also means the variation is reduced by about 60% when the predictor is taken into account.
- 17
What does R2=1 indicate in the example where variation around the fitted line is zero?
Model answer
The fit predicts the observed response values perfectly, so the model explains 100% of the variation.
Explanation
With no residuals, variation around the fitted line is zero and all the original variation is accounted for.
- 18
What does R2=0 indicate in the example where variation around the fit equals variation around the mean?
Model answer
The predictor explains none of the variation in the response, because fitting the model does not reduce the variation.
Explanation
When the two variations are equal, the numerator of the R2 formula is zero.
- 19
Can R2 be used only for a straight-line model?
Model answer
No. It can be calculated for any equation by comparing the sum of squared distances from the data to the mean with the sum of squared distances from the data to the equation.
Explanation
The same comparison applies even when the fitted equation is more complicated than a line.
- 20
In the example using mouse weight to predict mouse size, what does R2=0.6 mean?
Model answer
It means mouse weight explains 60% of the variation in mouse size.
Explanation
Equivalently, taking weight into account reduces the variation in size by 60% in that example.
- 21
Why is a plane fitted when predicting body length from both mouse weight and tail length?
Model answer
The two predictors add two dimensions to the response relationship, so the least-squares fit is a plane rather than a line.
Explanation
The body length is represented as the response, while weight and tail length are the two predictors.
- 22
In a model predicting body length from weight and tail length, what does the plane’s y-value represent?
Model answer
The y-value represents predicted body length.
Explanation
Weight and tail length are used as inputs to predict this response.
- 23
In the plane equation described, what do the intercept and the two predictor coefficients represent?
Model answer
The intercept is the predicted body length when weight and tail length are both zero; the coefficients describe the model’s terms for weight and tail length.
Explanation
The example gives a weight coefficient of 0.7 and a tail-length coefficient of 0.5.
- 24
How can a fitted plane be used to predict a particular mouse’s body length?
Model answer
Substitute that mouse’s weight and tail length into the plane equation to calculate its predicted body length.
Explanation
The fitted equation combines the predictor values with its estimated parameters to produce the prediction.
- 25
What happens to an added predictor in a least-squares model if it cannot reduce the sum of squared residuals?
Model answer
Least squares can assign that predictor a coefficient of zero, making it have no effect on the prediction.
Explanation
For example, if tail length adds no useful fit, its term can effectively disappear from the equation.
- 26
Why can adding predictors make the sum of squares around the fit no worse?
Model answer
The larger model can set the coefficients of unhelpful added predictors to zero, reproducing the smaller model’s fit.
Explanation
The more complex model includes the option of the simpler model, so its minimum sum of squared residuals cannot be larger.
- 27
Why might adding irrelevant predictors nevertheless produce a better-looking R2?
Model answer
By random chance, an irrelevant predictor may align with the data and reduce the fitted sum of squares, increasing R2.
Explanation
Each extra term creates another opportunity for random patterns in the data to improve the apparent fit.
- 28
What is adjusted R2 intended to address?
Model answer
Adjusted R2 accounts for the number of parameters in the model, helping address the tendency of ordinary R2 to improve when extra predictors are added.
Explanation
The content describes it as scaling R2 according to the number of parameters.
- 29
Why does a perfect R2 from only two data points not demonstrate a meaningful relationship?
Model answer
A straight line can always be drawn through any two points, so the fit has no residuals and gives R2=1 even for two random points.
Explanation
The perfect fit in this situation does not by itself show that a genuine relationship exists.
- 30
Why is a statistical test needed in addition to calculating R2?
Model answer
A high R2 can occur by chance, especially with very little data, so a test is needed to assess whether the apparent relationship is statistically significant.
Explanation
The content introduces a p-value for R2 to help assess this significance.
- 31
What does the F statistic compare when testing a fitted model?
Model answer
It compares the variation explained by the model with the variation not explained by the model.
Explanation
The explained variation is the reduction in variation after fitting; the unexplained variation is represented by the residuals.
- 32
How is the variation explained by a fitted model represented using sums of squares?
Model answer
It is the reduction from SSmean to SSfit, namely SSmean−SSfit.
Explanation
This is the same improvement in fit that forms the numerator of the R2 calculation.
- 33
How is the variation not explained by the fitted model represented?
Model answer
It is represented by the sum of squared residuals around the fitted model, SSfit.
Explanation
Residuals are the distances between observed values and the fitted line or model.
- 34
What role do degrees of freedom play in the F statistic?
Model answer
They divide sums of squares by the relevant degrees of freedom to convert them into variance estimates.
Explanation
The numerator and denominator use different degrees-of-freedom quantities based on the model parameters and sample size.
- 35
What does pfit count, and what is its value for a simple line with an intercept and slope?
Model answer
pfit is the number of parameters in the fitted model; for an intercept and slope, it equals 2.
Explanation
The intercept and slope are separate parameters.
- 36
What does pmean count, and why does the mean-only model have pmean=1?
Model answer
pmean counts the parameters in the mean model; the model y=mean has only one parameter, its intercept.
Explanation
The mean model is a horizontal line determined by a single value.
- 37
In a simple regression with one predictor, what does pfit−pmean represent?
Model answer
It equals 1, the one additional parameter—the slope—that represents the predictor’s relationship with the response.
Explanation
The fitted line has two parameters while the mean-only model has one.
- 38
If a model uses two predictors in addition to an intercept, what is pfit−pmean?
Model answer
It equals 2, because the fitted model has three parameters and the mean-only model has one.
Explanation
The two additional parameters represent the two predictors.
- 39
State the F-statistic structure described for comparing a fitted model with the mean model.
Model answer
F=SSfit/(N−pfit)(SSmean−SSfit)/(pfit−pmean).
Explanation
The numerator measures explained variation per additional model parameter, while the denominator measures residual variation per remaining degree of freedom.
- 40
Why does the denominator of the F statistic divide residual sum of squares by N−pfit rather than simply by N?
Model answer
The fitted parameters use information from the data, so the residual variation is adjusted for the number of fitted parameters.
Explanation
The denominator estimates unexplained variation using the remaining degrees of freedom, N−pfit.
- 41
How does the number of model parameters relate to the amount of data needed to estimate a model?
Model answer
More parameters require more data to estimate; for example, the content notes that two points can estimate a line, while three are needed to estimate a plane.
Explanation
Each additional parameter requires information from the data to be estimated.
- 42
Under what conditions does the content say the F statistic becomes large?
Model answer
It becomes large when the model explains a substantial amount of variation while leaving relatively little unexplained variation.
Explanation
That creates a large ratio of explained variation to residual variation.
- 43
How can the p-value for an observed F statistic be understood conceptually?
Model answer
Generate many random datasets under the null situation, calculate an F statistic for each, and find the fraction that are as extreme as or more extreme than the observed statistic.
Explanation
The p-value is the number of equally or more extreme simulated values divided by the total number of simulated values.
- 44
In the example with an observed F=6, which simulated outcomes count toward the p-value?
Model answer
Simulated F values of 6 or greater count as at least as extreme as the observed value.
Explanation
The example identifies simulated values of 6 and 7 as being included in the extreme-value count.
- 45
Why can an F distribution be used instead of generating an enormous number of random datasets?
Model answer
The distribution approximates the results of repeated random datasets and can be used to calculate the p-value directly.
Explanation
In practice, the relevant F distribution replaces the repeated simulation procedure.
- 46
What determines the shape of the F distribution used to calculate a p-value?
Model answer
Its degrees of freedom determine its shape.
Explanation
The degrees of freedom depend on quantities such as the sample size and the number of fitted parameters.
- 47
According to the content, how does having more samples relative to the number of fitted parameters affect the p-value?
Model answer
With more samples relative to the number of fitted parameters, the F distribution tapers off faster and the p-value can be smaller for the observed statistic.
Explanation
The content illustrates this by comparing distributions with different sample sizes and residual degrees of freedom.
- 48
What does R2 communicate, and what does the p-value communicate?
Model answer
R2 quantifies how much variation the model explains, while the p-value assesses the statistical significance of the relationship.
Explanation
The content recommends looking for a large R2 and a small p-value; both are needed for an interesting result.

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