3 Replies Latest reply on Nov 2, 2018 4:25 AM by Ankit Bansal

    Aggregation and average problem on media studies

    raphael luce


      I'm working on a study of french radios.

      One of my graph is about politicians invited on air.


      My data looks like :

      One person can be a member of different parties at the same time. (a permanent party and a temporary party for a specific election for example)

      The age is relative to the date of the invitation.


      I have a problem with the aggregation of ages. I would like to get the average Age of people invited on all or on a specific radio.

      As I possibly have multiple lines for one invitation (invitation 2 for example), a simple average gives an erroneous value.


      For the example data, the right value should be : Average age : (20 + ( (60 + 60  ) /2 ) + 61 + 40 ) / 4 = 45,25

      But a simple average on all lines gives = (20+60+60+61+40) / 5 = 48,2


      How could I do that ?

      Thanks a lot.



      PS :

      Here is my final graph :

      At the top you can choose a radio

      In the middle you can see the names of politicians and the number of invitations (the colors indicate the party they are member of )

      At the bottom the weight of each party.