2 Replies Latest reply on Oct 29, 2013 11:15 AM by Ramon Martinez

    Histograms: creating bins based on mean and standard deviation

    Florencia Curto

      Hi,

       

      I'm trying to create histogram bins based on the mean and standard deviation of the population.

       

      I tried this by calculating 3 fields:
      1. MEAN for the variable i'm trying to bin (in this case, score)

      2. STDDEV for the variable i'm trying to bin (in this case, score)

      3. BIN using the SCORE, MEAN and STDDEV using the formula below:

      If [Score] < [MEAN]+[STDDEV]*-3 then 1
      ElseIf [Score] < [MEAN]+[STDDEV]*-2 then 2
      ElseIf [Score] < [MEAN]+[STDDEV]*-1 then 3
      ElseIf [Score] < [MEAN]+[STDDEV]*0 then 4
      ElseIf [Score] < [MEAN]+[STDDEV]*1 then 5
      ElseIf [Score] < [MEAN]+[STDDEV]*2 then 6
      Else 7
      End

       

      But it gives the following error:

      "Cannot mix aggregate and non-aggregate arguments to function"

       

      Does anyone have any suggestions on how to avoid this? I also tried using the fields MEAN and STDDEV in the parameters but this only gives a slider and I want only one value for this population

       

      Thanks!

      Flo