Show contents 

Stat Assembly > Stat Assembly Interfaces > ISmKolmogorovSmirnovTest > ISmKolmogorovSmirnovTest.P

ISmKolmogorovSmirnovTest.P

Syntax

P: Double;

Description

The P property returns probability related to the obtained value of D.

Example

To execute the example, add a link to the Stat system assembly.

Sub UserProc;
Var
    can : Array[16Of Double;
    met : SmKolmogorovSmirnovTest;
    status : Integer;
Begin
    can[00] := 6209 ;
    can[01] := 6385 ;
    can[02] := 6752 ;
    can[03] := 6837 ;
    can[04] := 6495 ;
    can[05] := 6907 ;
    can[06] := 7349 ;
    can[07] := 7213 ;
    can[08] := 7061 ;
    can[09] := 7180 ;
    can[10] := 7132 ;
    can[11] := 7137 ;
    can[12] := 7473 ;
    can[13] := 7722 ;
    can[14] := 8088 ;
    can[15] := 8516 ;
    met := New SmKolmogorovSmirnovTest.Create;
    met.Sample1.Value := can;
    met.Distribution := KStestDistributionType.Poisson;
    met.Hypothesis := KStestHypothesisType.NotEqual;
    met.SuppliedParameters := True;
    met.Parameter1 := 3;
    status := met.Execute;
    If status = 0 Then
        Debug.WriteLine("Deviation (D): "+ met.D.ToString);
        Debug.WriteLine("Standardized statistic (Z): "+ met.Z.ToString);
        Debug.WriteLine("Probability (P): " + met.P.ToString);
    Else
        Debug.WriteLine(met.Errors);
    End If;
End Sub UserProc;

Check the hypothesis that the sample has Poisson distribution. Alternative hypothesis H1 assumes that the data cannot be a random sample of Poisson distribution. After executing the example the console window displays test results:

Unit execution started

Deviation (D): 0.9375

Standardized statistic (Z): 3.75

Probability (P): 1.0842021724855e-19

Unit execution finished

This sample does not have Poisson distribution.

See also:

ISmKolmogorovSmirnovTest