xBarRChart

Computes x-bar and R control chart limits for the given subgroups.

The x-bar chart tracks the process mean over time, while the R chart tracks the within-subgroup variability using the range (max minus min) of each subgroup. Control limits are set at three sigma from the center line using standard SPC constants (A₂, D₃, D₄).

All subgroups must have the same size (between 2 and 25). For subgroup sizes above 10, consider using xBarSChart instead — the standard deviation is a more efficient estimator of variability than the range for larger samples.

NaN values in the data propagate through the computation (IEEE 754 semantics).

Example:

val subgroups = listOf(
doubleArrayOf(10.1, 10.3, 9.8),
doubleArrayOf(10.0, 10.2, 9.9),
doubleArrayOf(10.1, 10.0, 10.3),
)
val chart = xBarRChart(subgroups)
chart.centerLine // grand mean (x-double-bar)
chart.ucl // upper control limit for x-bar chart
chart.lcl // lower control limit for x-bar chart
chart.rChart.ucl // upper control limit for R chart

Return

an XBarRChartResult containing x-bar and R chart limits.

Parameters

subgroups

a list of equal-sized subgroups, each containing at least 2 observations. At least 2 subgroups are required. Subgroup size must be at most 25.

See also