computing the median

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Nick
Posts: 103
Joined: Tue Oct 10, 2017 12:44 pm

computing the median

Post by Nick » Tue Sep 03, 2002 9:03 pm

is there a recommended way to calculated the median value in RR (it is sometimes preferred to the average).____median in this case is the "middle" value between min and max.____

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: computing the median

Post by kfleming » Thu Sep 05, 2002 7:43 am

You could create a preprocessed total that counts the records in the group. Then sort the group by the field whose median value you need.__Create a calc that divides the pre-processed total by 2 and then do a running total. When the running total meets or equals the /2 calc, then you are at the middle value.____Kathleen__R&R Support

rlwarden_(Guest)
Posts: 11
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: computing the median

Post by rlwarden_(Guest) » Thu Sep 05, 2002 2:09 pm

How would you calculate the median for multiple data fields in the same record?

Nick
Posts: 103
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: computing the median

Post by Nick » Fri Sep 06, 2002 10:40 pm

thanks for the explanation.____if you had more than one field you needed to calculate a median value for - you would need to make an additional pass of the data - with that additional field sorted and calculated - then export that result to an xbase file - which is related to in the next report - that sorts the data on the 2nd field, etc. There would be 1 more report than the number of data fields that needed to have the median calculated.____it^s like doing your own "preprocessed" totals...__the first report would be real simple and only do the needed calculation and export - preparing the data for the 2nd report, etc.____you can use RR to build the index on the exported dbf using flexlink -or- you can used visual foxpro, etc to build the index.____i had one guy that knows more about statistics than i do tell me that one program (SPSS) adjusts the median on an even/odd number of records in the set - if it^s odd- you use the exact value of the midpoint record - if it^s even - you take the average of the two midpoint records (low and high). of course that wouldn^t be correct if the median had to be a "real" value instead of a calculated one.____i think we^ve exhausted the discussion on median for now...__back to you,__nick__

Post Reply