A linear relationship is the simplest way two quantities can move together. One changes at a steady, unchanging rate as the other changes, so the graph is a straight line. The idea reaches well past math class, into springs, crickets, and factory budgets. Most real data only comes close to a straight line, though, so much of using the idea well is judging how close is close enough.
The Key Idea Is a Constant Rate of Change
A function with a constant rate of change is a linear function, and its graph is a straight line.1Mathematics LibreTexts. What Is a Linear Relationship? Definition and Examples No matter where you check the rate on a straight line, you get the same answer.2MathBitsNotebook. What Is a Linear Relationship? Definition and Examples If adding 1 hour adds $15 in pay, the 10th hour adds $15 just like the first.
You can spot this in a table of numbers. First check that the x values go up in equal steps, such as 1, 2, 3, 4. Then subtract each y from the next one. If the differences are all the same, the relationship is linear. If they grow or shrink as you move down the table, the pattern is curved.
Linear does not mean always increasing. A line can slope downward, like the fuel left in a tank as the miles pass. A flat line, where nothing changes at all, is linear too. What matters is the steadiness of the change, not its direction.
Linear is also a wider category than proportional. A proportional relationship starts at zero, like the price of apples by weight: no apples, no cost. A linear one can start elsewhere, like a taxi ride with a base fare charged before the first mile. Every proportional relationship is linear, but not every linear one is proportional.
Reading the Equation y = mx + b
A linear function can be written y = mx + b.1Mathematics LibreTexts. What Is a Linear Relationship? Definition and Examples Here m is the slope, the rise over run, which is the change in y divided by the change in x.2MathBitsNotebook. What Is a Linear Relationship? Definition and Examples The letter b is the y-intercept, where the line crosses the vertical axis, the value of y when x is 0.1Mathematics LibreTexts. What Is a Linear Relationship? Definition and Examples
Take a phone plan that costs $20 a month plus $5 per gigabyte. Here m is 5 and b is 20, so y = 5x + 20. Using 3 gigabytes costs 5 times 3 plus 20, or $35. Graphed, the line starts at 20 and climbs 5 for every gigabyte.
To find the rate of change from two points on a line, pick any two. Subtract the y values and the x values in the same order, then divide the y difference by the x difference. A negative result means the line slopes downward. The larger m is, ignoring its sign, the steeper the line, and an m of zero gives a flat one.
Once you know m and b, you can predict any value by substituting x, multiplying, and adding. When a problem gives you a rate and a starting amount in words, “per” usually signals m, and “to start with” or “flat fee” usually signals b.
Everyday Examples of Linear Relationships
Springs are the classic case. The force needed to stretch or squeeze a spring grows in step with how far you stretch it, F = kx.3Wikipedia. Hooke’s law The number k is fixed for each spring, its stiffness.3Wikipedia. Hooke’s law This holds only while the stretch is small compared to how far the spring can go.3Wikipedia. Hooke’s law
Crickets give a stranger one. Counting cricket chirps in 15 seconds and adding 40 gives roughly the temperature in Fahrenheit.4NOAA Office of Education. What Is a Linear Relationship? Definition and Examples This rule is called Dolbear’s law, after an 1897 publication.4NOAA Office of Education. What Is a Linear Relationship? Definition and Examples So 30 chirps suggests about 70°F. It is only a rough guide: it was built for a particular kind of cricket, and other species chirp at different rates at the same temperature. A thermometer is more reliable.
Costs are linear in many businesses. A linear cost function adds fixed costs to a set cost per unit made, C = F + vQ.5Vaia. What Is a Linear Relationship? Definition and Examples It suits businesses where each extra unit costs the same no matter how many are made.5Vaia. What Is a Linear Relationship? Definition and Examples
A spring with zero stretch needs zero force, so its line passes through the origin. In the cricket rule the intercept is an oddity: zero chirps would suggest 40°F, which shows the rule works only across ordinary warm-weather temperatures. In a cost function the fixed cost is what you owe before making a single unit, such as rent on a workshop, so b has a clear meaning there.
Household examples are everywhere. Distance at a steady driving speed grows linearly with time, hourly wages grow linearly with hours worked, and converting Celsius to Fahrenheit is a linear formula. Each has limits. Real trips with traffic lights and slowdowns only follow a line on average, and the model describes the cruising stretches best. The Celsius conversion is perfectly linear because it is a definition, not a measurement: multiply by 9/5 and add 32, so the slope is 9/5 and the intercept is 32. Hourly pay is linear only while the rate stays fixed. If overtime pays more after a set number of hours, the graph bends into two different straight pieces.
Linear Versus Nonlinear Relationships
Some relationships have two things changing together in the same direction but not at a steady rate.6Minitab Support. A comparison of the Pearson and Spearman correlation methods Growth is often better described by curves such as exponential or power curves.7PubMed. Fitting and using growth curves Chicken growth over time, for example, was best fit by an S-shaped curve rather than a line.8PubMed Central. Genetic variance components of the growth curve for Isfahan indigenous chicken
Many linear rules hold only within a range, as with a spring stretched too far.3Wikipedia. Hooke’s law A magnet core that becomes saturated stops responding in proportion to a stronger field.9Journal of Sound and Vibration. Dynamics of a piecewise linear system subjected to a saturation constraint
The shape of a graph gives the first clue. A straight line means linear. A curve that bends upward faster and faster suggests exponential growth. A curve that rises and then levels off suggests a limit, or saturation.
What repeats tells the types apart. In linear change, the same amount is added each step. In exponential change, the same percentage is added each step, so the amounts get bigger and bigger. A table showing 2, 4, 8, 16 is exponential because each value doubles, while 2, 4, 6, 8 is linear because each value adds 2.
Taking the log of one variable can make a curved pattern look straight.10EPsy 8252 Notes. Unit 2: Nonlinearity: Log-Transforming the Predictor When both axes are logged, power laws turn into straight lines.11Wikipedia. Log–log plot That lets people use simple line tools on curved data.
A small piece of almost any smooth curve looks nearly straight, which is why a linear rule can work well locally and fail over a wider range. When you see a claimed linear relationship, ask what range of values the data covers before trusting it beyond that range.
Fitting a Line to Messy Real Data
Real data points scatter, but a straight line can often describe their pattern quite well.12GitHub Pages (Owen G. Ward). Linear Regression People use a method called least squares to find the line closest to all the points.13Built In. What Is a Linear Relationship? Definition and Examples It picks the line that makes the squared gaps between points and the line as small as possible.13Built In. What Is a Linear Relationship? Definition and Examples This is the line of best fit. The model behind it adds an error term for each point’s distance from the line.12GitHub Pages (Owen G. Ward). Linear Regression Spreadsheet programs draw this trendline automatically.
The gaps are squared for a reason. Gaps above and below the line would cancel each other out if you just added them. Squaring makes all gaps positive, and it makes points far off the line count more. It also gives one unique best line.
The best-fit line produces an equation with a slope and a starting value, so you can plug in a new x and get a predicted y even where you have no measurement. Predictions are safest inside the range of the data you have. Extending the line far beyond it assumes the straight-line pattern continues, which may not be true. Because points scatter, the predicted value is a typical expectation, and real results will land above or below it.
Measuring How Strong a Linear Relationship Is
The Pearson correlation coefficient, r, is the most common measure of a linear relationship and runs from –1 to 1.14Scribbr. Pearson Correlation Coefficient (r) | Guide & Examples Its sign shows direction and its size shows strength.15Kent State University Library Guides. SPSS Tutorials: Pearson Correlation That is because it reflects how close points sit to the best-fit line.16Laerd Statistics. Pearson Product-Moment Correlation R squared, from 0 to 1, describes how well a line fits, with bigger meaning stronger.12GitHub Pages (Owen G. Ward). Linear Regression
Reading r is straightforward. Near 1, the points hug a rising line. Near –1, they hug a falling line. Near 0, there is no straight-line pattern, and moderate values mean a loose trend.
An r near 0 means no straight-line pattern, not no relationship at all. A clear U-shaped curve can have r near 0 because the rising and falling sides cancel out. A low r should send you to the graph, not make you conclude the two things are unrelated.
For a straight-line fit with one input, R squared is simply r multiplied by itself, so an r of 0.5 gives an R squared of 0.25. R squared is often read as the share of the variation in y that the line accounts for, which is why 0.25 is much weaker than it may sound. It has no sign, so it cannot tell you whether the line rises or falls; r does that.
When one thing always rises with another but by uneven amounts, r is positive but below 1.6Minitab Support. A comparison of the Pearson and Spearman correlation methods A different measure, Spearman’s, still scores 1 in that case because it checks only that they move together.6Minitab Support. A comparison of the Pearson and Spearman correlation methods Some statisticians argue Pearson’s r can still be useful for such patterns.17The American Statistician. Myths About Linear and Monotonic Associations: Pearson’s r, Spearman’s ρ, and Kendall’s τ
How Numbers Can Fake or Hide a Linear Relationship
Four famous data sets, known as Anscombe’s quartet, share nearly identical summary numbers yet look completely different when graphed.18Wikipedia. Anscombe’s quartet One is a fair linear scatter with r of 0.82.19MetricGate. What Anscombe’s Quartet Teaches Another traces a smooth curve, so a straight line is the wrong model.19MetricGate. What Anscombe’s Quartet Teaches In a third, one outlier lowers r from a perfect 1 to 0.816.18Wikipedia. Anscombe’s quartet An outlier is a point that sits far from the rest. In the fourth, a single far-off point creates a high r where no real relationship exists.19MetricGate. What Anscombe’s Quartet Teaches So plot data before trusting r.
Standard line fitting is highly sensitive to outliers, which can badly hurt predictions.20OTS Canadian Journal. The Impact of Outliers on Linear Regression Models: Detection and Correction Strategies Because gaps are squared, the method gives extra weight to far-away points, and a single remote stray point can tilt the whole line toward itself. One far to the left or right of the others has particular leverage, since it can twist the line like a handle. When the spread of points widens across the graph, the usual error margins from the fit become unreliable.21Damavis Blog. Heteroscedasticity Explained: Definition, Impact & Solutions
You can check a chart yourself. Look for one dot far from the rest. Check whether the dots bend instead of following a line. See whether the spread fans out at one end. Then ask whether removing one point changes the story.
If a point looks suspicious, first check whether it is a typing or measurement error, such as a misplaced decimal, which should be corrected. If it is real, report the results both with and without it, rather than quietly deleting it. Removing a point only because it spoils the pattern is not honest analysis.
Does a Linear Relationship Mean Cause and Effect
Correlation does not imply causation.22Advances in Methods and Practices in Psychological Science. Thinking Clearly About Correlations and Causation: Graphical Causal Models for Observational Data A hidden factor affecting both things can create a misleading correlation, and it can also hide a real cause-and-effect link.23PubMed Central. Causal Inference With Observational Data and Unobserved Confounding Variables Ice cream sales and drownings rise together, but hot weather drives both.
For any line, there are three main explanations. One thing may cause the other, the causal link may run the other way, or a third factor may drive both. Some patterns are also pure coincidence, especially when many pairs of things are searched, because some unrelated pairs will line up by chance.
Cause is clearer in some of our earlier examples. In springs, pulling truly causes stretching. Crickets chirp faster because warmth speeds their bodies, not the reverse. Controlled experiments test cause better than observations do.
Ask whether the data came from an experiment that assigned people to groups, or only from observing what happened. Be wary of headlines saying one thing “leads to” another when the study only compared existing groups.

