- Learn
- Mathematics
- Statistics
- Introduction to Statistics
- Simple Linear Regression
Correlation and Simple Linear Regression
BeginnerLesson 12 of 12 in Introduction to Statistics Course
What you will learn
- Use scatterplots and the correlation coefficient to describe how two quantitative variables measured on the same individuals vary together, and know what correlation can and cannot tell you.
- Make and read a scatterplotChoose the explanatory and response variables, plot paired data, and describe the direction, form and strength of the pattern and any unusual points.
- Calculate and interpret the correlation coefficientCompute Pearson's correlation coefficient r by hand and with technology, interpret its sign and size, and use its properties.
- Recognize what correlation cannot showExplain why r describes only linear association and how curved patterns, outliers, a restricted range and averaged data can make it misleading.
- Make and read a scatterplot
- Find the line that best predicts the response from the explanatory variable, interpret its slope and intercept in context, and use it for predictions within the range of the data.
- Find the least-squares regression lineExplain residuals and the least-squares criterion, and compute the regression line from raw data, from summary statistics and with technology.
- Interpret the slope and intercept and make predictionsState what the slope and intercept mean in context with units, predict responses with the line, and recognize the risk of extrapolation.
- Find the least-squares regression line
- Use residuals, the standard deviation of the residuals, the coefficient of determination and checks for outliers and influential points to decide whether a straight-line model is useful.
- Analyze residuals and residual plotsCompute residuals, read a residual plot for curvature and changing spread, and use the standard deviation of the residuals as the typical prediction error.
- Interpret the coefficient of determinationCompute r squared from sums of squares or from r, interpret it as the share of variation explained, and avoid its common misreadings.
- Identify outliers and influential pointsDistinguish regression outliers, high-leverage points and influential points, measure their effect by refitting, and decide how to handle them.
- Analyze residuals and residual plots
- Treat the sample regression line as an estimate of a population line, check the conditions for inference, test whether the population slope is zero, and estimate the slope with a confidence interval.
- State the regression model and check its conditionsDescribe the population regression model, check its conditions with plots of the data and residuals, and state what the design allows you to conclude.
- Test whether the population slope is zeroCarry out and interpret the t test for the slope and the equivalent test for the correlation, read regression output, and separate statistical from practical significance.
- Estimate the slope with a confidence intervalConstruct and interpret a confidence interval for the population slope and connect it with the test of zero slope.
- State the regression model and check its conditions
- Explain why correlation alone does not establish causation, recognize the other explanations for an association, and carry out and report a complete correlation and regression analysis.
- Distinguish correlation from causationIdentify reverse causation, lurking and confounding variables and coincidence as alternatives to causation, and explain what evidence does support a causal claim.
- Carry out and report a complete regression analysisCombine every step, from plot to conclusion, into one analysis, write it up clearly, and evaluate published claims about relationships.
- Distinguish correlation from causation
Simple Linear Regression study guide
1Describe the relationship between two quantitative variables
Paired measurements let you ask how two quantities vary together. A scatterplot shows the shape and unusual features; correlation summarizes the direction and strength of the linear part. Choosing the variables and naming the cases carefully keeps those descriptions meaningful. Changes in range, group averaging, and isolated points can alter the reported strength, so the plot and the number need to be read together.
1.1 Make and read a scatterplot
A scatterplot keeps each person's two measurements together. It shows the relationship before a single number or fitted line compresses it.
Choose the variables and build the plot
Suppose we want to predict exam score from weekly study time. Study time is the explanatory variable, also called the predictor or independent variable. It goes on the horizontal axis as . Exam score is the response variable, also called the outcome or dependent variable. It goes on the vertical axis as . These roles describe the prediction question; the word “explanatory” alone makes no causal claim.
For six students, the pairs are (2, 62), (4, 68), (5, 71), (7, 75), (8, 83), and (10, 85). The first pair means one student studied 2 hours and scored 62 points. Plot one dot at that location, then repeat for the other five students. Label the axes “Weekly study time (hours)” and “Exam score (points).” Choose scales that include every point. The axes need not start at zero.
Keep the pairs intact. Sorting the hours and scores separately would change who earned each score and could manufacture a relationship. Leave the dots unconnected: the order of the students is not a sequence of changes over time. If the question treats two variables equally, as with the heights of siblings, either variable can go on either axis.
Describe four features
Begin with direction. A positive association rises from left to right: larger study times tend to go with higher scores. A negative association falls: older used cars of one model tend to have lower prices. Association means knowing one measurement helps describe the likely value of the other.
Next name the form. Points may follow a straight line, a curve, or separate clusters. A curve can show a very strong relationship. For example, scores could rise from low to moderate anxiety and then fall at high anxiety. Calling that pattern simply “positive” would miss half of it. A shapeless cloud has no clear association; a curved cloud has a pattern even if it has no single upward or downward direction.
Describe strength by how closely points follow their form. The six study pairs lie close to a rising straight line, so a suitable description is: “Weekly study time and exam score have a strong, positive, roughly linear association among these students.” Strength concerns closeness to the form, not steepness. A shallow, tight band can show a stronger relationship than a steep, scattered cloud. Axis scales can change the visual impression, so a numerical measure helps check linear strength.
Finally, look for unusual features: isolated points, gaps, and clusters. A student with an ordinary study time and an ordinary score could still be unusual if that combination sits far from the trend. Separate clusters may represent different groups. If car data combine two models, different colors or symbols can show whether each model follows its own pattern.
Key Takeaways
- Keep each case’s two measurements together as one plotted point.
- Put the explanatory variable on the horizontal axis and label both axes with units.
- Describe direction, form, strength, and unusual features in context.
- A tight curve can be strong; a steep line can be weak.
1.2 Calculate and interpret the correlation coefficient
Pearson's correlation coefficient, , puts a number on the direction and strength of a linear association between two quantitative variables. Its sign describes direction; its distance from zero describes linear strength.
Both variables need nonzero variability; if either is constant, correlation is undefined.
Calculate from deviations
Subtract each variable's mean from its observations. Let , , and . Then
For the study data, the means are 6 hours and 74 points. The hour deviations are −4, −2, −1, 1, 2, 4. The score deviations are −12, −6, −3, 1, 9, 11. Multiply within each pair: 48, 12, 3, 1, 18, 44. Their sum is 126. The squared deviations sum to 42 for hours and 392 for scores. Thus
Why do the products help? A point above both means, or below both means, contributes a positive product. A point above one mean and below the other contributes a negative product. Large deviations have more weight. It is the sum of these products, not simply a count of points in each region, that sets the sign.
Calculate with standardized values
A z-score expresses a deviation in standard-deviation units. With sample standard deviations,
Here and . The first student's standardized product is about 1.870. All six products sum to about 4.910; dividing by 5 gives about 0.982. Use several decimal places while working and round the final correlation. Early rounding can change the result.
Interpret the number
Correlation ranges from −1 to 1. Values near either endpoint describe points close to a straight line. Exactly 1 or −1 means every point lies on one straight line with nonzero slope. Near zero means little linear association. As a rough introductory guide, magnitudes above about 0.8 are strong, about 0.5–0.8 moderate, and below about 0.5 weak. These labels depend on the field; a value of 0.3 can matter in social science.
For these students, say: “There is a very strong positive linear association between study time and exam score, with .” Correlation is not a percentage and is not a change in points per hour.
Know what stays the same
Correlation has no units. Swapping the variables leaves it unchanged. Converting hours to minutes, or Celsius to Fahrenheit, also leaves it unchanged because these conversions multiply by a positive number and may add a constant. Multiplying one variable by a negative number reverses its sign.
Technology can do the arithmetic: a spreadsheet's CORREL function uses the paired numeric ranges. Some regression output labels the nonnegative magnitude “Multiple R”; recover direction from the slope. Job title is categorical, so assigning job titles numeric codes does not make Pearson correlation an appropriate measure of their relationship with salary.
Key Takeaways
- Pearson’s r measures linear direction and strength on a scale from −1 to 1.
- The sign of the sum of paired deviation products determines the sign of r.
- Correlation is unitless and unchanged by swapping variables or positive unit conversions.
- Negative correlations can be strong: compare magnitudes.
- Keep precision during calculation; interpret the result using the variable names.
1.3 Recognize what correlation cannot show
A correlation compresses a whole scatterplot into one number. That makes it convenient, but it also hides form, unusual points, and information about who was measured.
A small correlation can hide a strong curve
Consider anxiety levels 1, 2, 3, 4, 5 and scores 70, 85, 90, 85, 70. Scores rise and then fall in a symmetric arch. The positive and negative deviation products cancel, giving exactly. The relationship is clear, but its linear association is zero.
The reverse problem also occurs: a gentle curve can give a correlation above 0.9. A high value alone cannot establish that a straight line describes the form well. Start with the scatterplot and examine the residual plot after fitting a line. A curved pattern in residuals exposes changes the line misses.
One point can change the result
Correlation is not resistant: unusual points can alter it substantially. In the six-student example, . Adding a student who studies 6 hours and scores 95 lowers it to about 0.701. That point adds vertical scatter near the center of the study times.
A different addition has the opposite effect. A student at (14, 98) lies far to the right but on the existing trend. Adding that student raises the correlation to about 0.992. An extreme point can make a relationship appear tighter as well as looser. Plot suspicious observations and compare results with and without them before deciding how much weight to place on the number.
Check the range and the cases
A restricted range often weakens correlation. Across all applicants, admission scores may vary widely and help predict first-year grades. Among admitted students only, scores occupy a narrower high band. The correlation in that selected group is typically weaker because much of the useful spread in scores has disappeared. Its value describes that range, not every possible applicant.
An ecological correlation uses group averages or rates as its cases. For example, each point might be a state's average income and average life expectancy. Averaging smooths out differences between individuals, so these correlations are often stronger than individual-level correlations. A relationship between states describes states. Applying its strength to individual residents can overstate how closely their own measurements go together.
Separate strength, size, and evidence
A correlation of −0.9 is just as strong as 0.9; its direction is different. Neither value tells you how many dollars, points, or minutes the response changes. That change also depends on the spreads and units of the variables, which enter the regression slope.
Sample size matters for inference. A large correlation among very few cases can occur by chance, and a small correlation in a large sample can be statistically significant. Also, correlation alone cannot distinguish a causal effect from reverse causation, a third variable, or coincidence. A useful account includes the plot, the cases and range, and the study design alongside .
Key Takeaways
- Zero correlation means zero linear association; a strong curve may remain.
- Check plots even when the correlation is large.
- Outliers, range restriction, and group averaging can change the reported strength.
- A correlation between groups describes those groups, not their individual members.
- Correlation gives neither a slope with units nor a causal conclusion.
- Sample size affects how much evidence a sample correlation provides.
2Fit and use the least-squares regression line
A fitted line turns an observed pattern into a rule for predicting an average response. Finding that line requires a definition of prediction error and a way to compare all the errors at once. Its slope and intercept then need the variables’ units to have meaning. The same equation can give a reasonable estimate inside a measured range and an impossible answer far beyond it.
2.1 Find the least-squares regression line
A regression line predicts a response from an explanatory value. Least squares chooses the line by comparing its vertical prediction errors across all the observations.
Measure a miss with a residual
Write the fitted line as . The hat means “predicted”: is the observed response and is the value on the line at that observation's . Some calculators and textbooks write the same equation as .
The residual is . If a student scores 75 and the line predicts 77, the residual is −2 points. The line overpredicts. A positive residual puts the observation above the line and means the line underpredicts.
The least-squares line minimizes , the sum of squared residuals. Squaring prevents positive and negative errors from canceling. It also gives large misses extra weight: an error of 4 contributes 16, while an error of 2 contributes 4. The distances are vertical because the task is to predict the response, not minimize sideways or perpendicular distances.
Find slope, then intercept
From raw data, compute the means, paired deviation products, and squared explanatory deviations. The formulas are
For the study data, the numerator is 126 and the denominator is 42. Thus points per hour. Since the means are 6 hours and 74 points, points. The fitted equation is .
With summary statistics, use . For used cars, let age have mean 5 years and standard deviation 2.5 years; price has mean $14,200 and standard deviation $4,000, with . Then dollars per year. The intercept is dollars, giving .
Check the fit's basic properties
The fitted line passes through . Substituting 6 hours into the study line gives 74 points, the mean score. Least-squares residuals add to zero for a line with an intercept. That cancellation is a property of the fit, not evidence that the errors are small.
Because the standard deviations are positive, the slope has the same sign as . In standardized units, the prediction follows . An explanatory value one standard deviation above its mean predicts a response standard deviations from its mean, with direction set by the sign.
Keep the prediction direction straight
Correlation is symmetric, but regression is directional. Predicting study time from score requires a new fit. Its slope is about 0.321 hours per point, not the reciprocal of 3. Reversing a fitted equation gives the reverse regression only for a perfect linear association.
In a spreadsheet, SLOPE(y_range, x_range) and INTERCEPT(y_range, x_range) take the response first. In output, the “Intercept” or “Constant” row gives , and the explanatory-variable row gives .
Key Takeaways
- A residual is observed minus predicted; its sign locates the point relative to the line.
- Least squares minimizes the sum of squared vertical residuals.
- Calculate the slope first, then use the means to find the intercept.
- The fitted line passes through the point of means and its residuals sum to zero.
- Fit a new regression when you reverse the prediction direction.
2.2 Interpret the slope and intercept and make predictions
A fitted equation becomes useful when its numbers are translated into the variables' units. A prediction describes an average pattern, with individual responses scattered around it.
Give the slope a direction and units
For , study time is measured in hours and score in points. The slope is 3 points per hour. Say: “For each additional weekly study hour, the predicted exam score is 3 points higher.” The word “predicted” matters: a student who studies 8 hours may score 83 even though the line predicts 80.
The car line is . Here the slope is −1,360 dollars per year of age. A suitable interpretation is: “For each additional year of age, the predicted price of a car of this model is $1,360 lower.” Observational data support an association. They do not isolate what would happen to the very same car if only its age changed while every other feature stayed fixed.
Slope uses response units per explanatory unit. Converting study time from hours to minutes changes the slope from 3 points per hour to points per minute. Correlation stays about 0.982. This is why a slope's size alone cannot tell you the strength of a relationship.
Interpret the intercept where it makes sense
The intercept is the predicted response at , in response units. In the study line it is 56 points. The students studied between 2 and 10 hours, so zero hours is outside the measured range. The intercept fixes the height of the line, but these data do not give a dependable prediction for a student who never studies.
For cars, $21,000 at age zero could describe the predicted price of a new car only if the data include cars near age zero and the linear pattern fits there. Always ask whether zero is meaningful and supported by nearby observations. You can use an intercept to calculate fitted values even when it has little practical meaning on its own.
Substitute and check the range
At 6 study hours, points. At 8 years of car age, , or $10,120. Write the variable values and units beside the answer so the calculation remains tied to the question.
Interpolation predicts for an explanatory value inside the observed range. Extrapolation predicts outside it. The line has no built-in knowledge of how the relationship changes beyond the data. At 20 study hours it predicts 116 points, impossible on a 100-point exam. Beyond about 15.4 years, the car line predicts a negative price. These results expose a failure of extending the line, not a reason to force real outcomes to follow it.
A value inside the range is a better starting point, but also check the residual plot and any influential observation. A line driven by one isolated point may describe the remaining cases badly. Use the standard deviation of the residuals to describe typical prediction error; a fitted average is not a guaranteed individual result.
Key Takeaways
- Interpret slope as the change in the predicted response per one explanatory unit.
- The intercept predicts the response at zero; check whether zero is meaningful and supported.
- Convert slope units when measurement units change; correlation stays unchanged under positive conversions.
- Predictions outside the measured explanatory range are extrapolations.
- Individual responses vary around the fitted average.
- Use observational language unless the design supports causation.
3Judge how well a line fits the data
A line can summarize much of a relationship and still miss an important feature. Residuals reveal where the predictions go wrong, their standard deviation gives the errors a practical scale, and R-squared compares the fit with predicting the mean. Unusual observations need their own investigation because a point can change the line that is supposed to reveal it.
3.1 Analyze residuals and residual plots
Residuals show what the fitted line leaves unexplained. Their pattern helps judge the line's shape, while their overall size describes the scale of its prediction errors.
Work through the six predictions
Using , the study times 2, 4, 5, 7, 8, and 10 hours give predictions 62, 68, 71, 77, 80, and 86 points. Subtract these from the observed scores 62, 68, 71, 75, 83, and 85. The residuals are 0, 0, 0, −2, 3, and −1 points.
For the 7-hour student, the residual is : the line predicts 2 points too high. For the 8-hour student it is : the line predicts 3 points too low. The residuals sum to zero, even though three predictions miss. Their sum cannot measure how accurate the predictions are.
Read a residual plot
Plot each residual on the vertical axis and its explanatory value on the horizontal axis. Add a horizontal reference line at zero. Fitted values can also serve as the horizontal variable. Do not use observed response values there: that choice can create a misleading trend.
A roughly patternless cloud above and below zero, with similar vertical spread across the plot, supports a linear model. A curve means the model misses the form. For instance, positive residuals at both ends and negative residuals in the middle mean the line underpredicts at the ends and overpredicts in the middle.
A fan shape means the scatter changes with the explanatory value. If the fan widens toward larger values, predictions are less precise there. Even if the center follows a line, unequal spread violates the equal-variance condition for the usual slope-inference procedures. A single isolated residual may also signal a point worth investigating.
A large correlation cannot replace this check. A smooth bend can produce a large correlation and a clear residual curve at the same time. With six cases, the residual pattern supplies limited evidence; a small plot that looks random offers support without establishing every model condition.
Put prediction error into response units
Square the residuals and add them:
The standard deviation of the residuals is
We divide by because fitting the intercept and slope uses two estimated quantities. This differs from using the sample-size divisor or the divisor for an ordinary sample standard deviation.
Say: “Exam-score predictions from study time are typically off by about 1.9 points.” This is a measure of typical size, not a maximum miss or a statement that every error equals 1.9. Software may label it “S,” “residual standard error,” or “standard error of the estimate.” Compare its size with what matters in the setting. An error of 1.9 exam points may be useful; the same number of another response's units could have a very different practical meaning.
Key Takeaways
- Plot residuals against the explanatory variable or fitted values, with zero as a reference.
- A residual curve signals a missed shape; a fan signals changing variability.
- Compute s as the square root of SSE divided by n − 2.
- Interpret s as typical prediction error in response units.
3.2 Interpret the coefficient of determination
The coefficient of determination compares a fitted line with a simple baseline: predicting the mean response for every case. It measures the share of response variation accounted for by the linear relationship.
Compare two sums of squares
Without an explanatory variable, predict each response using . The squared misses add to the total sum of squares, . With the fitted line, the squared residuals add to . The coefficient of determination is
The fraction is the share left unexplained. Subtracting it from 1 gives the share explained by the line. In simple least-squares regression with an intercept, this quantity also equals the square of the sample correlation. Software often labels it R-squared or and displays it as a percentage.
For the study scores, the deviations from the mean score of 74 are −12, −6, −3, 1, 9, 11. Their squares add to . The squared residuals add to 14. Therefore
About 96.4% of the variation in scores among these six students is explained by their linear relationship with weekly study time. The remaining 3.6% is variation the line does not explain. “Explained” here describes a reduction in squared prediction errors; it does not identify a causal mechanism.
Interpret the percentage precisely
For the car example, gives . About 72% of the variation in price is explained by the linear relationship with age. This does not mean 72% of cars lie on the line, 72% of predictions are correct, or age causes 72% of a price change.
Squaring removes direction. To recover correlation from , take the square root and use the slope's sign. With and a negative slope, . A coefficient of determination of 0.5 requires a correlation magnitude of about 0.707, not 0.5. Conversely, a correlation of 0.5 explains 25% of the variation.
Combine it with the other checks
A value of 1 means every observation lies on the fitted line. A value of zero means the fitted line does no better than the mean-response baseline. A high value can still hide a curve or the effect of an influential observation. A low value can accompany a statistically significant slope in a large sample.
Use both and . The first is a unitless relative improvement over the baseline. The second measures typical misses in response units. A report such as “ and points” tells you both how much variation the line explains and how large its individual prediction errors typically are.
Key Takeaways
- Compute the explained share as 1 − SSE/SST, or square r in simple regression.
- Interpret r² as a share of response variation, not a share of points or correct predictions.
- Use the slope’s sign when recovering r from r².
- Report r² alongside s: relative fit and error size answer different questions.
- A high r² still requires checks of shape and unusual observations.
3.3 Identify outliers and influential points
An unusual point can matter in several different ways. Its vertical distance, horizontal position, and effect on the fitted result answer different questions.
Distinguish three ideas
A regression outlier has a large residual: it lies unusually far above or below the fitted line. A rough screening rule flags a residual whose magnitude reaches about . This is a reason to investigate a point, not a reason to delete it.
A high-leverage point has an explanatory value far from the mean of the explanatory values. Its horizontal position gives it the potential to pull the line toward itself. An influential point is one whose removal substantially changes the slope, intercept, or correlation. To assess actual influence, fit the model with and without the point and compare the results.
| Feature | What to examine | What it tells you |
|---|---|---|
| Outlier | Vertical residual | The response is far from its prediction. |
| High leverage | Position in the explanatory range | The point can pull the fitted line. |
| Influence | Results after removing the point | The point actually changes the analysis. |
Follow a point near the middle
Add (6, 95) to the study data. Six hours is the old mean study time, so this point has no unusual horizontal position. The new line is . Its slope stays 3, but the intercept rises from 56 to 59 and correlation falls from about 0.982 to 0.701.
At 6 hours, the new prediction is 77 points. The added student's residual is points. Since the new residual standard deviation is about 8.85, twice that is about 17.7; the point is flagged. A point near the mean explanatory value can change the intercept and correlation substantially without changing the slope.
Follow points far from the middle
Adding (14, 98) extends the study range along the old trend. The slope stays 3 and correlation rises to about 0.992. High leverage can strengthen an apparent linear association.
Adding (20, 66) instead pulls the line toward a low score at a very large study time. The slope falls to about 0.14 and correlation to about 0.10. Yet this added point's residual in the new fit is only about −8.6: the line has moved toward it. A point can be influential without having the largest residual. Its effect is visible by comparing fits, not by ranking residuals alone.
Investigate before changing the data
First check records and measurements. Correct a confirmed entry error. If the point is valid, keep its information in view. Deleting a case merely because it weakens the correlation changes the population the analysis describes and can distort the result.
A documented difference may justify a separate analysis: a student who already passed the same exam may belong to a different group from first-time candidates. Explain any exclusion or separation. For an influential observation, report the fits with and without it and describe how the conclusion changes. Keep predictions within a well-supported range, especially when one isolated explanatory value stretches the apparent range.
Key Takeaways
- An outlier has a large residual; leverage concerns horizontal position.
- Influence is an actual change in the fit when a point is removed.
- A high-leverage point on the trend can increase the magnitude of correlation.
- An influential point can have a modest residual because it pulls the line toward itself.
- Correct errors and explain exclusions; never remove a valid case just to improve the fit.
- Compare and report fits with and without influential observations.
4Make inferences about the slope of a regression line
A fitted slope varies from sample to sample. Regression inference uses that variability to test a population claim and estimate a plausible range for the true mean change. The calculations rely on conditions about shape, independence, and scatter around the line. Reading the correct output row and interpreting uncertainty in context are as important as computing the statistic.
4.1 State the regression model and check its conditions
A sample line estimates a population relationship. Inference describes uncertainty from taking a sample, so it needs a model of how responses vary and a study design that supports the intended conclusion.
Separate the fitted line from the population line
The fitted line is . Its coefficients are sample statistics: a different random sample generally produces a different slope. The population mean line is . The Greek coefficients are unknown population parameters.
The regression model writes an individual response as
The error is the individual's random deviation from the population mean line. It has mean zero and standard deviation , the same at every explanatory value. The sample residual standard deviation estimates this population scatter. A residual is measured from the fitted line; a model error is measured from the unknown population line.
Check LINE
The usual t procedures for a slope rely on four conditions, remembered as LINE:
- Linear: the mean response follows a straight line. Check the scatterplot and look for a curve in the residual plot.
- Independent: observations do not depend on one another. Use knowledge of sampling or assignment, not just a plot.
- Normal: at each explanatory value, responses vary normally around their mean line. Inspect a histogram or normal probability plot of the residuals for strong skewness or unusual values.
- Equal variance: the scatter around the line is similar across the explanatory range. A fan in the residual plot is evidence against it.
The normal condition concerns variation around the line. Neither the predictor nor all the responses pooled together need have a normal distribution. Evenly spaced predictor settings in an experiment can meet the regression model.
Use the design as evidence
For sampling without replacement, a common independence rule of thumb keeps the sample below about 10% of the population. Measurements collected over time need special care: neighboring months may resemble one another, so treating them as separate independent observations can understate uncertainty. Random sampling supports independence; it does not repair repeated measurements on the same case.
A random sample supports generalization to the sampled population. Random assignment of explanatory values in an experiment supports causal conclusions. These are different roles for randomness. A sample of cars listed for sale describes that population, not every car ever manufactured.
Suppose 25 cars of one model are randomly sampled from nationwide sale listings. Their plot is roughly linear, residuals have even spread with no curve, and the residual histogram is roughly symmetric with no outliers. These checks reasonably support inference for the age slope in that listing population.
Moderate departures from normality are often tolerable, especially with larger samples. Strong skewness in a small sample and influential observations remain serious concerns. A large sample does not fix a curved mean pattern or dependence between cases. Check the conditions before interpreting a p-value or confidence interval.
Key Takeaways
- Sample coefficients estimate unknown population coefficients.
- The error term describes variation around the population mean line; residuals use the fitted line.
- Check linearity, independence, normal errors, and equal variance for slope inference.
- Assess independence from study design and normality from residuals.
- Random sampling supports generalization; random assignment supports causal inference.
4.2 Test whether the population slope is zero
A nonzero sample slope may reflect a population relationship or sampling variation. The slope t test compares the fitted change with its standard error to assess evidence against a zero population slope.
State the population hypotheses
For a two-sided test use and . The null says the population mean line is horizontal: the predictor adds no linear change in mean response. A directional alternative, or , must be chosen before seeing the data.
Check the regression conditions first. The test statistic and its degrees of freedom are
The standard error estimates how much fitted slopes vary across samples. Calculate it as
Smaller residual scatter or more spread in predictor values makes the slope more precise. A larger sample also generally improves precision. The residual standard deviation measures individual scatter in response units; the slope standard error measures uncertainty in response units per predictor unit.
Calculate and conclude
For 25 used cars, the slope is −1,360 dollars per year and its standard error is 175.7 dollars per year. Thus with 23 degrees of freedom. The two-sided p-value is about , reported as . At a 0.05 significance level, reject zero slope. There is very strong evidence of a negative linear relationship between age and mean price in the population sampled.
Under the null model, the p-value is the chance of a t statistic at least as extreme as the observed one in the directions covered by the alternative. It is not the probability that the null hypothesis is true.
The same test can use correlation:
Testing zero population correlation gives the same t statistic and decision as testing zero slope in simple linear regression under the corresponding model conditions. With and only six cases, the statistic is about 1.96 with four degrees of freedom and a two-sided p-value near 0.12. A fairly large sample correlation need not give convincing evidence in a tiny sample.
Read output without overstating it
Use the row named after the explanatory variable. It lists the slope, standard error, t statistic, and usually a two-sided p-value. The intercept row tests whether the population intercept is zero; that is a different question. Output rounded to “0.000” represents a very small p-value, not an impossible event with probability zero. Report .
For a prespecified one-sided test, halve a two-sided p-value when the fitted slope points in the alternative's direction. If it points the other way, halving would incorrectly reward evidence against the chosen direction.
Statistical significance does not establish a large, useful, or causal effect. With 400 cases and , the p-value is about 0.003, but : just 2.25% of response variation is explained. Judge practical value from the slope, its units, residual error, and context. Failure to reject zero slope leaves uncertainty; it does not establish that no relationship exists, especially if a curve or small sample is involved.
Key Takeaways
- Test the population slope, not the sample estimate or intercept.
- Divide the fitted slope by its standard error and use n − 2 degrees of freedom.
- The correlation and slope tests of zero give the same t statistic in simple regression.
- Use the explanatory-variable row and check whether software reports a two-sided p-value.
- Choose a directional alternative before examining the result.
- A small p-value can accompany a small explained share and limited practical value.
- Failure to reject zero slope leaves uncertainty about the population relationship.
4.3 Estimate the slope with a confidence interval
A test asks whether the population slope differs from zero. A confidence interval adds a range of plausible slope values, showing the estimated size, direction, and precision of the relationship.
Build the interval
Use the fitted slope and its standard error:
Choose the confidence level, then find the critical value from a t distribution with degrees of freedom. The margin of error is the critical value times the slope's standard error. Use the same regression conditions as for the slope test.
For the car example, dollars per year, dollars per year, and . At 95% confidence with 23 degrees of freedom, . The margin is dollars per year. Thus
Both endpoints are negative. In plain language: “We are 95% confident that mean price for cars of this model decreases by about $997 to $1,724 per additional year of age.” Keep the population and units in the statement. The negative slope values describe a decrease; reversing their order carelessly can make the verbal range confusing.
Say what confidence refers to
The population slope is fixed but unknown. The sample, and therefore its interval, would change under repeated sampling. A 95% confidence method captures the true population slope in about 95% of intervals across many repetitions of the sampling process.
The interval concerns a change in the mean response per explanatory unit. It does not mean 95% of individual cars lose between those dollar amounts each year, nor does it give a price interval for a particular car. The same car may also differ in mileage and condition; the slope summarizes the sampled relationship with age.
Connect the interval and test
A 95% interval excluding zero agrees with rejecting zero slope in a two-sided test at the 0.05 level. An interval containing zero agrees with not rejecting at that level. This connection requires the same model, standard error, and two-sided procedure. The car interval is entirely below zero, agreeing with the small p-value and clarifying the likely size of the negative slope.
A broad interval may contain both practically small and large changes. A narrow interval estimates size more precisely, but precision alone does not make the effect important. Compare the range with the setting's meaningful changes.
Understand what controls width
A higher confidence level requires a larger critical value and produces a wider interval. More scatter around the line increases the residual standard deviation, then the slope standard error and interval width. Less spread in explanatory values also increases slope uncertainty. With comparable scatter and predictor spread, a larger sample narrows the interval.
When a study can choose explanatory values, spreading them over an appropriate range helps estimate slope. It does not justify extrapolating the fitted relationship beyond that range. Report the age range along with a car-slope interval so readers know where the estimated mean change applies.
Key Takeaways
- Build a slope interval with b₁ ± t*SE using n − 2 degrees of freedom.
- Interpret its endpoints as plausible population mean changes with units.
- Confidence describes the long-run capture rate of the interval method.
- At matching levels, excluding zero agrees with a two-sided rejection of zero slope.
- Higher confidence and greater residual scatter widen an interval; more information narrows it.
5Judge claims about cause and effect and report an analysis
A strong statistical relationship still leaves a question about how it arose. Study design helps separate a useful prediction from a supported cause-and-effect claim, while possible third variables and reverse causation offer competing explanations. A complete report combines that reasoning with the fitted equation, fit checks, uncertainty, population, and measured range.
5.1 Distinguish correlation from causation
An association is a pattern in measurements. A causal claim goes further: changing one variable produces a change in the other. The size of a correlation or the smallness of a p-value alone cannot make that step.
Consider competing explanations
Suppose students who study more tend to earn higher scores. Studying might improve performance. More motivated students might also study more and prepare in other ways. A high score on an earlier exam might encourage later study. Observational pairs cannot separate all these possibilities on their own.
Reverse causation means the response may help drive the proposed explanatory variable. A city with more recorded crime might hire more police. A correlation between police numbers and crime could therefore reflect the city's response to crime, instead of an effect of police on crime.
A lurking variable is omitted from the analysis but affects the relationship. Hot weather can increase both ice cream sales and swimming, creating an association between ice cream sales and drowning deaths. Confounding means effects on the response cannot be separated. If coffee drinkers also smoke more, their coffee and smoking habits are confounded in an observational comparison of lung cancer outcomes. A coffee association cannot be assigned entirely to coffee from that comparison.
Coincidence is another possibility. Searching enough unrelated variable pairs can uncover impressive sample correlations by chance. Shared trends can also make variables track one another: smartphone use and house prices might both rise over many years without one causing the other. The passage of time and wider economic changes offer alternative explanations.
Ask what the study design contributes
A randomized controlled experiment assigns explanatory conditions at random. Random assignment balances lurking factors between groups on average. A clear difference or significant slope under that design supports a causal interpretation of the assigned condition's effect.
Random sampling serves another purpose: it supports generalization to the sampled population. Randomly choosing people for an observational survey does not randomly assign their habits. A survey can therefore support a population association while leaving causal explanations unresolved.
Experiments are not always possible or ethical. Observational causal evidence becomes more convincing when findings recur across studies, the proposed cause precedes the effect, greater exposure goes with greater response, a plausible mechanism exists, and competing explanations are ruled out. The causal case for smoking and lung cancer draws on converging evidence of this kind.
Match the wording to the evidence
For observational study data, write: “Students who studied more tended to score higher,” or “Study time predicts exam score.” Avoid turning an observed slope into “Every extra hour raises a student's score by 3 points.” The second wording claims an intervention effect and an exact individual outcome that the fitted association does not supply.
Association can be a useful first clue for causal research. It is not worthless just because it leaves alternatives open. Likewise, zero linear correlation cannot rule out every causal effect: the response might curve with the predictor, or a third variable might mask the effect in the combined data.
Key Takeaways
- A causal claim concerns what happens when a variable is changed.
- Consider reverse causation, lurking variables, confounding, and coincidence.
- Random assignment supports causal interpretation; random sampling supports generalization.
- Converging observational evidence can build a causal case when experiments are unavailable.
- Use association and prediction language for observational regression.
- Zero linear correlation can hide curved or masked effects.
5.2 Carry out and report a complete regression analysis
A complete regression report explains the question, the evidence, and the limits in one connected account. The numbers should let a reader judge both the relationship and the usefulness of the predictions.
Follow the analysis from question to conclusion
Start by identifying the cases, where they came from, and how many there are. Name the explanatory and response variables with units. Plot the paired data, then describe direction, form, strength, and unusual features. If the form is roughly linear, calculate correlation and fit the least-squares line.
Check the residual plot for a curve or changing spread. Report the residual standard deviation and coefficient of determination: one gives typical prediction error in response units, the other gives explained variation relative to predicting the mean. Investigate unusual points and compare fits when a case may be influential.
For sample data, check the inference conditions before testing zero slope or giving a slope interval. Finish with a contextual conclusion about the sampled population and the measured explanatory range. Use causal language only when the study design or additional evidence supports it.
A curved plot calls for describing the curve, not using one line as the complete summary. Distinct clusters call for examining groups separately. A result driven by one point needs an explicit comparison of the fit with and without that point.
Read a connected example
“In a random sample of 25 used cars of one model, price had a strong, negative, linear association with age, with . Predicted price in dollars was . The linear relationship explained about 72% of price variation, and predictions were typically off by about $2,150. The slope test gave with 23 degrees of freedom and . A 95% interval estimated a mean price decrease of about $997 to $1,724 per additional year of age. The data were observational; age also tends to accompany higher mileage, so this is an association, not an isolated effect of age.”
A finished report also states the actual sampled age range and what the residual checks showed. Those details cannot be supplied by the fitted coefficients. The example's numerical results alone are not a substitute for them.
Evaluate a published claim
Ask how the data were obtained. Was the explanatory condition randomly assigned, or were existing differences observed? Was the sample representative of the population named in the conclusion? Are the cases individuals or group averages?
Then ask what the result amounts to. A small p-value can coexist with a tiny explained share. Look for the slope's units, its confidence interval, and typical prediction error. Check whether the claim extends beyond the observed range, whether an unusual point drives it, and whether many relationships were searched before this one was selected.
For example, a claim that countries with higher chocolate consumption win more Nobel prizes per person concerns countries, not individual chocolate eaters. Wealth could be related to both consumption and research resources. The observational association cannot justify a claim that eating chocolate makes an individual a prize winner.
Key Takeaways
- State cases, source, sample size, variables, units, and measured explanatory range.
- Use plots and influence checks before trusting fitted coefficients or inference.
- Report slope, correlation, explained variation, and residual error together.
- When using inference, include t, degrees of freedom, p-value, and a slope interval.
- Match the population and causal wording to the design.
- Check published claims for group averages, extrapolation, and selective searching.
Simple Linear Regression examples
1Read the relationship before using a number
14 steps
- 1IntroductionStart with paired measurements
A researcher records weekly study hours and exam scores for six students. Each student contributes a pair, so the data can show how the quantities vary together (an association). We will first read their pattern on a scatterplot, then measure its linear strength with correlation, and finally examine ways that a single number can hide important features.
- 2ExampleGive each variable a job
We want to predict score from study time. Put study hours on the horizontal axis as the explanatory variable and exam score on the vertical axis as the response.
The pairs are (2, 62), (4, 68), (5, 71), (7, 75), (8, 83), and (10, 85). Plot one point per student, keeping each pair intact. Label hours and points on the axes; leave the dots unconnected.
- 3ExplanationDescribe more than direction
The study points rise from left to right and stay near a straight line. Describe a strong, positive, roughly linear association between study time and score.
Also inspect gaps, clusters, and isolated observations. Strength means closeness to the pattern. Changing an axis scale can make a band look steeper, but steepness itself does not measure strength.
- 4ChallengeRead a different pattern
Older laptops tend to have shorter battery life, with points tightly following a downward curve. How would you describe direction, form, and strength?
---reveal---
The association is negative, curved, and strong. Battery life tends to fall as age increases, and the tight curve makes the relationship strong. Calling it weak because it is not straight would confuse form with strength.
- 5ExplanationMeasure the linear part
Pearson’s measures linear direction and strength, from −1 to 1. A sign tells you upward or downward; magnitude tells you how close the association is to a straight line.
A value near −1 can be as strong as a value near 1. Correlation has no units and gives no points-per-hour change. It summarizes the paired pattern after accounting for both variables’ scales.
- 6ExampleFind the paired deviation products
The study means are 6 hours and 74 points. Hour deviations are −4, −2, −1, 1, 2, 4; score deviations are −12, −6, −3, 1, 9, 11.
Multiply within pairs to get 48, 12, 3, 1, 18, 44. Their sum is 126. Same-sign deviations give positive products; opposite-sign deviations give negative products. Product sizes matter, so counting signs alone would not determine correlation.
- 7ExampleStandardize the total
The squared hour deviations sum to 42 and squared score deviations sum to 392. Divide the paired-product sum by the geometric scale:
This indicates a very strong positive linear association for the six students. It is not “98.2% correlated.” Using paired sample z-scores gives the same result by adding their products and dividing by 5.
- 8ChallengeCalculate and keep the sign
A data set has paired deviation products summing to −36, squared x deviations summing to 16, and squared y deviations summing to 100. What is its correlation?
---reveal---
The negative sign describes a downward direction. Its magnitude indicates strong linear association; it does not mean the relationship is weak.
- 9Key InsightSeparate scales from the relationship
Converting hours to minutes leaves correlation unchanged. Swapping predictor and response also leaves it unchanged. Positive changes of units alter scales, but their effects cancel when values are standardized.
A negative multiplier on just one variable reverses correlation’s sign. Changing units may change a regression slope later, so keep correlation and slope distinct.
- 10ExampleSee a pattern that correlation misses
Consider anxiety levels 1, 2, 3, 4, 5 paired with scores 70, 85, 90, 85, 70. The points form a clear arch, but symmetry makes the linear correlation exactly zero.
The score first rises, then falls. Those opposing parts cancel in the deviation-product calculation. Zero linear association therefore leaves room for a strong curved relationship.
- 11ExplanationAsk which cases the number describes
A correlation can change when one unusual observation is added or when predictor values are restricted to a narrow band. Averages can also hide variation: a correlation of district averages describes districts.
The same number cannot simply be assigned to their residents. Identify the cases and measured range before comparing correlations from different samples.
- 12ChallengeJudge a large correlation with a curve
A scatterplot has but shows a visible bend. An analyst reports “a straight line fits because correlation is high.” What should change?
---reveal---
The analyst should examine the bend and check the residual plot before using one line. A gently curved pattern can have a large correlation. The number summarizes linear association but cannot establish that a line captures the relationship’s form.
- 13ChallengeRead the cases before the conclusion
Average income and average spending have a strong correlation across neighborhoods. Why is this insufficient to describe an individual resident’s spending from income?
---reveal---
Each case is a neighborhood average, and averaging hides differences among residents. The strong association describes differences between neighborhoods. Individual spending predictions require individual-level evidence, alongside a check of the relationship’s form.
- 14RecapKeep the plot and number together
A useful description names the cases and variables, then gives direction, form, strength, and unusual features. Correlation adds a unitless measure of linear strength.
Before applying it, check for a curve, unusual observations, a restricted range, and group averaging. The graph retains information that the number compresses.
2Build a line and use it in context
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionTurn a pattern into a prediction
- 2ExplanationDefine a prediction error
- 3ExplanationWhy square the misses?
- 4ExampleCalculate the slope
- 5ExampleUse the means to set the height
- 6ChallengeFit a new set from summaries
- 7Key InsightReversing the question changes the fit
- 8ExplanationTranslate the slope into words
- 9ExampleSubstitute, then check support
- 10ChallengeInterpret a change and a prediction
- 11ChallengeChange units without changing predictions
- 12RecapMake the equation answer the question
3Check what the fitted line misses
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionCheck shape and error size separately
- 2ExampleCompute each residual
- 3ExplanationLook for patterns around zero
- 4ExampleCalculate typical prediction error
- 5ChallengeCalculate and interpret s
- 6ExplanationCompare the line with the mean
- 7ExampleExplain the share in context
- 8ChallengeRecover direction after squaring
- 9ExplanationSeparate distance from influence
- 10ExampleWatch a point move the line
- 11ChallengeRespond to a suspicious point
- 12ChallengeJudge two kinds of evidence together
- 13RecapUse the checks for their own jobs
4Use sample slopes as population evidence
16 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionDistinguish evidence from certainty
- 2ExplanationSeparate the two lines
- 3ExplanationCheck shape and scatter
- 4ExplanationCheck independence and normal errors
- 5ChallengeCheck the right distribution
- 6ExplanationAsk a population question
- 7ExplanationMeasure uncertainty in the slope
- 8ExampleCalculate the test statistic
- 9TipRead the predictor row
- 10ChallengeCompute a test from another sample
- 11ConnectionThe correlation gives the same test
- 12ExampleBuild a slope interval
- 13ExplanationInterpret confidence as a method
- 14ChallengeConnect an interval to a decision
- 15ChallengeDecide whether significance is enough
- 16RecapReport the mean change and its uncertainty
5Judge a claim and write the report
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionAsk what a relationship supports
- 2ExplanationConsider more than one causal direction
- 3ExampleFind a shared explanation
- 4ChallengeUse a plausible competing explanation
- 5ExplanationTell two kinds of randomness apart
- 6ChallengeMatch wording to the design
- 7ExplanationBuild the report from evidence
- 8ExampleRead a report’s numerical core
- 9TipAsk what the headline leaves out
- 10ChallengeRepair an overreaching report
- 11RecapMake the conclusion traceable
Simple Linear Regression practice questions
Set 1: Read patterns and measure association10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Fit a line and interpret its predictions10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Check residuals and unusual observations10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Test and estimate a population slope10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Judge conclusions and combine the evidence10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Association
B
Bivariate quantitative data
C
Causation
Coefficient of determination
Confidence level
Confounding
Critical t value
D
Degrees of freedom
Deviation product
E
Ecological correlation
Ecological fallacy
Equal variance condition
Explained variation
Explanatory variable
Extrapolation
F
Fan-shaped residual pattern
Fitted value
H
High-leverage point
I
Independence condition
Influential point
Intercept
Interpolation
L
Least-squares regression line
Linearity condition
Lurking variable
M
Margin of error
Model error
P
P-value
Pearson correlation coefficient
Perfect linear association
Point of means
Population regression line
Population slope
Practical importance
R
Random assignment
Random sample
Refitting
Regression outlier
Residual
Residual plot
Residual standard deviation
Resistance
Response variable
Restricted range
Reverse causation
S
Scatterplot
Scope of inference
Selective searching
Slope
Slope confidence interval
Slope standard error
Slope t statistic
Standardized value
Statistical significance
Sum of squared errors
T
Total sum of squares
U
Unexplained variation
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.