import javastat.eda.QuantitativeDataAnalysis;
/**
*
* <p>Example: class QuantitativeDataAnalysis.</p>
* <p>Data Source: Anderson, D. R.,
Sweeney, D. J. and Williams, T. A. (2001).
* Contemporary Business
Statistics with Microsoft Excel. South-Western,
* p. 81. </p>
*/
double[] testdata1 = {2350, 2450, 2550, 2380, 2255, 2210,
2390, 2630, 2440, 2825, 2420, 2380};
String[] printOut = {"Min.",
"Q1 ", "Q2 ", "Q3 ", "Max."};
testclass1
= new QuantitativeDataAnalysis(3, testdata1);
fiveNumberSummary = testclass1.fiveNumberSummary;
frequencyTable =
testclass1.frequencyTable;
for (int i = 0; i < fiveNumberSummary.length; i++)
{
print(printOut[i]
+ ": " + fiveNumberSummary[i]);
}
testclass2
= new QuantitativeDataAnalysis(testdata1);
fiveNumberSummary = testclass2.fiveNumberSummary;
frequencyTable =
testclass2.frequencyTable;
for (int j = 0; j < frequencyTable[0].length;
j++)
{
print("<=" + frequencyTable[0][j]
+ ": " + frequencyTable[1][j]);
}
Results:
Based
on non-null constructor:
Five
Number Summary:
Min.:
2210.0
Q1 : 2365.0
Q2 : 2405.0
Q3 : 2500.0
Max.:
2825.0
Based
on non-null constructor with default bin number:
Frequency
Distribution:
<=2364.0:
3.0
<=2518.0:
6.0
<=2672.0:
2.0
<=2826.0:
1.0
See also: