Notes:
awk -F, '
BEGIN {
OFS=","
euro_pop = 739
}
NR > 1 {
directions_following = 1
p = $47
if (p ~ /[Mm]illion/) {
directions_following = 0
}
sub(" *[Mm]illions?", "", p)
if (p ~ /billion/) {
directions_following = 0
sub(" *billion", "", p)
p *= 1000
}
gsub(" ", "", p)
p += 0
if (p >= 1e6) {
p = int(p/1e6)
directions_following = 0
}
error = p - euro_pop
percent_error = 100 * error / euro_pop
correct = percent_error >= -10 && percent_error <= 10
print p, $48, correct, directions_following, $72
}' lwpublic2013.csv |
egrep -v ', *,|, *$' > lwpublic2013-cfarworkshop_vs_eurocalibration.csv
set grid
unset key
set logscale x
set terminal png
set output "%%FILE%%.png"
set xlabel "Estimated Population in Millions"
set ylabel "Confidence"
plot [1:1e6] [0:100] "0%%FILE%%" pt 13, "1%%FILE%%" pt 13
awk -F, '{ print $1, $2 > $3 $4 $5 }' < ../lwpublic2013-cfarworkshop_vs_eurocalibration.csv
for directions in 0 1;do for workshop in No 'I have been to at least one CFAR class but not a full (3+ day) workshop' 'Yes I have been to a full (3+ day) workshop';do sed "s/%%FILE%%/${directions}$workshop/g" plot | gnuplot;done; done
montage -tile 3x2 -geometry +1+1 "0No.png" "1No.png" "0I have been to at least one CFAR class but not a full (3+ day) workshop.png" "1I have been to at least one CFAR class but not a full (3+ day) workshop.png" "0Yes I have been to a full (3+ day) workshop.png" "1Yes I have been to a full (3+ day) workshop.png" out.png