You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.SignTest Function
Stats Master VCL
ContentsIndex
PreviousUpNext
Statistics.SignTest Function

Performs paired Sign test. The routine tests the null hypothesis that Data1 and Data2 have equal median value.

Pascal
function SignTest(const Data1: TVec; const Data2: TVec; out hRes: THypothesisResult; out Signif: double; var ConfInt: TTwoElmReal; const hType: THypothesisType = htTwoTailed; const Alpha: double = 0.05): double; overload;
Parameters 
Description 
Data1 
First set of data from which to compute the median. 
Data2 
Second set of data from which to compute the median. 
hRes 
Returns the result of the null hypothesis (default assumption is that the means are equal). 
Signif 
(Significance level) returns the probability of observing the given result by chance given that the null hypothesis is true. 
ConfInt 
Returns the 100*(1-Alpha) percent confidence interval for the mean. 
hType 
Defines the type of the null hypothesis (left, right and two - tailed). 
Alpha 
Defines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected. 

The Sign test statistics.

In this example we'll use paired sign test to verify, if both sample medians are equal.

Uses MtxExpr, Math387, Statistics;
procedure Example;
var d1,d2: Vector;
  SignRes : double;
  HypRes  : THypothesisResult;
begin
  d1.SetIt(false,[1,4,5,6,7,12]);
    d2.SetIt(false,[3,3.5,2,3.1,10,9]);
    SignTest(d1, d2, SignRes, HypRes); // SignRes = 0.6875; HypRes = hrNotReject
  // Since the SignRes is greater than Alpha (0.05), the
  // null hypothesis that two medians are equal is not rejected
end;
#include "MtxExpr.hpp"
#include "Math387.hpp"
#include "Statistics.hpp"
void __fastcall Example()
{
  sVector d1,d2;
  d1.SetIt(false, OPENARRAY(double, (1,4,5,6,7,12)));
  d2.SetIt(false, OPENARRAY(double,(3,3.5,2,3.1,10,9)));
  double signif, SStat;
  TTwoElmReal ci;
  THypothesisResult hres;
  // don't use normal approximation
  SStat = SignTest(d1,d2,hres,signif,ci,htTwoTailed,0.05);
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!