javanpst.tests.countData.mcNemarTest
Class McNemarTest
- java.lang.Object
-
- javanpst.tests.StatisticalTest
-
- javanpst.tests.countData.mcNemarTest.McNemarTest
-
public class McNemarTest extends StatisticalTest
The McNemar test. This test can be applied to determine whether the row and column marginal frequencies of a 2 x 2 contingency table are equal. Three approximations are provided: - Exact p-value (through a binomial distribution) - Asymptotic p-value (through a normal distribution) - Asymptotic p-value (through a chi-square distribution)
-
-
Constructor Summary
Constructors Constructor and Description McNemarTest()Default builderMcNemarTest(DataTable newData)Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearData()Clears the data stored in the testvoiddoTest()Perform the testdoublegetAsymptoticChiPValue()Get asymptotic p-value (Chi-square approximation)doublegetAsymptoticNormalPValue()Get asymptotic p-value (Normal approximation)doublegetExactPValue()Get exact p-valuedoublegetS()Get S statisticdoublegetT()Get T statisticdoublegetZ()Get Z statisticjava.lang.StringprintData()Prints the data stored in the testjava.lang.StringprintReport()Prints a report with the results of the testvoidsetData(DataTable newData)Sets data to test-
Methods inherited from class javanpst.tests.StatisticalTest
isDataReady, isPerformed
-
-
-
-
Constructor Detail
-
McNemarTest
public McNemarTest()
Default builder
-
McNemarTest
public McNemarTest(DataTable newData)
Builder. Load data to test.- Parameters:
newData- data to test.
-
-
Method Detail
-
clearData
public void clearData()
Clears the data stored in the test- Specified by:
clearDatain classStatisticalTest
-
setData
public void setData(DataTable newData)
Sets data to test- Parameters:
newData- data to test.
-
doTest
public void doTest()
Perform the test- Specified by:
doTestin classStatisticalTest
-
getT
public double getT()
Get T statistic- Returns:
- T statistic
-
getZ
public double getZ()
Get Z statistic- Returns:
- Z statistic
-
getS
public double getS()
Get S statistic- Returns:
- S statistic
-
getExactPValue
public double getExactPValue()
Get exact p-value- Returns:
- exact p-value
-
getAsymptoticNormalPValue
public double getAsymptoticNormalPValue()
Get asymptotic p-value (Normal approximation)- Returns:
- asymptotic p-value
-
getAsymptoticChiPValue
public double getAsymptoticChiPValue()
Get asymptotic p-value (Chi-square approximation)- Returns:
- asymptotic p-value
-
printData
public java.lang.String printData()
Prints the data stored in the test- Specified by:
printDatain classStatisticalTest- Returns:
- Data stored
-
printReport
public java.lang.String printReport()
Prints a report with the results of the test- Specified by:
printReportin classStatisticalTest- Returns:
- Output report
-
-
DMelt 3.0 © DataMelt by jWork.ORG