@ConfidenceTestAssumptions(name="Paired Student\'s t-test", description="Computes the value of the null hypothesis that the differences between paired samples have zero mean and that the data are sampled from a Gaussian distributions with equal variances.", alsoKnownAs="Dependent t-test for paired samples", nullHypothesis="The means of the groups are equal.", assumptions={"The data for the pairs are iid samples from a Gaussian distribution with equal variances.","The common variances times the degrees of freedom is a chi-square distribution.","The data pairs should be sampled independently from each other."}, distribution=StudentTDistribution.CDF.class, dataPaired=true, dataSameSize=true, reference=@PublicationReference(author="Wikipedia",title="Student\'s t-test, Dependent t-test for paired samples",type=WebPage,year=2009,url="http://en.wikipedia.org/wiki/Student_t_test#Dependent_t-test_for_paired_samples")) public class StudentTConfidence extends AbstractCloneableSerializable implements NullHypothesisEvaluator<java.util.Collection<? extends java.lang.Number>>, ConfidenceIntervalEvaluator<java.util.Collection<? extends java.lang.Number>>
Modifier and Type | Class and Description |
---|---|
static class |
StudentTConfidence.Statistic
Confidence statistics for a Student-t test
|
static class |
StudentTConfidence.Summary
An implementation of the
Summarizer interface for creating a
ConfidenceInterval |
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_TOLERANCE
Default tolerance for the standard deviation, 1.0E-10.
|
static StudentTConfidence |
INSTANCE
This class has no members, so here's a static instance.
|
Constructor and Description |
---|
StudentTConfidence()
Creates a new instance of StudentTConfidence
|
Modifier and Type | Method and Description |
---|---|
ConfidenceInterval |
computeConfidenceInterval(java.util.Collection<? extends java.lang.Number> data,
double confidence)
Computes a confidence interval for a given dataset and confidence (power)
level
|
ConfidenceInterval |
computeConfidenceInterval(double mean,
double variance,
int numSamples,
double confidence)
Computes the confidence interval given the mean and variance of
the samples, number of samples, and corresponding confidence interval
|
StudentTConfidence.Statistic |
evaluateNullHypothesis(java.util.Collection<? extends java.lang.Number> data1,
java.util.Collection<? extends java.lang.Number> data2)
Computes a paired Student-t test for the given data.
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
public static final StudentTConfidence INSTANCE
public static final double DEFAULT_TOLERANCE
public StudentTConfidence()
@PublicationReference(author={"William H. Press","Saul A. Teukolsky","William T. Vetterling","Brian P. Flannery"}, title="Numerical Recipes in C, Second Edition", type=Book, year=1992, pages=618, notes="Function tptest()", url="http://www.nrbook.com/a/bookcpdf.php") public StudentTConfidence.Statistic evaluateNullHypothesis(java.util.Collection<? extends java.lang.Number> data1, java.util.Collection<? extends java.lang.Number> data2)
evaluateNullHypothesis
in interface NullHypothesisEvaluator<java.util.Collection<? extends java.lang.Number>>
data1
- First dataset to considerdata2
- Second dataset to considerpublic ConfidenceInterval computeConfidenceInterval(java.util.Collection<? extends java.lang.Number> data, double confidence)
ConfidenceIntervalEvaluator
computeConfidenceInterval
in interface ConfidenceIntervalEvaluator<java.util.Collection<? extends java.lang.Number>>
data
- Dataset to use to compute the ConfidenceIntervalconfidence
- Confidence level (power, 1-pvalue) for the ConfidenceInterval,
must be on the interval (0,1]public ConfidenceInterval computeConfidenceInterval(double mean, double variance, int numSamples, double confidence)
ConfidenceIntervalEvaluator
computeConfidenceInterval
in interface ConfidenceIntervalEvaluator<java.util.Collection<? extends java.lang.Number>>
mean
- Mean of the distribution.variance
- Variance of the distribution.numSamples
- Number of samples in the underlying dataconfidence
- Confidence value to assume for the ConfidenceInterval