HypothesisTests.McNemarTest Method

Definition

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

Overload List

McNemarTest(ICategoricalVector, ICategoricalVector, Boolean) Returns a McNemar test whether proportions are the same in two samples.
McNemarTest<T>(IList<T>, IList<T>, Boolean) Returns a McNemar test whether proportions are the same in two samples.

McNemarTest(ICategoricalVector, ICategoricalVector, Boolean)

Returns a McNemar test whether proportions are the same in two samples.
C#
public static McNemarTest McNemarTest(
	ICategoricalVector sample1,
	ICategoricalVector sample2,
	bool continuityCorrection = false
)

Parameters

sample1  ICategoricalVector
A categorical vector containing the first sample.
sample2  ICategoricalVector
A categorical vector containing the second sample.
continuityCorrection  Boolean  (Optional)
Specifies whether a continuity correction should be applied.

Return Value

McNemarTest
A McNemar test

Remarks

Both samples must be categorical variables with only two levels, and they must have the same length.

Exceptions

ArgumentNullException

sample1 is null.

-or-

sample2 is null.

ArgumentException

sample1 does not have exactly two levels.

-or-

sample2 does not have exactly two levels.

DimensionMismatchException

sample1 and sample2 do not have the same number of observations.

McNemarTest<T>(IList<T>, IList<T>, Boolean)

Returns a McNemar test whether proportions are the same in two samples.
C#
public static McNemarTest McNemarTest<T>(
	IList<T> sample1,
	IList<T> sample2,
	bool continuityCorrection = false
)

Parameters

sample1  IList<T>
A categorical vector containing the first sample.
sample2  IList<T>
A categorical vector containing the second sample.
continuityCorrection  Boolean  (Optional)
Specifies whether a continuity correction should be applied.

Type Parameters

T

Return Value

McNemarTest
A McNemar test

Remarks

Both samples must be categorical variables with only two levels, and they must have the same length.

Exceptions

ArgumentNullException

sample1 is null.

-or-

sample2 is null.

ArgumentException

sample1 does not have exactly two levels.

-or-

sample2 does not have exactly two levels.

DimensionMismatchException

sample1 and sample2 do not have the same number of observations.

See Also