Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Statistical functions in VFP6 (import)
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00435549
Message ID:
00435911
Views:
23
>>100000
> 99000

There's only one *standard* median, real life or elsewhere, any other methods I would say are non-standard. There are other statistical median measures from unusual distributions, but you're not likely to see them anywhere, probably.

I think the correct median was posted here by at least one person already, glancing through the posts - I've posted it in the past, also. Very simple, given n data points. Step 1 is critical:

1) ORDER your n data-points from smallest to largest (or reverse, doesn't matter). Median cannot be correctly found with un-ordered data.

2) If n is odd, take the middle value as your median - the (n+1)/2 value.

3) If n is even, it's the same basic formula, except you average the two middle values, add the n/2 point + (n+2)/2 point and divide that sum by 2. IOW, the mean of the 2 middle values.

EX: 1,4,8: 4 is the median

EX: 1,4,7,8: 4+7/2 = 11/2 = 5.5 is the median

In the case where only integers are usable median results, rounding can be used.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform