Weighted Linear Regression Calculator

Run weighted regressions with reliability-aware math and controls. Paste data, set weights, or provide measurement uncertainties. See slope, intercept, standard errors, and weighted R². Inspect residuals, leverage points, and outlier flags with charts. Compute predictions at any chosen x. Download audit-ready summaries with key diagnostics included. Accurate fits, transparent calculations, ready for decisions today.

Data Input

Paste rows as x, y, weight or x y weight. If you prefer uncertainties, choose "σ mode" and use third column as σ.


Example Data Table
xyweight
11.11
21.91
33.21
43.80.5
55.12
66.01
77.11
87.90.7
99.21
1010.01
Results
Enter data and click Compute to see results.
Formula Used
For data points (xi, yi) with weights wi, the weighted sums are Sw=∑wi, Sx=∑wixi, Sy=∑wiyi, Sxx=∑wixi2, Sxy=∑wixiyi and Δ=SwSxx−Sx2. The estimates are a=(SxxSy−SxSxy)/Δ and b=(SwSxy−SxSy)/Δ. Residual sum of squares: SSE=∑wi(yi−a−bxi)². Weighted mean of y: \u017By= Sy/Sw; weighted total sum of squares: SST=∑wi(yi−\u017By)²; so R²=1−SSE/SST. Residual variance (approx.): σ²≈SSE/(n−2). The covariance matrix of [a b]ᵀ is approximately σ²·(XᵀWX)⁻¹ where X has columns [1, x]. If the third column is measurement uncertainty σi, weights are computed as wi=1/σi².
How to Use
  1. Choose whether your third column is weights or measurement σ.
  2. Paste rows as x, y, w (w optional). Non-numeric lines are ignored.
  3. Click Compute to fit y = a + b x using weighted least squares.
  4. Review slope, intercept, standard errors, R², residuals, and leverage.
  5. Download your residual table as CSV or export a PDF summary.
  6. Use example data to see the expected format and outputs.
FAQs

Use weights when some points are more reliable or represent multiple observations. Larger weights give points more influence on the fitted line.

Yes. Choose σ mode and provide σ for each point. The calculator converts them to weights using w = 1/σ².

If the weighted variance of y is near zero, SST≈0 and R² is undefined. With poor fits or limited variation, R² can be very small.

The design becomes singular (Δ≈0). A slope cannot be estimated. Provide varied x values or remove degenerate rows.

We use σ²≈SSE/(n−2), then Var([a b])≈σ²·(XᵀWX)⁻¹. SEs are the square roots of the diagonal variances.

Residuals are weighted in SSE and SST. Leverage uses hi=wi[1 xi](XᵀWX)⁻¹[1 xi]ᵀ, highlighting influential points under weights.

Related Calculators

Inverse Function Finder CalculatorPolynomial Long Division Calculatorroots of cubic equation calculatorquadratic function from 3 points calculatorremainder and factor theorem calculatordivide using long division calculatorsynthetic division remainder calculatorLCM fraction Calculatorfactor polynomials by grouping calculatorx method factoring calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.