Package weka.experiment
Class PairedStats
- java.lang.Object
-
- weka.experiment.PairedStats
-
- All Implemented Interfaces:
RevisionHandler
- Direct Known Subclasses:
PairedStatsCorrected
public class PairedStats extends java.lang.Object implements RevisionHandler
A class for storing stats on a paired comparison (t-test and correlation)- Version:
- $Revision: 1.10 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
-
-
Field Summary
Fields Modifier and Type Field Description doublecorrelationThe correlation coefficientdoublecountThe number of data points seendoubledifferencesProbabilityThe probability of obtaining the observed differencesintdifferencesSignificanceA significance indicator: 0 if the differences are not significant > 0 if x significantly greater than y < 0 if x significantly less than yStatsdifferencesStatsThe stats associated with the paired differencesdoublesigLevelThe significance level for comparisonsStatsxStatsThe stats associated with the data in column 1doublexySumThe sum of the productsStatsyStatsThe stats associated with the data in column 2
-
Constructor Summary
Constructors Constructor Description PairedStats(double sig)Creates a new PairedStats object with the supplied significance level.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double[] value1, double[] value2)Adds an array of observed pair of values.voidadd(double value1, double value2)Add an observed pair of values.voidcalculateDerived()Calculates the derived statistics (significance etc).intgetDegreesOfFreedom()Gets the degrees of freedom.java.lang.StringgetRevision()Returns the revision string.static voidmain(java.lang.String[] args)Tests the paired stats object from the command line.voidsetDegreesOfFreedom(int d)Sets the degrees of freedom (if calibration is required).voidsubtract(double[] value1, double[] value2)Removes an array of observed pair of values.voidsubtract(double value1, double value2)Removes an observed pair of values.java.lang.StringtoString()Returns statistics on the paired comparison.
-
-
-
Field Detail
-
xStats
public Stats xStats
The stats associated with the data in column 1
-
yStats
public Stats yStats
The stats associated with the data in column 2
-
differencesStats
public Stats differencesStats
The stats associated with the paired differences
-
differencesProbability
public double differencesProbability
The probability of obtaining the observed differences
-
correlation
public double correlation
The correlation coefficient
-
xySum
public double xySum
The sum of the products
-
count
public double count
The number of data points seen
-
differencesSignificance
public int differencesSignificance
A 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 sigLevel
The significance level for comparisons
-
-
Method Detail
-
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
public java.lang.String toString()
Returns statistics on the paired comparison.- Overrides:
toStringin classjava.lang.Object- Returns:
- the t-test statistics as a string
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
Tests the paired stats object from the command line. reads line from stdin, expecting two values per line.- Parameters:
args- ignored.
-
-