Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STD() function (standard deviation)
Message
 
À
17/05/2006 07:50:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01122614
Message ID:
01122671
Vues:
19
Carlos,

AFAIK, there are several STDEV functions in Excel.
And they can be calculated from each other if you wish.

FoxPro STD() function is the same as STDEVP() Excel function. You may check it with, say:
clear
Dime atemp(500)
FOR ia=1 TO ALEN(atemp)
	atemp[ia] = 1000+ia
ENDFOR

oExcel= CREATEOBJECT("Excel.Application")
?ROUND(oExcel.Application.STDEV(@atemp),8)	
?ROUND(oExcel.Application.STDEVP(@atemp),8)
oExcel.quit
oExcel=.NULL.
release oExcel

CREATE CURSOR ctemp (fldn n(4))
FOR ia=1 TO ALEN(atemp)
     INSERT INTO CTEMP VALUES (atemp[ia])
endfor
SET DECIMALS TO 9
CALCULATE std(fldn) TO ln
?ROUND(ln,8)   && as STDEVP Excel function
?ROUND(ln*SQRT(ALEN(Atemp)/(ALEN(atemp)-1)),8)  && as STDEV Excel function

set deci to 2
>The std() (standard deviation) function is returning a value different from Excel when calculating over the same set o values.
>
>Do someone know about this?
>
>Hope you can help.
>
>Carlos Henrique
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform