Calculate y hat (ŷ), the predicted value on a regression line ŷ = a + bx: enter the intercept, slope and x value to get the predicted y.
Related Calculators
- Fit slope and intercept from paired data
- Concordance Index Calculator
- Coverage Factor Calculator
- Type I Error Calculator
- Modified Z Score Calculator
- All Statistics Calculators
Y-Hat Formula
The y-hat (ŷ) value is the predicted response from a simple linear regression line. This calculator evaluates a supplied intercept and slope. The paired-data and summary relationships below explain how coefficients can be obtained with a separate regression fit; they are not additional input modes in this form.
Equation mode uses the regression line directly:
Paired-data background: a separate least-squares fit obtains the coefficients. Let Sxy = Σ(x − x̄)(y − ȳ) and Sxx = Σ(x − x̄)²:
b₀ = ȳ − b₁x̄
ŷ = b₀ + b₁x
Summary-statistics background: a separate fit can obtain b₁ = r(sᵧ/sₓ), followed by b₀ = ȳ − b₁x̄. Then:
- ŷ: predicted value of the response variable
- b₀: y-intercept of the regression line
- b₁: slope of the regression line
- x: predictor value you want to plug in
- x̄, ȳ: means of the X and Y samples
- sₓ, sᵧ: sample standard deviations of X and Y
- r: Pearson correlation coefficient between X and Y
The three forms give the same ŷ when the inputs are consistent. Use ŷ only for x values inside or near the range of the original data. Predicting far outside that range is extrapolation and is not reliable. The model also assumes a roughly linear relationship and independent observations.
Use this equation form when a textbook or software output already gives b₀ and b₁. It does not fit raw X/Y lists or summary statistics, and does not calculate r, R², residual error or confidence/prediction intervals. Use a regression-fitting tool for those outputs.
Reference Tables
Background for an R² reported by a separate ordinary least-squares fit with an intercept: in-sample R² describes the fraction of sample Y variation explained by the line. The ranges below do not establish universal fit quality or prediction usefulness. This calculator does not calculate R².
| R² value | Explained share | What it means for ŷ |
|---|---|---|
| 0.00 – 0.20 | 0–20% | The remaining sample variation is about 80–100%; assess residuals and validation separately. |
| 0.20 – 0.50 | 20–50% | The remaining sample variation is about 50–80%; R² alone does not show uncertainty. |
| 0.50 – 0.80 | 50–80% | The remaining sample variation is about 20–50%; usefulness still depends on context and validation. |
| 0.80 – 1.00 | 80–100% | The remaining sample variation is about 0–20%; absolute residual size and future prediction quality need separate checks. |
The next table shows how the slope sign and the predictor value combine to move ŷ relative to ȳ.
| Slope b₁ | x compared to x̄ | ŷ compared to ȳ |
|---|---|---|
| Positive | x > x̄ | ŷ > ȳ |
| Positive | x < x̄ | ŷ < ȳ |
| Negative | x > x̄ | ŷ < ȳ |
| Negative | x < x̄ | ŷ > ȳ |
| Any | x = x̄ | ŷ = ȳ |
Worked Example and FAQ
Example. A study fits the equation ŷ = 30.36 + 1.72x to predict test score from study hours. To predict the score for a student who studies 12 hours:
- b₀ = 30.36, b₁ = 1.72, x = 12
- ŷ = 30.36 + 1.72(12) = 30.36 + 20.64 = 51.00
For r = 0.85, x̄ = 8, sₓ = 3, ȳ = 44 and sᵧ = 6.07, the summary relationship gives b₁ = 1.719833333… and b₀ = 30.241333333…. At x = 12 it predicts 50.879333333…, or 50.88 to two decimals and 51 to the nearest integer. It is not exactly the same line as 30.36 + 1.72x.
What does the hat in ŷ mean? The hat marks ŷ as an estimate produced by the model, not an observed data point. Observed values are written as y.
Is ŷ the same as the mean of Y? No. ŷ depends on x. It only equals ȳ when x = x̄ or when the slope is zero.
Why does my ŷ differ slightly from a textbook answer? Rounding b₀ and b₁ before plugging in x can change the result. Enter the supplied coefficients at full precision and choose the desired answer precision in Optional settings. The answer rounds after combining the entered decimals; trailing zeros are omitted.
Can I use this for multiple regression? No. This calculator handles one predictor. For two or more predictors you need the form ŷ = b₀ + b₁x₁ + b₂x₂ + … and a multiple regression tool.
What if my X values have no variation? Σ(x – x̄)² will be zero and a separate least-squares slope fit is undefined. This equation-only form requires an already supplied slope.
Sources: Penn State STAT 200, Lesson 12, prediction and coefficient relationships; Penn State STAT 501, Lesson 1, Caution 7 on large R² and useful prediction.

