okfn / ibp-explorer

[ARCHIVED] Data Explorer for the Open Budget Survey, built in collaboration with the International Budget Partnership.
http://survey.internationalbudget.org
7 stars 5 forks source link

Plain English description of calculator for OBI scores #120

Open brew opened 6 years ago

brew commented 6 years ago

Explain how the calculator calculates the OBI score. Confirm that the numbers it generates are correct given the issue with the “n/a” and “-1” (#119).

brew commented 6 years ago

Each country on the ranking page will receive a display score out of 100.

This score is calculated by the reportgenerator.js module. Specifically in the calculateScore method:

https://github.com/okfn/ibp-explorer/blob/015a29c2a36f95222f5ba0ad52ab0e28d770fb44/explorer/views/reportgenerator.js#L116-L132

calculateScore takes country data from the main data object (_EXPLORER_DATASET in ibp_dataset.js) and a question set.

Questions may be answered with a non-score-contributing value ('e' with a value of -1). These answer values are excluded from the ranking calculations. Answer values of 0 or above are used in the score calculation. These answers are 'scorable'.

For each question in the questionset, scoreable answer values are summed, then divided by the total number of 'scoreable' questions in the questionset. This value is then rounded to provide the final country score for display.

If a country has no scoreable answers (all provided answers are -1), its final score is set to -1, and displayed as 'N/A'.