Overview

Use linear regression to describe how one variable depends on one or more others, and to predict new values from them. For example, a child’s height depends on their age, so height is the dependent variable and age the independent (predictor) variable. The reverse is not true: age does not depend on height.

This dependence is what distinguishes regression from correlation, which measures how closely two variables vary together without either one depending on the other.

Casewise residuals, leverage and Cook’s distance help to identify outliers and to check the assumptions of the model.

Comparing regressions tests for differences between the slopes of two or more regression lines and, where the slopes don’t differ, between their elevations, with multiple comparison tests to show which lines differ. When slopes do differ, elevations can be compared at an X value you choose.

A scatter plot of a dependent variable (Y) against an independent variable (X), with the fitted regression line Y = 0.72X + 2.45 and dashed 95% confidence bands either side of it, narrowest near the middle of the data.
A fitted regression line with 95% confidence bands.

Methods

  • Simple linear regression
  • Regression through the origin
  • Multiple regression
  • Forward and backward stepwise regression
  • Polynomial regression
  • Weighted regression
  • Comparing slopes and elevations of regressions
  • Residual diagnostics (studentised residuals, leverage, Cook's distance)
  • Normal probability, residual and partial regression plots
  • Confidence and prediction bands

Running the analysis

Click Regression on the statistiXL ribbon and choose Linear Regression or Compare Linear Regressions. In the dialog, select your Y and X variable ranges, any weights and the output location. The Options and Plots pages set the variable selection method, casewise statistics and plots.

The Regression button on the statistiXL ribbon with its menu open, listing Linear Regression (highlighted) and Compare Linear Regressions.
The Regression menu on the statistiXL ribbon.
The General page of the Linear Regression dialog, with boxes for the Y variable, X variable(s) and weights ranges, a Labels in First Row option, an output range, options for descriptive statistics and a correlation matrix, Options and Plots tabs, and the QuickHelp pane on the right.
The Linear Regression dialog, with QuickHelp on the right.

What the output includes

The output depends on whether you fit a regression or compare regression lines.

Linear regression

  • Descriptive statistics and a correlation matrix (optional)
  • A summary with R², R, adjusted R² and the standard error of the estimate
  • The ANOVA table, with F and P for the regression
  • Regression coefficients, with standard errors, standardised coefficients, 95% confidence limits, t and P
  • Each step of a stepwise regression (optional)
  • Casewise residuals, leverage and Cook's distance (optional)
  • Normal probability, residual, scatter and partial regression plots (optional)
Output from a simple linear regression, with residual plots and a scatter plot.
Linear regression output in Excel for pressure against boiling point, with R² of 0.995, an ANOVA table (F of 2964.792, P of 0.000), regression coefficients with 95% confidence limits, and casewise residuals. Beside them are a normal probability plot, a plot of residuals against predicted pressure, and a scatter plot with the regression line and 95% prediction bands.

Comparing regressions

  • The regression results for each line (optional)
  • Tests for differences between the slopes and, where the slopes don't differ, the elevations
  • Multiple comparison tests showing which slopes or elevations differ (optional)
  • A scatter plot of all the regressions (optional)