Statistical Modules

hedwig.stats.quartile

hedwig.stats.quartile.label_quartiles(mapping)

Given a dictionary of some values (e.g. ratings) by some keys (e.g. proposal identifiers), return a new dictionary which maps the keys to quartile labels,

The labels should be:

4: upper quartile (value > Q3) 3: upper middle quartile (value > Q2) 2: lower middle quartile (value > Q1) 1: lower quartile (otherwise)

Note that we do not need to calculate precise quartile values since we never report these values. We need only choose points at which to break the input values into four approximately equally sized collections.

hedwig.stats.table

hedwig.stats.table.table_mean_stdev(table, rows, columns, scale_factor=1.0)