Write up this regression
An APA-style results paragraph built only from the coefficients and fit statistics above.
Uses an AI model via Vercel AI Gateway. It only sees what you send here; check anything you publish.
The formulas
The slope's t statistic, b₁/SE(b₁), has n − 2 degrees of freedom. In simple regression F = t², and the p-value equals that of the Pearson correlation between X and Y (see the correlation calculator).
Confidence vs prediction intervals
The confidence interval says where the average Y lies for a given X. The prediction interval says where a single new observation will probably fall; it adds the residual variance, so it is always wider. Both are narrowest at x̄ and widen as you move away from it. Avoid predicting far outside the range of X you observed.
Sample size for regression
Testing a single slope is equivalent to testing a correlation, so the power analysis calculator (correlation mode) gives the n: about 85 participants to detect r = .30 (R² ≈ .09) with 80% power.
Frequently asked questions
How do I calculate a linear regression line?
The least-squares slope is b₁ = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² and the intercept is b₀ = ȳ − b₁x̄. Paste your X and Y values above and the calculator computes both, with standard errors and p-values.
What does R² tell me?
The proportion of variance in Y explained by the straight line. R² = 0.60 means the line accounts for 60% of the variation in Y; the rest is residual. Adjusted R² penalises for the number of predictors.
How do I interpret the slope?
The expected change in Y for a one-unit increase in X. Its p-value tests whether the true slope is zero; for simple regression it is identical to the p-value of the Pearson correlation.
What assumptions does linear regression make?
A linear relationship, independent observations, roughly constant spread of residuals across X (homoscedasticity), and approximately normal residuals for valid small-sample inference. The residual plot above helps check the first and third.
Can I predict Y for a new X?
Yes, type an X value into the prediction box. The calculator gives the predicted mean and a 95% prediction interval for an individual case, which is wider than the confidence interval for the mean.