Opens in a new tab

METHOD GUIDE

Simple Linear Regression in R
Reading summary() and the Diagnostic Plots

The summary() printout reports a lot, and the slope is only one line of it. The plots drawn from the same model, read beside that table, show whether a straight line describes the data and so what the slope can be taken to mean.

IN SHORT

What the Fitted Line Estimates and What to Read First

Simple linear regression models the mean of a continuous outcome as a straight-line function of one predictor, and estimates how much the outcome differs on average for a one-unit difference in the predictor. To run simple linear regression in R, fit the model with the lm function in R as lm(outcome ~ predictor, data = d), read the coefficient table from summary(), add confint() for the intervals and draw the plots from plot(). The slope is an association unless the design supports a causal reading, and the line describes the observed range of the predictor only. OnlineSPSS, a specialist statistical consultancy for academic, clinical and professional research, carries out and reviews this analysis through an in-house PhD-level statistician.

ANALYSIS SUPPORT

Analysis Support for This Method

The model takes one line of code, so the real work lies in whether one predictor is enough and whether a straight line is the right shape for it.

Simple Linear Regression

The one-predictor model for your data, with the diagnostics, the interval for the slope and the wording of the result settled before the analysis starts.

Explore Simple Linear Regression
Multiple Linear Regression

A model with several predictors, for when other variables must be held fixed or when one predictor alone is unlikely to account for the outcome.

Explore Multiple Linear Regression

BEFORE YOU RUN IT

What the Model Needs Before lm() Is Called

The fitted line always exists, so the questions that decide whether it is meaningful concern the outcome, the predictor and the cases, and the fit answers none of them.

An Outcome Measured on a Scale The outcome is measured on a continuous scale. A binary outcome calls for logistic regression and a count for a count model, and lm() fits both without complaint but not appropriately.

A Meaningful Zero The intercept is the predicted outcome at a predictor value of zero. If zero lies outside the data or has no meaning, centering the predictor gives an intercept that can be interpreted.

Independent Cases Each row is a separate case. Repeated measures on one person, or pupils within a class, make residuals related, and the printed standard errors are then too small.

The Observed Range The line describes the range of predictor values that were observed. A prediction beyond it assumes the straight line continues, which the data cannot confirm.

IN R

How to Run Simple Linear Regression in R

The model, the table and the plots are all part of base R, so no add-on is needed to reproduce this output. Packages such as effectsize or sandwich are optional and cited with their versions.

  1. Confirm the design: one continuous outcome, one predictor and one row per case.
  2. Draw plot(d$x, d$y) and look at the shape before fitting anything.
  3. Fit fit <- lm(y ~ x, data = d) and print summary(fit).
  4. Add confint(fit) for the 95 percent intervals of the intercept and the slope.
  5. Draw the regression diagnostic plots in R with par(mfrow = c(2, 2)) followed by plot(fit).
  6. Save the script, the plots and the R version with the results.

READING THE OUTPUT

The summary(lm) Table and the Four Plots

Two printouts describe one model: the text from summary() reports estimates and fit, and the plots show whether the line was an appropriate summary.

Output element What it tells you What to check
Residuals A five-number summary of observed minus fitted values That an extreme minimum or maximum is traced to a case and not ignored
Coefficients: Estimate and Std. Error The intercept and the slope, each with its standard error That the slope is stated in outcome units per unit of the predictor
t value and the p column The test of each coefficient against zero That a significant intercept is not presented as a finding
Residual standard error The typical size of a residual in outcome units, with its degrees of freedom That the degrees of freedom equal the number of cases minus 2
Multiple R-squared and Adjusted R-squared The share of outcome variance associated with the predictor That R squared is not used to judge whether the model is correct
F-statistic and its p-value The test of the whole model, which with one predictor repeats the test of the slope That the two p-values agree and only one test is reported
Residuals vs Fitted and Scale-Location Curvature and changing spread of the residuals across the fitted values That a smooth curve or a funnel shape is followed up and not dismissed
Q-Q plot and Residuals vs Leverage Residual normality, and points with high leverage or influence, with Cook’s distance contours That each flagged case is traced by its row number to the raw data before any decision about it

REPORTING

Reporting the Slope in Outcome Units

