Dew Stats Master .NET
StatNormalPlot Routine
Summary
Constructs the Normal Probability Chart.

Unit
StatProbPlots

Declaration
Procedure StatNormalPlot(Data: TVec; XDrawVec, YDrawVec: TVec; out MinX, MaxX, MinY, MaxY: TSample; StdErrs: TVec = nil; DataSorted: boolean = true);
 Parameter  Description 
Data Data to be drawn. 
DataSorted If true, algorithm assumes Data is already sorted in ascending order. If Data is not sorted, you must set this parameter to false so that internal algorithm will automatically do the sorting. 
XDrawVec Retunrs vector of X values to be drawn. 
YDrawVec Returns vector of Y values to be drawn. 
minX,minY Returns slope line start point. These value are used by TStatProbSeries series. 
maxX,maxY Returns slope line end point. These value are used by TStatProbSeries series. 

Description

Constructs the Normal Probability Chart. Use TStatProbSeries to visualize/plot constructed values. The data are plotted against a theoretical normal distribution in such a way that the points should form an approximate straight line. Departures from this straight line indicate departures from normality.

The normal probability plot is used to answer the following questions:
Categories
Probability plots
 See Also 
TStatProbSeries 
TStatProbSeries 

Example 1

The following code will create probability plot and then plot calculated values.

Uses MtxExpr, StatProbPlots, StatSeries, Math387, MtxVecTee; procedure Example(Series1: TStatProbSeries); var Data, XVec, YVec: Vector; X1,Y1,X2,Y2: TSample; begin // generate some random values for Data vec Data.Size(100); Data.RandGauss(0.0,1.0); // standard norm. dist. StatNormalPlot(Data,XVec,YVec,X1,X2,Y1,Y2,false); With Series1 do begin MinX := X1; MinY := Y1; MaxX := X2; MaxY := Y2; end; DrawValues(XVec,YVec,Series1); end;
#include "Math387.hpp" #include "MtxVecCpp.h" #include "StatProbPlots.hpp" #include "StatSeries.hpp" #include "MtxVecTee.hpp" void __fastcall Example(TStatProbSeries * Series1); { Vector data,xvec,yvec; double x1,x2,y1,y2; data->Size(100,false); data->RandGauss(0.0,1.0) // standard distribution StatNormalPlot(data,xvec,yvec,x1,x2,y1,y2,false); Series1->MinX = x1; Series1->MaxX = x2; Series1->MinY = y1; Series1->MaxY = y2; DrawValues(xvec,yvec,Series1); }
using Dew.Math; using Dew.Math.Units; using Dew.Stats.Units; namespace Dew.Examples { private void Example(ProbabilityPlot Series1) { double x1,x2; double y1,y2; Vector data = new Vector(100,false); Vector xvec = new Vector(0); Vector yvec = new Vector(0); data.RandGauss(0.0, 1.0); // standard distribution StatProbPlots.StatNormalPlot(data, xvec, yvec, out x1, out x2, out y1, out y2, null,false); Series1.MinX = x1; Series1.MaxX = x2; Series1.MinY = y1; Series1.MaxY = y2; MtxVecTee.DrawValues(xvec,yvec,Series1,false); } }


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