|
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
public abstract class HypothesisTest
A statistical hypothesis test is a method of making decisions using experimental data. A result is called statistically significant if it is unlikely to have occurred by chance.
Specifically, given a null hypothesis, we compute the p-value of a test statistics. The p-value tells the probability of observing the observations. We often accept the alternative hypothesis, (i.e. rejects a null hypothesis) if the p-value is less than 0.05 or 0.01, corresponding respectively to a 5% or 1% chance of rejecting the null hypothesis when it is true.
| Field Summary | |
|---|---|
int |
k
number of groups of observations |
int |
N
total number of observations |
protected double |
pValue
p-value for the test statistics |
protected double |
testStatistics
the test statistics |
| Constructor Summary | |
|---|---|
protected |
HypothesisTest(double[]... samples)
Construct an instance of HypothesisTest from samples. |
| Method Summary | |
|---|---|
abstract java.lang.String |
alternativeHypothesis()
Get a description of the alternative hypothesis. |
abstract java.lang.String |
nullHypothesis()
Get a description of the null hypothesis. |
static double |
oneSidedPvalue(UnivariateDistribution F,
double x)
A one-sided P-value is the probability of observing a test statistic at least as extreme as the one observed; hence, the one-sided P-value is simply given by the complementary cumulative distribution function (survival function) for continuous distribution. |
double |
pValue()
Get the p-value. |
boolean |
rejectNull(double alpha)
Use p-value to check whether the null hypothesis can be rejected for given significance level (size) alpha. |
double |
testStatistics()
Get the test statistics. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final int k
public final int N
protected volatile double testStatistics
protected volatile double pValue
| Constructor Detail |
|---|
protected HypothesisTest(double[]... samples)
samples - an array of samples| Method Detail |
|---|
public double testStatistics()
public double pValue()
public boolean rejectNull(double alpha)
alpha - significance level (size) of test
p-value < alphapublic abstract java.lang.String nullHypothesis()
public abstract java.lang.String alternativeHypothesis()
public static double oneSidedPvalue(UnivariateDistribution F,
double x)
For discrete distribution, we need to include the probability observing the critical value as well.
F - a univariate distributionx - the critical value
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||