Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating Statistics Info
Message
 
To
27/05/1999 12:19:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00223474
Message ID:
00223522
Views:
27
>>>>Can anyone direct me to any statistical generation methods/functions for VFP?
>>>>
>>>>I'd like to know:
>>>>
>>>>Mean,Mode,Median,High/Low,Std Dev...stuff like that.
>>>>
>>>>TIA,
>>>>
>>>>/Chris
>>>
>>>You can get average and standard deviation (as well as some others) by using CALCULATE. Check the help file for details.
>>
>>George,
>>
>>I was able to generate all I need but median. Anything for that?
>>
>>/Chris
>"Median" ? Is it the value sitting in middle in a series ? If so and number of elements <= 65000 a simple way might be :
>
select myValue into array myArray where !isnull(myValue)
>if type("myArray") # "U"
> if alen(myArray,1) > 1
>    return myArray[floor(alen(myArray,1)/2) + 1]
> else
>    return myArray[1]
> endif
>endif
>return .null.
Hi Cetin,

Median is a value in a series of numbers where there are an equal number of values less than and greater than. Not knowing if there may be duplicate values makes this a bit harder. I'd try for the arithmetic mean (by getting the minimumand maximum values via CALCULATE) as a starting point. Where to go from there, I haven't figured out.:-)
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform