SignTest Class |
Namespace: Accord.Statistics.Testing
The SignTest type exposes the following members.
Name | Description | |
---|---|---|
SignTest(Double, Double, OneSampleHypothesis) |
Tests the null hypothesis that the sample median is equal to a hypothesized value.
| |
SignTest(Int32, Int32, OneSampleHypothesis) |
Tests the null hypothesis that the sample median is equal to a hypothesized value.
|
Name | Description | |
---|---|---|
CriticalValue |
Gets the critical value for the current significance level.
(Inherited from HypothesisTestTDistribution.) | |
Hypothesis |
Gets the alternative hypothesis under test. If the test is
Significant, the null hypothesis
can be rejected in favor of this alternative hypothesis.
| |
PValue |
Gets the P-value associated with this test.
(Inherited from HypothesisTestTDistribution.) | |
Significant |
Gets whether the null hypothesis should be rejected.
(Inherited from HypothesisTestTDistribution.) | |
Size |
Gets the significance level for the
test. Default value is 0.05 (5%).
(Inherited from HypothesisTestTDistribution.) | |
Statistic |
Gets the test statistic.
(Inherited from HypothesisTestTDistribution.) | |
StatisticDistribution |
Gets the distribution associated
with the test statistic.
(Inherited from HypothesisTestTDistribution.) | |
Tail |
Gets the test type.
(Inherited from HypothesisTestTDistribution.) |
Name | Description | |
---|---|---|
Compute(Int32, Int32, OneSampleHypothesis) |
Computes the one sample sign test.
| |
Compute(Double, Int32, Double, OneSampleHypothesis) |
Computes the Binomial test.
(Inherited from BinomialTest.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnSizeChanged |
Called whenever the test significance level changes.
(Inherited from HypothesisTestTDistribution.) | |
PValueToStatistic |
Converts a given p-value to a test statistic.
(Inherited from BinomialTest.) | |
StatisticToPValue |
Converts a given test statistic to a p-value.
(Inherited from BinomialTest.) | |
ToString |
Converts the numeric P-Value of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.) | |
ToString(String, IFormatProvider) |
Converts the numeric P-Value of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
In statistics, the sign test can be used to test the hypothesis that the difference median is zero between the continuous distributions of two random variables X and Y, in the situation when we can draw paired samples from X and Y. It is a non-parametric test which makes very few assumptions about the nature of the distributions under test - this means that it has very general applicability but may lack the statistical power of other tests such as the paired-samples t-test or the Wilcoxon signed-rank test.
References:
// This example has been adapted from the Wikipedia's page about // the Z-Test, available from: http://en.wikipedia.org/wiki/Z-test // We would like to check whether a sample of 20 // students with a median score of 96 points ... double[] sample = { 106, 115, 96, 88, 91, 88, 81, 104, 99, 68, 104, 100, 77, 98, 96, 104, 82, 94, 72, 96 }; // ... could have happened just by chance inside a // population with an hypothesized median of 100 points. double hypothesizedMedian = 100; // So we start by creating the test: SignTest test = new SignTest(sample, hypothesizedMedian, OneSampleHypothesis.ValueIsSmallerThanHypothesis); // Now, we can check whether this result would be // unlikely under a standard significance level: bool significant = test.Significant; // false (so the event was likely) // We can also check the test statistic and its P-Value double statistic = test.Statistic; // 5 double pvalue = test.PValue; // 0.99039