Dew Stats Master .NET
QCWestgardRules Routine
Summary
Compares values agains Westgard rules.

Unit
StatControlCharts

Declaration
Procedure QCWestgardRules(Data: TVec; OutControl: TVec; mean, sigma: TSample);
 Parameter  Description 
Data Data to-be-checked with Westgard rules. 
OutOfControl Vector storing each point status. If point(i) is out-of-control, then OutControl.Values[i] will be greater than zero (see explanation above). 
mean In most cases equal to data mean, but you can specify any value. 
sigma In most cases equal to data standard deviation, but you can specify any value. 

Description
Data individual values are tested to determine if they are in, or out, of control using a set of five rules called the Westgard rules. These rules indicate which points are out-of-control. The Westgard rules are (see www.westgard.com/mltirule.htm for details):For each point several rules can be violated at the same time. Each Westgard rule violation has different value:For example, if rules 2S2 and 10X were violated, then the sum of violations for point would be 2 + 16 = 18.
Categories
Control charts

Example 1

Load process data, then check if any points are out-of-control.
Uses MtxExpr, StatControlCharts; procedure Example; var data, outofcontrol,indexes: Vector; begin data.LoadFromFile('process_data.vec'); QCWestgardRules(data,outofcontrol,data.mean,data.stddev); // Now find indexes of out-of-control points indexes.FindIndexes(outofcontrol,'>',0); // indexes.IValues now stores the indices of out-of-control points end;
#include "MtxVecCpp.h" #include "MathExpr.hpp" #include "StatControlCharts.hpp" void __fastcall Example() { Vector data, outofcontrol, indexes; data->LoadFromFile("process_data.vec"); QCWestgardRules(data,outofcontrol,data->Mean(),data->StdDev()); // Now find indexes of out-of-control points indexes->FindIndexes(outofcontrol,">",0); // indexes->IValues now stores the indices of out-of-control points }
using Dew.Math; using Dew.Math.Units; using Dew.Stats.Units; namespace Dew.Examples { private void Example(Dew.Stats.QCSeries QCSeries1) { Vector data = new Vector(0); Vector outofcontrol = new Vector(0); Vector indexes = new Vector(0); data.LoadFromFile("process_data.vec"); StatControlCharts.QCWestgardRules(data,outofcontrol,data.Mean(),data.StdDev()); // Now find indexes of out-of-control points indexes.FindIndexes(outofcontrol,">",0); // indexes.IValues now stores the indices of out-of-control points } }

Copyright 2008 Dew Research
http://www.dewresearch.com