HypothesisTests.PairedTTest Method

Returns a paired TwoSampleTTest for the difference between two population means.

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
C#
public static TwoSampleTTest PairedTTest(
	Vector<double> sample1,
	Vector<double> sample2,
	double difference = 0,
	HypothesisType type = HypothesisType.TwoTailed
)

Parameters

sample1  Vector<Double>
A vector containing a sample from the first population.
sample2  Vector<Double>
A vector containing a sample from the second population.
difference  Double  (Optional)
The proposed difference between the population means. The default is 0.
type  HypothesisType  (Optional)
A HypothesisType value that specifies whether the test is two-tailed (the default) or one-tailed.

Return Value

TwoSampleTTest
A paired two sample t test for the specified samples.

Exceptions

ArgumentNullException

sample1 is null.

-or-

sample2 is null.

DimensionMismatchException

sample1 and sample2 do not have the same length.

InsufficientDataException

The length of the samples is less than 2.

See Also