Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculate STD() vs. Excel STDEV() function
Message
De
02/09/2002 09:56:31
 
 
À
02/09/2002 09:37:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00695910
Message ID:
00695937
Vues:
19
>>I don't know a native command. I could probably write you a func... if you ever need it. I was reading somewhere that fox is quite good for developing mathematical functions (amongst other things) etc
>
>OK, thanks.

Couldn't resist the challenge...

FUNCTION MyStDev
LPARAMETERS tcfieldName, tcAlias
LOCAL lnReccount, lnSum, lnSquare
LOCAL lcTalk

lcTalk = SET( "TALK")
SET TALK OFF

lnReccount = RECCOUNT( tcAlias)

CALCULATE SUM( EVALUATE( tcFieldName)) TO lnSum

CALCULATE SUM( EVALUATE( tcFieldName)^2) TO lnSquare

SET TALK &lcTalk

RETURN SQRT((( lnReccount*lnSquare) - ( lnSum^2))/ (lnReccount*(lnReccount-1)))
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform