Package weka.experiment
Class PairedStats
java.lang.Object
weka.experiment.PairedStats
- All Implemented Interfaces:
RevisionHandler
- Direct Known Subclasses:
PairedStatsCorrected
A class for storing stats on a paired comparison (t-test and correlation)
- Version:
- $Revision: 14314 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
-
Field Summary
Modifier and TypeFieldDescriptiondouble
The correlation coefficientdouble
The number of data points seendouble
The probability of obtaining the observed differencesint
A significance indicator: 0 if the differences are not significant > 0 if x significantly greater than y < 0 if x significantly less than yThe stats associated with the paired differencesdouble
The significance level for comparisonsThe stats associated with the data in column 1double
The sum of the productsThe stats associated with the data in column 2 -
Constructor Summary
ConstructorDescriptionPairedStats
(double sig) Creates a new PairedStats object with the supplied significance level. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(double[] value1, double[] value2) Adds an array of observed pair of values.void
add
(double value1, double value2) Add an observed pair of values.void
Calculates the derived statistics (significance etc).int
Gets the degrees of freedom.Returns the revision string.static void
Tests the paired stats object from the command line.void
setDegreesOfFreedom
(int d) Sets the degrees of freedom (if calibration is required).void
subtract
(double[] value1, double[] value2) Removes an array of observed pair of values.void
subtract
(double value1, double value2) Removes an observed pair of values.toString()
Returns statistics on the paired comparison.
-
Field Details
-
xStats
The stats associated with the data in column 1 -
yStats
The stats associated with the data in column 2 -
differencesStats
The stats associated with the paired differences -
differencesProbability
public double differencesProbabilityThe probability of obtaining the observed differences -
correlation
public double correlationThe correlation coefficient -
xySum
public double xySumThe sum of the products -
count
public double countThe number of data points seen -
differencesSignificance
public int differencesSignificanceA significance indicator: 0 if the differences are not significant > 0 if x significantly greater than y < 0 if x significantly less than y -
sigLevel
public double sigLevelThe significance level for comparisons
-
-
Constructor Details
-
PairedStats
public PairedStats(double sig) Creates a new PairedStats object with the supplied significance level.- Parameters:
sig
- the significance level for comparisons
-
-
Method Details
-
setDegreesOfFreedom
public void setDegreesOfFreedom(int d) Sets the degrees of freedom (if calibration is required). -
getDegreesOfFreedom
public int getDegreesOfFreedom()Gets the degrees of freedom. -
add
public void add(double value1, double value2) Add an observed pair of values.- Parameters:
value1
- the value from column 1value2
- the value from column 2
-
subtract
public void subtract(double value1, double value2) Removes an observed pair of values.- Parameters:
value1
- the value from column 1value2
- the value from column 2
-
add
public void add(double[] value1, double[] value2) Adds an array of observed pair of values.- Parameters:
value1
- the array containing values from column 1value2
- the array containing values from column 2
-
subtract
public void subtract(double[] value1, double[] value2) Removes an array of observed pair of values.- Parameters:
value1
- the array containing values from column 1value2
- the array containing values from column 2
-
calculateDerived
public void calculateDerived()Calculates the derived statistics (significance etc). -
toString
Returns statistics on the paired comparison. -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
Tests the paired stats object from the command line. reads line from stdin, expecting two values per line.- Parameters:
args
- ignored.
-