Dew Stats Master .NET
SignTest Routines
Summary
One or two-sample Sign test.

Unit
Statistics

Declaration
Function SignTest(Data: TVec; Median: TSample; out hRes: THypothesisResult; out Signif: TSample; out ConfInt: TTwoElmReal; hType: THypothesisType = htTwoTailed; Alpha: TSample = 0.05): TSample;

Description
Performs one-sample Sign test by comparing Data median value with given Median. The null hypothesis is that Data median is equal to Median. Additional assumption is that underlying population is continuous.
Categories
Hypothesis testing

Declaration
Function SignTest(Data1, Data2: TVec; out hRes: THypothesisResult; out Signif: TSample; out ConfInt: TTwoElmReal; hType: THypothesisType = htTwoTailed; Alpha: TSample = 0.05): TSample;
 Parameter  Description 
hRes Returns the result of the null hypothesis (default assumption is that the means are equal). 
hType Defines the type of the null hypothesis (left, right and two - tailed). 
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. 
Alpha Defines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected. 
Result
The Sign test statistics.
Description
Performs paired Sign test. The routine tests the null hypothesis that Data1 and Data2 have equal median value.
Categories
Hypothesis testing
 See Also 
WilcoxonSign 

Example 1

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 : TSample; 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 "MtxVecCpp.h" #include "Math387.hpp" #include "Statistics.hpp" void __fastcall Example(); { Vector d1,d2; d1->SetIt(false, OPENARRAY(TSample, (1,4,5,6,7,12))); d2->SetIt(false, OPENARRAY(TSample,(3,3.5,2,3.1,10,9))); double signif, SStat; double ci[2]; THypothesisResult hres; // don't use normal approximation SStat = SignTest(d1,d2,hres,signif,ci,htTwoTailed,0.05); }
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector d1 = new Vector(0); Vector d2 = new Vector(0); d1.SetIt(false, new double[] {1,4,5,6,7,12}); d2.SetIt(false, new double[] {3,3.5,2,3.1,10,9}); double signif, SStat; double[2] ci; THypothesisResult hres; // don't use normal approximation SStat = Statistics.SignTest(d1,d2,out hres,out signif,out ci,THypothesisType.htTwoTailed,0.05); } }


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