Skip to content

How to get average

jfoclpf edited this page Jan 12, 2016 · 8 revisions

The DB has a lot of inputs for several users.

The main functions are in statsFunctions.js

  1. Many inputs belong to same user, so there is need to calculate the averages of the average. Therefore we find two for loop cycles. The i cycle refers to an matrix with unique user ids for the specific country, while the j cycle refers to a matrix with all the information provided on the DB for that specific country.

  1. It is checked if the entry does not come from a bot. The first input from the user, must be greater than MIN_TIME_TO_FILL_FORM

  2. Then, the the calculation is made using the functions calculate_costs from coreFunctions.js

  3. The average of the averages are calculated the result is outputted.

Clone this wiki locally