The sentence leads with the estimate and its interval, because the units of the slope carry a meaning that R squared cannot.

Write b = ___, 95% CI [___, ___], t(df) = ___, p = ___, with df taken from the residual standard error line and the slope stated in units of the outcome per unit of the predictor. Add R² = ___ and the number of cases after missing values, since lm() drops incomplete rows and notes the number deleted below the coefficients. Give a standardized slope only if the audience needs it; with one predictor it equals Pearson’s r, which summary() does not print. Say which diagnostic plots were examined and what was done about any case that was flagged. Describe the slope as a difference between cases, since an observational design does not show what changing the predictor would do.

Slope With IntervalUnits StatedR² and nPlots ExaminedAssociation Wording

COMMON MISTAKES

Misreadings That Survive a Clean-Looking Summary

Each of these can sit behind a table of small p-values, and most are visible in the plots that were never drawn.

Normality Tested on the Wrong Thing A normality test applied to the raw variables checks the wrong quantity. The assumption concerns the model's errors, so the residuals are examined, and with larger samples spread and influence matter more than shape.

A Line Imposed on a Curve A significant slope does not show that a straight line fits. A curved band in the Residuals vs Fitted plot means the model misses structure, and a transformation or a curvature term is considered.

Intercept Reported as a Finding A small p-value for the intercept says only that the fitted value at a predictor of zero differs from zero, which is rarely a research question. It is reported as the anchor of the line.

R Squared as a Verdict A high R squared does not validate a model and a low one does not make a slope unimportant. Fit statistics are read beside the diagnostics and never above them.

Influential Point Dropped Silently A point with high leverage and a large residual can tilt the slope. Dropping it without saying so changes the analysis, so the model is reported as fitted and the effect of the case is shown separately.

Confidence Band Read as Prediction Range predict() with interval = "confidence" gives the uncertainty of the mean outcome at a predictor value, and interval = "prediction" gives the much wider range for a single new case. A band drawn for one is not described as the other.

Plots drawn but never read against the table? Independent Statistical Review checks the coefficient table, the diagnostics and the wording of the slope as they sit beside the plots.

Request an Assessment

FREQUENTLY ASKED QUESTIONS

Questions About summary(lm) and Its Plots

The answers start with two p-values that always agree, continue with a contour line that is often misread, and end on the intercept.

With one predictor, the F test of the model and the t test of the slope are the same test, and F equals t squared. The two p-values therefore agree exactly, and reporting both adds nothing. With several predictors the F test becomes a joint test of all the slopes, and it no longer matches any single coefficient.

They are contours of Cook’s distance, drawn at 0.5 and 1 by default, and a point beyond a contour has a larger influence on the fitted line. The contours may not appear when no point comes close to them. They are rules of thumb, not tests, so any point that stands apart is examined as a case and the model is re-fitted without it to see how far the slope moves.

The intercept is the predicted outcome when the predictor equals zero, which is often outside the observed range. Centering the predictor at its mean, or at a meaningful reference value, leaves the slope and its test unchanged and turns the intercept into the predicted outcome at that value. State the centering in the methods.

An in-house PhD-level statistician compares the coefficient table with the diagnostics, judges whether influential cases or curvature change the reading, and can also run the model on your data. For presenting settled estimates, see Results Reporting & Interpretation. What the slope means for your field is yours to state.

Your data and project details are handled confidentially, and project information is not published. Researcher names and institutions are not used publicly without permission. An NDA is available where required and can be arranged before sensitive materials are shared. Read more about confidentiality and data security.

You share your research question, design and relevant materials, such as the dataset or the output you have, and a statistically trained Research Coordinator reviews the request and responds the same day. The analysis, deliverables, timeline and one fixed project fee are then confirmed before any work begins, so the timeline follows from the agreed scope.

Still have a question? Find more answers in our full FAQ.

View All FAQs →

NEXT STEP

Do the Plots Support the
Slope You Plan to Report?

One influential case or an unmodeled curve can change what a slope is allowed to claim. Asking for a second look at your summary() output and plots commits you to nothing until the scope is settled.

No Commitment Required

Strictly Confidential

Fixed Project Fee

In-House PhD-Level Statisticians

Same-Day Response

Serving Researchers Since 2014