4 Replies Latest reply on Mar 29, 2018 11:54 AM by Eric Hammond

    inner products, weighting, and scoring

    Keegan Keplinger

      Imagine I have a dataset that gives a weighting (impact factor) of deaths, based on the cause of death, a number of deaths, and a number of times that cause occurs without a death:

       

      EVENT TYPE    |    W   |   deaths   |  events

      car                    |     .1  |     5          |  8

      car                    |     .1  |     3          |  6

      animal               |    .2   |     2          |  10

      human              |     .5  |     1          |   20

       

      Now, for each event type, I want to take the sum(deaths)/(sum(events) + sum(death)) effectivelly giving a ratio or "death rate" - but this should be distinct for each death type.  Then I want to multiply that result for each event type's death rate by the weighting.  Finally, i want to some all those together.  So, given the above table, the explicit mathematical formula would look like:

       

      Score = (.1)*(5 + 3)/(8+6) + .2(2/10) + .5(1/20)

       

      I have tried a couple different things, but I'm always either mixing aggregates and non-aggregates, or summing the fractions individually (a/x + b/y instead of (a+b)/(x+y).