Prediction inside the sample
- Input
- X=6 (Ŷ=7,5X+41,5)
- Expected output
- Ŷ=86,5
Only one unit past the largest observed X (5): a small extrapolation, still close to the data that fitted the line.
linear regression for prediction with OLS
The OLS-fitted equation, Ŷ = β₀ + β₁X, can predict Y for any X, but it is only reliable inside the range that produced the line. Outside it, the prediction becomes extrapolation: it assumes the linear relationship keeps going past the observed data, a bet that often fails.
Only one unit past the largest observed X (5): a small extrapolation, still close to the data that fitted the line.
An impossible score on a 100-point test: the line ignores any ceiling that was not in the original 5 pairs.
√(7.5 ÷ (5−2)): measures how far the real points typically sit from the fitted line, information Ŷ alone does not give.
Simple linear regression is a statistical model that describes the relationship between an independent variable X and a dependent variable Y as a line, Ŷ = β₀ + β₁X. The slope β₁ tells you how much Y changes for each one-unit increase in X, and the intercept β₀ is the predicted value of Y when X is zero. It is the foundation of much of data analysis, used both to understand a relationship and to predict values.
It is not recommended: the line assumes the linear relationship continues outside the sampled range, an assumption with no guarantee at all. In the hours-and-score example, predicting for X=50 returns Ŷ=416.5, an impossible score on a 100-point test, concrete proof that the extrapolation broke down.
It is the predicted value of Y when X=0, even if X=0 falls outside the sampled range. In the example, β₀=41.5 is the expected score with zero study hours, a useful reading of the line even though it is, technically, an extrapolation.
Compare the requested X with the range of the data used to fit the line: X=6 sits just above the largest observed value (5), a small extrapolation, while X=50 sits far beyond it, where the line has no guarantee left of still representing the real relationship.
One x, y pair per line. Maximum 200 pairs.
All data stays in your browser. No data is sent to any server.