Enter paired (x, y) data to fit the best-fit line by least squares and get the slope, intercept and R-squared, for trend prediction and variable-relationship modelling.
由数据拟合最佳直线。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Least-squares slope | β̂ = Σ(x−x̄)(y−ȳ) ÷ Σ(x−x̄)², α̂ = ȳ − β̂x̄ | Legendre 1805 / Gauss 1809 |
| Coefficient of determination | R² = 1 − SSE/SST, the explained share of total variation | Standard regression measure |
| OLS assumptions | Linearity, independent errors, homoscedasticity (Gauss-Markov), normal residuals for inference | Gauss-Markov theorem |
| Extrapolation warning | Interpolation is reliable only within data range; extrapolate at your peril | Universal regression-textbook warning |
统计指标、置信区间与样本量的测算。
一元线性回归 y=a+b·x:用最小二乘法拟合直线,b 为斜率(x 每增 1 单位 y 的平均变化)、a 为截距。
结果可用于预测与趋势判断;应结合相关系数 R² 评估拟合优度,外推需谨慎(超出数据范围不可靠)。