Iterator it = num_hierLevel.keySet().iterator();
while (it.hasNext()) {
String name = (String) it.next();
outFile.write(name + "\t");
CorrectAssignment assign = (CorrectAssignment) num_hierLevel.get(name);
calStandardError(assign);
int total = 0;
int correct = 0;
for (i = assign.bins - 1; i >= 0; i--) {
outFile.write(assign.numCorrect[i] + "\t" + assign.numTotal[i] + "\t");
total += assign.numTotal[i];
correct += assign.numCorrect[i];
}
if (total > 0) {
outFile.write(correct + "\t" + total + "\t" + (double) correct / ((double) total) + "\t");
} else {
outFile.write(correct + "\t" + total + "\t" + 0 + "\t");
}
outFile.write("\n");
}
outFile.write("\n\n** 2. The average votes for each bin range \n");
it = num_hierLevel.keySet().iterator();
while (it.hasNext()) {
String name = (String) it.next();
outFile.write(name + " \t ");
CorrectAssignment assign = (CorrectAssignment) num_hierLevel.get(name);
for (i = assign.bins - 1; i >= 0; i--) {
if (assign.numTotal[i] == 0) {
outFile.write("0\t");
} else {
outFile.write(df.format(assign.sumOfVotes[i] * 100 / assign.numTotal[i]) + "\t");
}
}
outFile.write(" \n");
}
outFile.write("\n\n** 3. The percentage of correctness for each bin range (the percentage of #1)\n");
it = num_hierLevel.keySet().iterator();
while (it.hasNext()) {
String name = (String) it.next();
outFile.write(name + " \t ");
CorrectAssignment assign = (CorrectAssignment) num_hierLevel.get(name);
for (i = assign.bins - 1; i >= 0; i--) {
if (assign.numTotal[i] == 0) {
outFile.write("0\t");
} else {
outFile.write(df.format((float) assign.numCorrect[i] / (float) assign.numTotal[i]) + "\t");
}
}
outFile.write(" \n");
}
outFile.write("\n\n** 4. The standard error for each bin range \n");
it = num_hierLevel.keySet().iterator();
while (it.hasNext()) {
String name = (String) it.next();
outFile.write(name + " \t ");
CorrectAssignment assign = (CorrectAssignment) num_hierLevel.get(name);
for (i = assign.bins - 1; i >= 0; i--) {
outFile.write(df.format(assign.standardError[i]) + "\t");
}
outFile.write(" \n");