MATHEMATICA HOW TO

# How to | Test Hypotheses for Population Means

Many times in statistical analysis you may need to know if a population mean is significantly different from some reference value. This is a type of -test if the population variance is not known. The Hypothesis Testing Package, which is included with Mathematica, can be used to test hypotheses for population means.

First, generate a sample dataset:

 Out[17]=

Perform a -test with MeanTest. This will return the -value of the test with null hypothesis that the population mean is 9. By default, MeanTest returns the one-sided -value:

 Out[58]=

Get the two-sided -value for the same test:

 Out[20]=

Use MeanDifferenceTest if you need a test to decide whether the difference between two population means differs significantly from an assumed value. In this case, the null hypothesis is that the population means are equal (differ by 0):

 Out[27]=
 Out[28]=

Test with a null hypothesis that the population mean of is 4 greater than that of :

 Out[29]=

Tests can also be done for paired comparisons of datasets. This can be done by using MeanTest on the pairwise differences:

 Out[41]=