|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.stats.test.HypothesisTest
com.numericalmethod.suanshu.stats.test.mean.T
public class T
Student's TDistribution-test tests for the equality of means, for the one-sample case, against a hypothetical mean, and for two-sample case, of two populations.
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.
| Field Summary | |
|---|---|
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 |
UnivariateDistribution |
T
the associated TDistribution distribution |
double |
var1
variance for sample 1 |
double |
var2
variance for sample 2 |
| Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest |
|---|
k, N, pValue, testStatistics |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
java.lang.String |
alternativeHypothesis()
Get a description of the alternative hypothesis. |
double[] |
confidenceInterval(double confidence)
Compute the confidence interval. |
double |
leftConfidenceInterval(double confidence)
Compute the one sided left confidence interval, [0, a] |
java.lang.String |
nullHypothesis()
Get a description of the null hypothesis. |
double |
rightConfidenceInterval(double confidence)
Compute the one sided right confidence interval, [a, ∞) |
| Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest |
|---|
oneSidedPvalue, pValue, rejectNull, testStatistics |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public 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 UnivariateDistribution T
| Constructor Detail |
|---|
public T(double[] sample,
double mu)
sample - samplemu - the hypothetical mean in the null hypothesis
public T(double[] sample1,
double[] sample2)
sample1 - sample 1sample2 - sample 2
public T(double[] sample1,
double[] sample2,
double mu)
sample1 - sample 1sample2 - sample 2mu - the hypothetical mean-difference in the null hypothesis
public 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.| Method Detail |
|---|
public java.lang.String nullHypothesis()
HypothesisTest
nullHypothesis in class HypothesisTestpublic java.lang.String alternativeHypothesis()
HypothesisTest
alternativeHypothesis 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 interval
public double leftConfidenceInterval(double confidence)
confidence - the confidence level, e.g., 0.95 for 95% confidence interval
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||