Calculating Standard Deviation

numero = 298
interpreted = N
texte = I needed to do this for one of my hobby sites, so I thought I would share. Good if you have a scoring or ratings system on your site.

make sure that you have a tab on this line as indicated: sdev[index]<tab>[math][interpret][dev[index]][/interpret]*[interpret][dev[index]][/interpret][/math]

[!]<!-- The following code will find the standard deviation-->[/!][!]<!-- in a range of numbers stored in a database (or table),  -->[/!][!]<!-- where math.db is your database of scores                -->[/!][!]<!-- SAMPLE DATABASE:rating8565497156-->[/!][!]<!--Should yield a STANDARD DEVIATION of 2.22-->[/!][search db=math.db&neRATINGdatarq=[blank]][text show=F]numscores=[numfound][/text][founditems]Rating [index]=[text show=T]num[index]=[rating][/text]<br>[/founditems]Total: [text show=T]total=[sum field=rating][/text]<br>[/search]Avg: [text show=T]avg=[math][total]/[numscores][/math][/text]<br><hr>[loop start=1&end=[numscores]][text show=f]dev[index]=[math]([Interpret][num[index]][/Interpret]-[avg])*-1[/math][/text][/loop][table name=sdev&fields=sku,sdevnum][loop start=1&end=[numscores]]sdev[index]<tab>[math][interpret][dev[index]][/interpret]*[interpret][dev[index]][/interpret][/math][/loop][/table][search table=sdev&neskudatarq=[blank]][text show=f]devsum=[sum field=sdevnum][/text]<br>[/search][text show=f]ass=[math][devsum]/([numscores]-1)[/math][/text]Standard Deviation =[format .2f][math]sqrt([ass])[/math][/format]
I needed to do this for one of my hobby sites, so I thought I would share. Good if you have a scoring or ratings system on your site.

make sure that you have a tab on this line as indicated:
sdev[index]<tab>[math][interpret][dev[index]][/interpret]*[interpret][dev[index]][/interpret][/math]



[!]<!-- The following code will find the standard deviation-->[/!]
[!]<!-- in a range of numbers stored in a database (or table), -->[/!]
[!]<!-- where math.db is your database of scores -->[/!]
[!]<!--
SAMPLE DATABASE:
rating
8
5
6
5
4
9
7
1
5
6
-->[/!]
[!]<!--Should yield a STANDARD DEVIATION of 2.22-->[/!]

[search db=math.db&neRATINGdatarq=[blank]]
[text show=F]numscores=[numfound][/text]
[founditems]
Rating [index]=[text show=T]num[index]=[rating][/text]<br>
[/founditems]
Total: [text show=T]total=[sum field=rating][/text]<br>
[/search]
Avg: [text show=T]avg=[math][total]/[numscores][/math][/text]<br>
<hr>
[loop start=1&end=[numscores]]
[text show=f]dev[index]=[math]([interpret][num[index]][/Interpret]-[avg])*-1[/math][/text]
[/loop]
[table name=sdev&fields=sku,sdevnum]
[loop start=1&end=[numscores]]
sdev[index]<tab>[math][interpret][dev[index]][/interpret]*[interpret][dev[index]][/interpret][/math]
[/loop]
[/table]
[search table=sdev&neskudatarq=[blank]]
[text show=f]devsum=[sum field=sdevnum][/text]<br>
[/search]

[text show=f]ass=[math][devsum]/([numscores]-1)[/math][/text]
Standard Deviation =[format .2f][math]sqrt([ass])[/math][/format]
Gary Krockover

DOWNLOAD WEBDNA NOW!

Top Articles:

[biotype]

BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

Download WebDNA Applications

WebDNA applications...

WebDNA Modules

A list of the currently available modules...

WebDNA Libraries

A list of available libraries for WebDNA...

Tips and Tricks

A list of user-submitted tips ...

Related Readings:

reCAPTCHA code

reCAPTCHA helps prevent automated abuse of your site (such as comment spam or bogus registrations) by using a CAPTCHA to ensure that only humans perform certain actions...

Annoying character on writefile

How do I get rid of or convert the line feed character during a writefile?...

Hideif on IP range

This will show or hide stuff according to the IP...

Setting a 30-minute Cookie

Configuring the expires time for a short-term cookie is tricky...

Do you hate updating the copyright notice at the bottom of all your pages?

It's January 1st and you have to update the copyright notice at the bottom of all your websites...

Redefining [date] & [time] to match your time zone

Your server is not always in the same time zone as your web site...