16. Simple Statistical Example

Student test scores are scaled to produce grades which have an average of 80 and standard deviation of 15:
% cat grades.ss

a0:d0 = { "grade", "score", "avg", "stdev"};
mean = avg(b1:b5); c1 = mean; d1 = stdev(b1:b5);
a1 = 80+15*(b1-mean)/$d$1; // scaled scores
copy a2:a5 a1:a4;
b1:b5 = { 57, 67, 92, 87, 76 }; // raw scores
eval; print symbols values formulas pointers;

% SS --Table grades.ss
 
  mean = avg(B1:B5) = 75.8
   A  B  C  D
0 grade score avg stdev
1 60.29 57.00 75.80 14.31
2 70.77 67.00
3 96.98 92.00
4 91.74 87.00
5 80.21 76.00
   A  B  C  D
0 "grade" "score" "avg" "stdev"
1 80+((15*(B1-mean))/$D$1) 57 mean stdev(B1:B5)
2 80+((15*(B2-mean))/$D$1) 67
3 80+((15*(B3-mean))/$D$1) 92
4 80+((15*(B4-mean))/$D$1) 87
5 80+((15*(B5-mean))/$D$1) 76
   A  B  C  D
0 0x83cbaf0 0x83cbb40 0x83cbb80 0x83cbbc0
1 0x83cbf80 (nil) 0x83cbd00 0x83cbda0
2 0x83cbf80 (nil)
3 0x83cbf80 (nil)
4 0x83cbf80 (nil)
5 0x83cbf80 (nil)