Constructs the Normal Probability Chart.
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.
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);
}
}