Statistics › Section L · Linear regression and correlation › Topic L.1
Linear equations, slope, and intercept
Before data meet a line, the line itself must be understood. This topic reviews the algebra every later regression topic stands on - slope as a rate, intercept as a starting point, and the straight line that ties them together.
The straight line, reviewed
A linear relationship is one of constant rate: every extra hour costs the same, every extra kilometre burns the same fuel, every extra year adds the same amount. Algebra draws such relationships as straight lines, with \(x\) the independent variable, the one you choose or know, and \(y\) the dependent variable, the one the line predicts. The whole regression chapter - fitting lines to data - leans on this review: what a line's equation says, what its slope and intercept mean, and how two numbers describe a whole relationship.
Slope-intercept form
Every non-vertical line has an equation of the form
where \(m\) is the slope and \(b\) is the y-intercept: the value of \(y\) when \(x = 0\). The form is a complete instruction manual - the slope says how steeply the line climbs, the intercept says where it starts, and together they pin down every point. Given either two points or a point and a slope, the line follows immediately. Statistics books often write the same line with the constant first and different letters, such as \(y = a + bx\) or \(\hat{y} = b_0 + b_1x\), which this course uses for regression. The letters change; the rule does not: the number multiplying \(x\) is the slope, and the stand-alone constant is the intercept.
Slope: the rate of change
The slope is rise over run:
the change in \(y\) per unit change in \(x\), anywhere on the line - the constant rate that makes the line straight. A slope of 45 means \(y\) rises 45 units for each unit of \(x\); a slope of \(-2\) means \(y\) falls 2 per unit. In context, the slope carries units: dollars per hour, grams per day, and its sign tells the relationship's direction - positive climbs, negative falls, zero runs flat.
Intercept: the starting value
The y-intercept \(b\) is the line's value at \(x = 0\): the predicted \(y\) when nothing has happened yet - a repair firm's call-out fee before any hours, a taxi's base fare before any distance. Interpreting an intercept in context requires care, because \(x = 0\) may be meaningless or out of range: a line of adult weight against height gives a "weight" for a person 0 cm tall, which describes no one. The intercept is where the line's formula starts, not always where the story does.
Worked example: the taxi fare
A taxi charges a $3 base fare plus $2.50 per kilometre: \(y = 3 + 2.5x\), with \(y\) the fare in dollars and \(x\) the kilometres. 1. Slope: 2.5 dollars per kilometre - each extra km adds $2.50, by the line's constant rate. 2. Intercept: 3 dollars - the fare before the wheels turn. 3. Fare for 4 km: \(3 + 2.5 \times 4 = 13\) dollars. 4. Distance for an $18 fare: \(18 = 3 + 2.5x\) gives \(2.5x = 15\), so \(x = 6\) km. 5. Check: 6 km at $2.50 plus $3 is \(15 + 3 = 18\) - forward and backward both agree.
Worked example: a line from two points
A seedling measures 14 cm on day 1 and 34 cm on day 5, growing at a constant rate. 1. Slope: \(m = \frac{34 - 14}{5 - 1} = \frac{20}{4} = 5\) cm per day. 2. Intercept: from day 1, \(14 = 5 \times 1 + b\), so \(b = 9\) cm - the height the line gives for day 0, which is only meaningful if growth ran at the same rate before the first measurement. 3. The line: \(y = 9 + 5x\). 4. Prediction: at day 3, \(9 + 5 \times 3 = 24\) cm. 5. Check: the line reproduces both known points (\(9+5 = 14\), \(9+25 = 34\)), and day 3's 24 cm sits halfway between them, as it should.
Slope in context: reading units
The slope's units are \(y\)-units per \(x\)-unit, and saying them aloud is a quick comprehension check. A line of heating cost against outside temperature with slope \(-4\) dollars per degree: each degree warmer saves $4, and each degree colder adds $4 - the slope is negative because cost rises as temperature falls. Keeping the units attached makes a misread direction or size much easier to spot.
Steepness and comparison
The slope's absolute value sets the line's steepness, which makes slopes comparable: \(|m| = 2\) climbs twice as fast as \(|m| = 1\), regardless of direction. Two lines with the same slope are parallel - the same rate, shifted by their intercepts. In the contexts ahead, comparing slopes answers comparative questions directly: if plan A's cost line has slope 45 and plan B's 60, B escalates faster with usage, and the intercepts decide who is cheaper where.
Common mistakes to avoid
First, computing slope as run over rise - it is rise over run, \(\Delta y/\Delta x\), always. Second, reading the intercept as the slope's value or vice versa: in \(y = 3 + 2.5x\), 3 is the intercept and 2.5 the slope, whichever order they appear in. Third, sign errors: a falling line has a negative slope, and the context should confirm it. Fourth, interpreting an intercept at an \(x = 0\) that the story never reaches. Fifth, treating slope as a value rather than a rate - a slope is per-unit, not a total. Sixth, subtracting in different orders on top and bottom, such as \(y_2 - y_1\) over \(x_1 - x_2\), which flips the sign.
Key takeaways
A line is a constant rate: \(y = mx + b\), with slope \(m = \Delta y/\Delta x\) - the change in \(y\) per unit \(x\), units attached - and intercept \(b\), the value at \(x = 0\), meaningful only when the story reaches zero. The taxi: \(y = 3 + 2.5x\), slope $2.50 per km, intercept $3, fare 13 dollars at 4 km, 6 km at 18 dollars. A line's slope follows from any two of its points. Steepness compares rates, parallel lines share a slope, and every regression topic ahead is this algebra wearing data.
Flashcards
Flashcard
Slope-intercept form of a line
Test your understanding
Question 1 of 5
In y = 3 + 2.5x, what are the slope and y-intercept?
Question 2 of 5
A taxi costs 3 + 2.5x dollars for x kilometres. What is the fare for a 7-km ride?
Question 3 of 5
A fare of $23 corresponds to how many kilometres on the same line?
Question 4 of 5
A heating line has slope −4 dollars per degree (cost against outside temperature). This means:
Question 5 of 5
Two lines have slopes 45 and 60. The lines are:
