pub struct UChart { /* private fields */ }Expand description
Defects per unit (U) chart.
Monitors the defect rate when the area of opportunity (inspection size) varies between subgroups. Control limits are computed individually for each subgroup based on its inspection size.
§Formulas
- CL = u-bar = total_defects / total_units
- UCL_i = u-bar + 3 * sqrt(u-bar / n_i)
- LCL_i = max(0, u-bar - 3 * sqrt(u-bar / n_i))
A known u-bar from a Phase I study is given with UChart::with_center;
see PChart for why it is not re-estimated from later samples.
§Reference
Montgomery, D.C. (2019). Introduction to Statistical Quality Control, 8th ed., Chapter 7, Section 7.4.
Implementations§
Source§impl UChart
impl UChart
Sourcepub fn with_center(u_bar: f64) -> Result<Self, ControlChartError>
pub fn with_center(u_bar: f64) -> Result<Self, ControlChartError>
Create a U chart whose centre line is a known u-bar (Phase II).
§Errors
ControlChartError::InvalidStandard unless u_bar is finite and
positive.
Sourcepub fn add_sample(
&mut self,
defects: u64,
units_inspected: f64,
) -> Result<(), ControlChartError>
pub fn add_sample( &mut self, defects: u64, units_inspected: f64, ) -> Result<(), ControlChartError>
Add a sample with the number of defects and the number of units inspected.
The units_inspected can be fractional (e.g., area or length).
§Errors
ControlChartError::NonPositiveUnits
if units_inspected is not a positive, finite number. The chart is left
unchanged.
Sourcepub fn u_bar(&self) -> Option<f64>
pub fn u_bar(&self) -> Option<f64>
The centre line in use — the known u-bar for a chart built
with_center, otherwise the estimate — or None
if no data.
Sourcepub fn points(&self) -> &[AttributeChartPoint]
pub fn points(&self) -> &[AttributeChartPoint]
Get all chart points.
Sourcepub fn is_in_control(&self) -> bool
pub fn is_in_control(&self) -> bool
Check if the process is in statistical control.