Dew Stats Master .NET
QCSChart Routine
Summary
Constructs S-Chart.

Unit
StatControlCharts

Declaration
Procedure QCSChart(Data: TMtx; DrawVec: TVec; out CL, UCL, LCL: TSample; Confidence: TSample = 0.997);
 Parameter  Description 
Data Each Data row contains replicated observation taken at specific time. 
Confidence Confidence level for upper and lower control limit. Confidence must lie in the (0,1) interval. 
DrawVec Returns values to be drawn. 
CL Returns control Chart centerline. 
UCL Returns control Chart upper control limit. 
LCL Returns control Chart lower control limit. 

Description
Calculates S-Chart drawing values, center line, upper and lower control limit.
Categories
Control charts
 See Also 
TQCSeries 
QCXChart 
QCRChart 

Example 1

Place a TChart component on the chart and add a TQCSerie (Series1). The following code creates necessary values for S chart:
Uses StatSeries, StatControlCharts, MtxExp, Math387, MtxVecTee; procedure Example; var CL, UCL, LCL : TSample; Data: Matrix; DrawVec: Vector; begin Data.LoadFromFile('data.mtx'); QCSChart(Data,DrawVec,CL,UCL,LCL,0.025); // setup limit lines Series1.UCL := UCL; Series1.LCL := LCL; Series1.CL := CL; // now draw actual data DrawValues(DrawVec,Series1); end;
#include "StatSeries.hpp" #include "MtxVecTee.hpp" #include "MtxVecCpp.h" #include "StatControlCharts.hpp" #include "Math387.hpp" void __fastcall Example(TQCSeries* Series1); { Vector drawvec; Matrix data; double cl,lcl,ucl; data->LoadFromFile("data.mtx"); QCSChart(data,drawvec,cl,ucl,lcl,0.025); Series1->UCL = ucl; Series1->LCL = lcl; Series1->CL = cl; DrawValues(drawVec,Series1,0,1,false); }
using Dew.Math; using Dew.Math.Units; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { double cl,ucl,lcl; Matrix Data = new Matrix(0); Vector DrawVec = new Vector(0); Data.LoadFromFile("data.mtx"); // data is now initialized StatControlCharts.QCSChart(Data,DrawVec,out cl, out ucl, out lcl, 0.025); } }

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