HypothesisTests.ZTest Method

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

ZTest(Vector<Double>, Double, Double, HypothesisType) Returns a Z test for the mean of a population with known variance.
ZTest(Int32, Double, Double, Double, HypothesisType) Returns a Z test for the mean of a population with known variance.
ZTest(Int32, Double, Int32, Double, Double, HypothesisType) Constructs a new TwoSampleZTest(ICategoricalVector, ICategoricalVector, Double, HypothesisType) for the difference between two proportions.

ZTest(Vector<Double>, Double, Double, HypothesisType)

Returns a Z test for the mean of a population with known variance.
C#
public static OneSampleZTest ZTest(
	Vector<double> sample,
	double standardDeviation,
	double mean,
	HypothesisType type = HypothesisType.TwoTailed
)

Parameters

sample  Vector<Double>
A vector that contains a sample from the population.
standardDeviation  Double
The standard deviation of the population.
mean  Double
The proposed population mean.
type  HypothesisType  (Optional)
A HypothesisType value that specifies whether the test is two-tailed (the default) or one-tailed.

Return Value

OneSampleZTest
A one sample z test for the specified sample.

ZTest(Int32, Double, Double, Double, HypothesisType)

Returns a Z test for the mean of a population with known variance.
C#
public static OneSampleZTest ZTest(
	int sampleSize,
	double sampleMean,
	double standardDeviation,
	double mean,
	HypothesisType type = HypothesisType.TwoTailed
)

Parameters

sampleSize  Int32
The size of the sample.
sampleMean  Double
The mean of the sample.
standardDeviation  Double
The standard deviation of the population.
mean  Double
The proposed population mean.
type  HypothesisType  (Optional)
A HypothesisType value that specifies whether the test is two-tailed (the default) or one-tailed.

Return Value

OneSampleZTest
A one sample Z test.

ZTest(Int32, Double, Int32, Double, Double, HypothesisType)

Constructs a new TwoSampleZTest(ICategoricalVector, ICategoricalVector, Double, HypothesisType) for the difference between two proportions.
C#
public static TwoSampleZTest ZTest(
	int count1,
	double proportion1,
	int count2,
	double proportion2,
	double difference = 0,
	HypothesisType hypothesisType = HypothesisType.TwoTailed
)

Parameters

count1  Int32
The number of observations in the first sample.
proportion1  Double
The proportion of the first sample.
count2  Int32
The number of observations in the second sample.
proportion2  Double
The proportion of the second sample.
difference  Double  (Optional)
The proposed difference between the two proportions.
hypothesisType  HypothesisType  (Optional)
A HypothesisType value that specifies whether the test is two-tailed (the default) or one-tailed.

Return Value

TwoSampleZTest

Exceptions

ArgumentOutOfRangeException

count1 is less than 2.

-or

count2 is less than 2.

-or

proportion1 is less than zero or greater than one.

-or

proportion2 is less than zero or greater than one.

See Also