Lecture 6 (1) · Correlation and simple regression
How much more does a bigger rental cost?
We’ll use 135 rental listings to answer two questions. How much does rent go up with size, and how much do rents vary at the same size?
Hi everyone! Take a look at the rental dots before you read the equation. Around 50 square metres, how much do the asking rents vary? Keep those dots in mind when we talk about what the line estimates.
See what the line is averaging
We had 135 rental listings. On average, the fitted rent went up by about CAD 18.72 per month for every extra square metre. Pearson correlation summarizes a straight-line relationship. The rank-based measures we saw can help describe a pattern that keeps increasing or decreasing even if it curves.
See what the line misses
Pick a dot above the fitted line. The listing’s asking rent is higher than the model predicts for that size. That vertical gap is its residual. An interval for mean rent at 50 square metres answers one question. An interval for the next 50-square-metre listing has to allow for more variation.
In R
Load rentals_part1.csv from the class materials before fitting the line.
rent <- read.csv("Data/rentals_part1.csv")
fit <- lm(rent_cad ~ area_m2, data = rent)
confint(fit)
predict(fit, data.frame(area_m2 = 50),
interval = "prediction")
plot(fitted(fit), resid(fit))
The prediction interval describes uncertainty for one additional 50 m² listing. The residual plot checks whether the spread or mean pattern changes across the fitted values.
Key takeaways
- Explain the slope in CAD per month per square metre.
- Use the line for the average pattern, then look at the dots to see how much individual listings vary.


