**Namespace:** Meta.Numerics.Statistics**Assembly:** Meta.Numerics (in Meta.Numerics.dll) Version: 3.0.0.0 (3.0.0.0)

# Syntax

C# | Visual Basic | Visual C++ | F# |

public TestResult ZTest( double referenceMean, double referenceStandardDeviation )

Public Function ZTest ( referenceMean As Double, referenceStandardDeviation As Double ) As TestResult

public: TestResult^ ZTest( double referenceMean, double referenceStandardDeviation )

member ZTest : referenceMean : float * referenceStandardDeviation : float -> TestResult

#### Parameters

- referenceMean
- Double

The mean of the comparison population.

- referenceStandardDeviation
- Double

The standard deviation of the comparison population.

#### Return Value

TestResultA test result indicating whether the sample mean is significantly different from that of the comparison population.

# Remarks

A z-test determines whether the sample is compatible with a normal population with known mean and standard deviation. In most cases, Student's t-test (StudentTTest(Double)), which does not assume a known population standard deviation, is more appropriate.

# Examples

Suppose a standardized test exists, for which it is known that the mean score is 100 and the standard deviation is 15 across the entire population. The test is administered to a small sample of a subpopulation, who obtain a mean sample score of 95. You can use the z-test to determine how likely it is that the subpopulation mean really is lower than the population mean, that is that their slightly lower mean score in your sample is not merely a fluke.

# Exceptions

Exception | Condition |
---|---|

Meta.Numerics.Statistics..::..InsufficientDataException | Count is zero. |