Greetings and salutations!
I am looking for the algorithm behind the WEIGHT function.
Three simple analogies to what I'm looking for are:
SUM(numexpr1, numexpr2, numexpr3, ... numexprX) = numexpr1+numexpr2+numexpr3+ ... +numexprX
AVERAGE(numexpr1, numexpr2, numexpr3, ... numexprX) = (numexpr1+numexpr2+numexpr3+ ... +numexprX)/X
AVERAGE(numexpr1, numexpr2, numexpr3, ... numexprX) = SUM(numexpr1, numexpr2, numexpr3, ... numexprX)/X
I've submitted a support request on this (Case number TSXXXXXX962) , but was told to ask the good folks here.
I am looking for a "general case" description. I was able to figure out and implement a "special case," algorithm but the algorithm I used only seems to work with the specific question type I was working on. I'm not looking for any proprietary information. I would be extremely surprised if the WEIGHT algorithm was not available publicly since people have been weighting data since (I would imagine) long before computers were a thing.
I've looked in IBM_SPSS_Statistics_Algorithms.pdf (from IBM SPSS Statistics 29 Documentation) and Numerical Recipes in Fortran 77 Second Edition.
Could some charitable soul direct me to a reference source (webpage, book, etc.) or provide pseudocode here?
Thank you in advance!
Paul
#WEIGHT#Algorithms
------------------------------
Paul Lee
------------------------------