Date: Sun, 16 May 2021 06:39:51 +0000 (GMT) Message-ID: <177686975.8335.1621147191645@6a789edf488b> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8334_909079915.1621147191645" ------=_Part_8334_909079915.1621147191645 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html EXAMPLE - Statistical Functions

# EXAMPLE - Statistical Functions

This example illustrates how you can apply statistical functions= to your dataset. Calculations include average (mean), max, min, standard d= eviation, and variance.

Source:

Students took a test and recorded the following scores. You want to perf= orm some statistical analysis on them:

Student Score
Anna 84
Ben 71
Caleb 76
Danielle 87
Evan 85
Faith 92
Gabe 85
Hannah 99
Ian 73
Jane 68

Transform:

You can use the following transforms to calculate the average (mean), mi= nimum, and maximum scores:

derive type:single value:AVERAGE(Sco= re) as:'avgScore'

=20

derive type:single value:MIN(Score)<= span> as:'minScore'

=20

derive type:single value:MAX(Score)<= span> as:'maxScore'

To apply statistical functions to your= data, you can use the  `VAR` and  `STDEV` functions, which can be used as the basis for other stat= istical calculations. =20

derive type:single value:VAR(Score)<= /span>

=20

derive type:single value:STDEV(Score= )

For each score, you can now calculate the variation of each one= from the average, using the following:=20

derive type:single value:((Score - a= vg_Score) / stdev_Score) as:'stDevs'

Now, you want to apply grade= s based on a formula:

Grade standard devi= ations from avg (stDevs)
A stDevs > 1
B stDevs > 0.5
C -1 <=3D stDevs <=3D 0.5
D stDevs < -1
F stDevs < -2

You can build the following transform using the `IF`&nbs= p;function to calculate grades.

derive type:single value:IF((stDevs = > 1),'A',IF((stDevs < -2),'F',IF((stDevs < -1),'D',IF((stDevs >= 0.5),'B','C'))))

To clean up the content, you might want to apply some formatting to= the score columns. The following reformats the `stdev_Score` an= d `stDevs` columns to display two decimal places:

set col:stdev_Score value:NUMFORMAT(stdev_Score, = '##.00')

=20

set col:stDevs value:NUMFORMAT(stDevs, '##.00')

=20

derive type:single value:MODE(Score)= as:'modeScore'

Results:

Student Score modeScore avgScore minScore maxScore var_Score stdev_Score stDevs Grade
Anna 84 85 82 68 99

87.00000000000001<= /p>

9.33 0.21 C
Ben 71 85 82 68 99 87.00000000000001 9.33 -1.18 D
Caleb 76 85 82 68 99 87.00000000000001 9.33 -0.64 C
Danielle 87 85 82 68 99 87.00000000000001 9.33 0.54 B
Evan 85 85 82 68 99 87.00000000000001 9.33 0.32 C
Faith 92 85 82 68 99 87.00000000000001 9.33 1.07 A
Gabe 85 85 82 68 99 87.00000000000001 9.33 0.32 C
Hannah 99 85 82 68 99 87.00000000000001 9.33 1.82 A
Ian 73 85 82 68 99 87.00000000000001 9.33 -0.96 C
Jane 68 85 82 68 99 87.00000000000001 9.33 -1.50 D
------=_Part_8334_909079915.1621147191645--