Compares values agains Westgard rules.
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
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.
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
}
}