What Is a Linear Relationship? Definition and Examples

A linear relationship is a connection between two variables that changes at a constant rate, producing a straight line when plotted on a graph. If you double one quantity, the other changes by the same fixed amount every time. This predictability is what makes linear relationships one of the most fundamental concepts in math, statistics, and everyday problem-solving.

The Basic Formula

Every linear relationship can be written in the form y = mx + b. In this equation, y is the output (the thing you’re solving for), x is the input (the thing you’re changing), m is the slope (how much y changes each time x increases by one), and b is the y-intercept (the starting value of y when x equals zero).

A simple example: say you’re buying a car that costs $17,000. You make a $5,000 down payment and then pay $240 per month. The relationship between your total amount paid and the number of months looks like this: 17,000 = 5,000 + 240m. The slope is 240 (each month adds exactly $240), and the intercept is 5,000 (your starting payment). That constant $240 per month is what keeps this relationship linear.

Another example: if someone runs 2 miles every day, the total distance after x days is y = 2x. The slope is 2, the intercept is 0, and the graph is a straight line climbing steadily from the origin. No matter which two days you compare, the rate of change is always the same.

Why “Constant Rate of Change” Matters

The defining feature of a linear relationship is that the rate of change between the two variables never shifts. Every time x goes up by one unit, y goes up (or down) by the same fixed amount. This is the slope, and it stays identical no matter where you are on the line.

Compare that to a nonlinear relationship. If your savings account earns compound interest, the amount of money you gain each year grows over time because interest builds on previous interest. The rate of change keeps accelerating, and the graph curves upward. In a linear relationship, there’s no curving. The line is straight because the pace of change is locked in.

This distinction has a practical consequence: linear relationships are proportional in a specific way. Doubling the input doubles the change in the output. If you work twice as many hours at a flat hourly rate, you earn twice as much. Nonlinear relationships break that rule. In a power law relationship, for instance, doubling one quantity multiplies the other by some fixed number that isn’t two.

Positive, Negative, and Zero Relationships

Linear relationships come in three directions:

  • Positive: Both variables increase together at a constant rate. On a graph, the line rises from left to right. More hours worked means more pay earned.
  • Negative (inverse): One variable increases while the other decreases. The line falls from left to right. A car’s remaining fuel drops steadily as miles driven goes up.
  • Zero (no relationship): Changes in one variable have no consistent effect on the other. Data points scatter randomly with no clear line through them.

How It Looks on a Graph

When you plot data with a linear relationship on a graph, the points cluster tightly around a straight line. If the relationship is strong, the points practically sit on the line. If it’s weak, the points spread out more, though a general upward or downward trend is still visible. When there’s no relationship at all, the points look randomly scattered with no pattern.

In real data, points rarely fall on a perfectly straight line. Instead, analysts draw a “line of best fit,” a straight line positioned to get as close to all the data points as possible. The tighter the points hug that line, the stronger the linear relationship.

Measuring the Strength With Correlation

The correlation coefficient, often written as r, puts a number on how strong a linear relationship is. It ranges from -1 to +1. A value of +1 means a perfect positive linear relationship (every point falls exactly on an upward line), and -1 means a perfect negative one. A value of 0 means no linear connection at all.

Here’s a general guide for interpreting r values:

  • 0.90 to 1.00: Very high correlation
  • 0.70 to 0.90: High correlation
  • 0.50 to 0.70: Moderate correlation
  • 0.30 to 0.50: Low correlation
  • 0.00 to 0.30: Negligible correlation

The same thresholds apply to negative values. An r of -0.85 is just as strong as +0.85; it simply means the line slopes downward.

A related measure, R-squared (R²), tells you the proportion of change in one variable that’s explained by the other. An R² of 0.75 means 75% of the variation in y can be predicted from x. The closer R² is to 1, the better the linear model fits the data. An R² of 0 means the relationship explains none of the variation, which is equivalent to drawing a flat horizontal line through the data.

Everyday Examples

Linear relationships are everywhere once you start looking for them. Unit conversions are perfectly linear: every mile is always 1.609 kilometers, so converting between the two is a straight line through the origin. Flat-rate pricing works the same way. If peanuts cost $2.50 per bag, the total cost is always 2.50 times the number of bags, no bulk discounts or surcharges.

Monthly payment plans are linear. A phone bill with a $30 base fee plus $5 per gigabyte of data creates the equation y = 5x + 30. The relationship between Celsius and Fahrenheit is linear: F = 1.8C + 32. Driving at a constant speed produces a linear relationship between time and distance. Even something as simple as “Maya is always 3 inches taller than Geoff” is linear: y = x + 3.

In economics and business, analysts frequently model income and consumer spending as linear relationships. Quarterly growth rates in personal income and personal spending in the US, for example, have been studied as linear pairs to forecast economic trends. The relationship isn’t perfectly linear in reality, but a straight-line model often captures enough of the pattern to be useful.

When a Relationship Isn’t Linear

Not every connection between two variables follows a straight line. Population growth, compound interest, and the spread of a virus tend to be exponential: the rate of change itself keeps growing. The trajectory of a thrown ball follows a parabola, which is quadratic. The key test is simple: if you plot the data and the points form a curve rather than a line, or if the rate of change between data points keeps shifting, the relationship is nonlinear.

Sometimes a relationship looks roughly linear over a small range but curves over a larger one. Your body burns calories at a fairly steady rate during a moderate jog, but push into a sprint and the rate jumps. This is why context and range matter when deciding whether a linear model is appropriate.

Checking Whether Your Data Is Truly Linear

If you’re working with real data and want to confirm a linear relationship, start by making a scatterplot. The points should form an obvious straight-line pattern rather than a curve or a fan shape. Beyond that visual check, statisticians look for a few additional conditions to ensure a linear model is reliable.

The spread of data points should stay roughly the same across the entire range of x values. If the points fan out like a megaphone (tight on one end, scattered on the other), the variance isn’t consistent and a simple linear model may mislead you. The individual errors (the distances between each point and the line) should also be roughly normally distributed, meaning most points are close to the line with only a few far away, and those far-off points aren’t clustered on one side. Finally, each data point should be independent, meaning the value of one observation doesn’t influence another. Time-series data, where today’s value depends on yesterday’s, can violate this assumption.

None of these checks require advanced math. A scatterplot and a histogram of residuals (the gaps between predicted and actual values) will reveal most problems visually before you ever run a formal test.