SignTest

SignTest[data]
tests whether the median of data is zero.

SignTest[{data1,data2}]
tests whether the median of data1 data2 is zero.

SignTest[dspec,μ0]
tests a location measure against μ0.

SignTest[dspec,μ0,"property"]
returns the value of "property".

Details and OptionsDetails and Options

  • SignTest performs a hypothesis test on data with null hypothesis that the true population median is some value , and alternative hypothesis that .
  • Given data1 and data2, SignTest performs a test on the paired differences of the two datasets.
  • By default a probability value or -value is returned.
  • A small -value suggests that it is unlikely that is true.
  • The data in dspec can be univariate {x1,x2,} or multivariate {{x1,y1,},{x2,y2,},}.
  • If two samples are given, they must be of equal length.
  • The argument μ0 can be a real number or a real vector with length equal to the dimension of the data.
  • SignTest[dspec,μ0,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • SignTest[dspec,μ0,"property"] can be used to directly give the value of "property".
  • Properties related to the reporting of test results include:
  • "DegreesOfFreedom"the degrees of freedom used in a test
    "PValue"list of -values
    "PValueTable"formatted table of -values
    "ShortTestConclusion"a short description of the conclusion of a test
    "TestConclusion"a description of the conclusion of a test
    "TestData"list of pairs of test statistics and -values
    "TestDataTable"formatted table of -values and test statistics
    "TestStatistic"list of test statistics
    "TestStatisticTable"formatted table of test statistics
  • For univariate samples, SignTest performs the sign test for medians of paired samples. The test statistic is assumed to follow a BinomialDistribution[n,1/2] where n is the number of elements in dspec not equal to μ0.
  • For multivariate samples, SignTest performs an affine invariant test for paired samples using spatial signs. The test statistic is assumed to follow a ChiSquareDistribution[dim] where dim is the dimension of dspec.
  • The following options can be used:
  • AlternativeHypothesis"Unequal"the inequality for the alternative hypothesis
    MaxIterationsAutomaticmax iterations for multivariate median tests
    MethodAutomaticthe method to use for computing -values
    SignificanceLevel0.05cutoff for diagnostics and reporting
  • For the SignTest, a cutoff is chosen such that is rejected only if . The value of used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. By default is set to 0.05.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Test whether the median of a population is zero:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Test whether the spatial median of a multivariate population is some value:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Compute the test statistic:

In[3]:=
Click for copyable input
Out[3]=

Compare the median difference for paired data to a particular value:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Report the test results in a table:

In[3]:=
Click for copyable input
Out[3]=

Create a HypothesisTestData object for repeated property extraction:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

A list of available properties:

In[3]:=
Click for copyable input
Out[3]=

Extract a single property or a list of properties:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=
Introduced in 2010
(8.0)
Translate this page: