String spaces= " "; //$NON-NLS-1$
ps.println("(average over " + n + " samples):"); //$NON-NLS-1$ //$NON-NLS-2$
for (int i= 0; i < dimensions.length; i++) {
Dim dimension= dimensions[i];
double mean= s.getAverage(dimension);
String nameString= " " + dimension.getName() + ":"; //$NON-NLS-1$ //$NON-NLS-2$
String meanString= dimension.getDisplayValue(mean);
int align= firstNonDigit(meanString);
meanString= spaces.substring(0, 30 - align - nameString.length()) + meanString;
align= nameString.length() + meanString.length();
Percentile percentile= StatisticsUtil.T95;
double[] confidenceInterval= s.getConfidenceInterval(dimension, percentile);
String confidenceString= n <= 2
? " (no confidence)" //$NON-NLS-1$
: spaces.substring(0, 40 - align) + format.format(new Object[] {new Double(percentile.inside()), dimension.getDisplayValue(confidenceInterval[0]), dimension.getDisplayValue(confidenceInterval[1])});
align+= confidenceString.length();
String sizeWarning;
try {
sizeWarning= spaces.substring(0, 70 - align) + checkSampleSize(s, sample, dimension);
} catch (CoreException x) {
badDimensions.add(dimension);
continue;
}
ps.println(nameString + meanString + confidenceString + sizeWarning);
}
if (!badDimensions.isEmpty()) {
ps.print(" Dimensions with unusable statistical properties: "); //$NON-NLS-1$
for (Iterator iter= badDimensions.iterator(); iter.hasNext();) {
Dim dimension= (Dim) iter.next();
ps.print(dimension.getName());
if (iter.hasNext())
ps.print(", "); //$NON-NLS-1$
}
ps.println();
}