Regression with life data: Weibull regression with censoring

Updated

Regression with life data models how the life of a product depends on predictors, such as supplier, material, load or temperature, when the response is a time to failure and some units have not failed yet. It works like ordinary regression, but the errors follow a life distribution (Weibull, lognormal, exponential) and censored units enter the fit as "survived at least this long". The output tells you how much each factor stretches or shrinks life.

When to use it

  • You tested units under several conditions and want one model that covers them all.
  • You want to know whether a design change or a second supplier really changes life, while accounting for another factor such as load.
  • Some units were still running when the test ended, so ordinary regression on failure times would be biased.
  • You need predicted life (B10, median) at a combination of conditions you did not test.

How it works

The model is written on the log scale of time:

ln(T) = β₀ + β₁x₁ + β₂x₂ + … + σ · ε

The x's are predictors: numbers (pressure, temperature) or indicator columns for categories (0 for supplier A, 1 for supplier B). ε is a standard error term whose distribution sets the life model: the smallest extreme value distribution gives a Weibull model for T, the normal gives a lognormal. For the Weibull case, the shape parameter is β = 1/σ, and the Weibull scale for a given set of predictors is η = exp(β₀ + β₁x₁ + …).

The coefficients are estimated by maximum likelihood. Each failure contributes its density and each censored unit its survival probability, exactly as in distribution analysis. Standard errors come from the curvature of the likelihood, and each coefficient gets a z test (estimate / standard error).

Because the model is on log time, coefficients read as time ratios: a coefficient b multiplies life by eᵇ for a one-unit increase in that predictor, at every percentile. Accelerated life testing is the special case with one stress variable, often transformed (1/kT for Arrhenius, ln V for the inverse power law).

Example

A hydraulics plant compares hose assemblies from its current supplier (A) and a new one (B) on an impulse test rig, at two peak pressures, five assemblies per cell. Life is in thousands of impulse cycles; the test stops at 400 thousand cycles (+ = still intact).

SupplierPressureLife (thousand cycles)
A21 MPa54, 195, 228, 293, 354
A28 MPa38, 52, 95, 113, 139
B21 MPa210, 400+, 400+, 400+, 400+
B28 MPa71, 150, 162, 169, 298

The Weibull regression, ln(T) = β₀ + β₁·SupplierB + β₂·Pressure + σε, fitted by maximum likelihood:

TermCoefficientSEzp
Constant8.7570.77211.34< 0.001
Supplier B0.7730.2143.61< 0.001
Pressure (MPa)−0.15060.0308−4.89< 0.001

The scale σ is 0.400, so the Weibull shape is 1/0.400 = 2.50 (approximate 95% CI 1.68 to 3.72), a clear wear-out pattern.

Reading the coefficients as time ratios:

  • Supplier B: e^0.773 = 2.17. At the same pressure, B's hoses last about 2.2 times as long as A's (95% CI 1.42 to 3.29 times).
  • Pressure: e^−0.1506 = 0.860. Each extra MPa cuts life by about 14%; going from 21 to 28 MPa cuts it to 0.860⁷ = 0.35 of its value.

Predicted B10 life (thousand cycles) from the model, B10 = η · (−ln 0.9)^σ:

Predicted B10 life of hose assemblies by pressure50100150200B10 life (thousand cycles)Supplier ASupplier B21 MPa24 MPa28 MPaPeak pressure
Predicted B10 life of hose assemblies by pressure

At 24 MPa, a pressure that was not tested, the model predicts a B10 of 69.5 thousand cycles for A and 150.5 thousand for B.

How to read the results

  • Start with the p-values of the terms. Here both supplier and pressure matter. A term with a large p-value can usually be dropped and the model refitted.
  • Translate coefficients into time ratios. A ratio of 2.17 is easier to act on than a coefficient of 0.773, and it holds for B10, the median and every other percentile.
  • Check the shape assumption. The model assumes the same Weibull shape in every cell. Plot each cell on a probability plot; parallel lines support the model.
  • Check the residuals. Standardized residuals (with censored ones marked) should look like a sample from the chosen error distribution.

Common mistakes

  • Running ordinary least squares on the failure times. Treating the 400+ values as 400 understates supplier B's life; deleting them is worse.
  • Predicting far outside the tested range. The pressure effect is estimated between 21 and 28 MPa; at 10 MPa a different failure mode may dominate.
  • Reading coefficients as hours. They act on log time; a coefficient of 0.773 is a ratio, not 0.773 thousand cycles.
  • Ignoring interactions. If supplier B's advantage shrinks at high pressure, the model needs a supplier × pressure term.

Frequently asked questions

How is this different from Cox regression?

Cox regression does not assume a life distribution and reports hazard ratios. Weibull regression assumes a distribution, which lets it predict life percentiles such as B10 and extrapolate, but makes it depend on that assumption.

Can I use lognormal instead of Weibull?

Yes; change the error distribution to normal. Compare the log-likelihoods and the residual plots of both fits and use the one that describes the data better.

What does the scale σ tell me?

σ is the spread of log life around the model. For the Weibull model, 1/σ is the shape: a small σ means a steep, wear-out distribution with tight lives.

How many failures do I need?

As with any regression, you need several failures per coefficient. With heavy censoring in some cells, the estimates for those cells rest on few failures and their intervals are wide.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab