Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generating Statistics Info
Message
 
À
27/05/1999 12:19:42
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00223474
Message ID:
00223522
Vues:
26
>>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform