import javastat.inference.twosamples.TwoSampProps;

 

/**

 *

 * <p>Example: class TwoSampProps.</p>

 */

 

testclass1 = new TwoSampProps(0.05, 0, "less", 36, 150, 30, 100);

testStatistic = testclass1.testStatistic;

pValue = testclass1.pValue;

lowerBound = testclass1.confidenceInterval[0];

upperBound = testclass1.confidenceInterval[1];

print("The test statistic (non-null constructor)         =  " + testStatistic);

print("The p-value (non-null constructor)             =  " + pValue);

print("The confidence interval (non-null constructor)   = [" +

     lowerBound + " , " + upperBound + "]");

 

testclass2 = new TwoSampProps();

confidenceInterval = testclass2.confidenceInterval(0.05, 36, 150, 30, 100);

testStatistic = testclass2.testStatistic(0, 36, 150, 30, 100);

pValue = testclass2.pValue(0.5, "greater", 36, 150, 30, 100);

print("The test statistic (null constructor)             =  " + testStatistic);

print("The p-value (null constructor)                 =  " + pValue);

print("The confidence interval (null constructor)       = [" +

     confidenceInterval[0] + " , " + confidenceInterval[1] + "]");

 

Results:

The test statistic based on non-null constructor         =  -1.054

The p-value based on non-null constructor             =  0.146

The confidence interval based on non-null constructor   = [-0.173 , 0.053]

The test statistic based on null constructor             =  -1.054

The p-value based on null constructor                 =  1.0

The confidence interval based on null constructor       = [-0.173 , 0.053]

 

See also:

Estimation and Hypothesis Testing for the Difference

between the Proportions of Two Populations