public class T extends HypothesisTest
Welch's t test is an adaptation of Student's t-test intended for use with two samples having possibly unequal variances.
The R equivalent function is t.test.
| Modifier and Type | Field and Description |
|---|---|
double |
df
degree of freedom
|
double |
mean1
mean for sample 1
|
double |
mean2
mean for sample 2
|
double |
pValue1SidedGreater
right, one-sided p-value
|
double |
pValue1SidedLess
left, one-sided p-value
|
ProbabilityDistribution |
T
the associated TDistribution distribution
|
double |
var1
variance for sample 1
|
double |
var2
variance for sample 2
|
k, N, pValue, testStatistics| Constructor and Description |
|---|
T(double[] sample,
double mu)
Construct a one-sample location test of whether the mean of a normally distributed population has a value specified in a null hypothesis.
|
T(double[] sample1,
double[] sample2)
Construct Welch's t test, an adaptation of Student's t-test, for the use with two samples having possibly unequal variances.
|
T(double[] sample1,
double[] sample2,
boolean isEqualVar,
double mu)
Construct a two sample location test of the null hypothesis that the means of two normally distributed populations are equal.
|
T(double[] sample1,
double[] sample2,
double mu)
Construct Welch's t test, an adaptation of Student's t-test, for the use with two samples having possibly unequal variances.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
confidenceInterval(double confidence)
Compute the confidence interval.
|
java.lang.String |
getAlternativeHypothesis()
Get a description of the alternative hypothesis.
|
java.lang.String |
getNullHypothesis()
Get a description of the null hypothesis.
|
double |
leftConfidenceInterval(double confidence)
Compute the one sided left confidence interval, [0, a]
|
double |
rightConfidenceInterval(double confidence)
Compute the one sided right confidence interval, [a, ∞)
|
isNullRejected, oneSidedPvalue, pValue, statisticspublic final double df
public final double mean1
public final double var1
public final double mean2
public final double var2
public final double pValue1SidedLess
public final double pValue1SidedGreater
public final ProbabilityDistribution T
public T(double[] sample,
double mu)
sample - samplemu - the hypothetical mean in the null hypothesispublic T(double[] sample1,
double[] sample2)
sample1 - sample 1sample2 - sample 2public T(double[] sample1,
double[] sample2,
double mu)
sample1 - sample 1sample2 - sample 2mu - the hypothetical mean-difference in the null hypothesispublic T(double[] sample1,
double[] sample2,
boolean isEqualVar,
double mu)
sample1 - sample 1sample2 - sample 2isEqualVar - true if we assume the variances of the two samples are equal; false otherwisemu - the hypothetical mean-difference in the null hypothesis. Default value is 0.public java.lang.String getNullHypothesis()
HypothesisTestgetNullHypothesis in class HypothesisTestpublic java.lang.String getAlternativeHypothesis()
HypothesisTestgetAlternativeHypothesis in class HypothesisTestpublic double[] confidenceInterval(double confidence)
confidence - the confidence level, e.g., for a 2-sided 95% confidence interval, we use 0.975 because 1 - 0.95 = 2 * (1 - 0.025)public double rightConfidenceInterval(double confidence)
confidence - the confidence level, e.g., 0.95 for 95% confidence intervalpublic double leftConfidenceInterval(double confidence)
confidence - the confidence level, e.g., 0.95 for 95% confidence interval