2 Replies Latest reply: Dec 6, 2012 10:17 AM by Ilia Barantchouk RSS

    Weighted standard deviation

      Hi everybody,


      I really need help in Set analysis for calculating weighted standard deviation.


      The regular standard deviation formula is here:


      Stdev({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID = {$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"}>} Y.Answer)



      To calculate the weighted one I need to have a formula like:


      SQRT(Sum({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID = {$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"}>} SQR(WEIGHT*Y.Answer-MEANW))/

      Count(({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID = {$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"}>}  Y.Answer))



      The MEANW - weighted average that was calculated before, but I don't know how to implement it into the set analysis. And if I calculate the MEANW in the STDEV  formula, I don't get any results.



      Please help!


      Thank you very much in advance!