Cumulative standard deviation: Difference between revisions

no edit summary
(Added full COBOL implementation.)
No edit summary
Line 2,202:
7 value in = 7 Stand Dev = 1.399708
8 value in = 9 Stand Dev = 2.000000</pre>
 
=={{header|SAS}}==
===Data Step==
<lang sas>
*--Calculate the standard deviation in a data step using the STD function;
data stat1;
sd=std(2,4,4,4,5,5,7,9);
run;
 
*--Display the calculated SD;
proc print data=stat1;
run;
</lang>
 
===Using PROC MEANS===
<lang sas>
*--Store the test data in a data set;
data test;
input x;
datalines;
2
4
4
4
5
5
7
9
;
run;
 
*--Calculate the standard deviation using PROC MEANS;
proc means data=test;
var x;
output out=stat2 mean=mean std=sd; *--Besides the SD many other statistics may be calculated;
run;
 
*--Display the calculated SD;
proc print data=stat1;
var sd;
run;
</lang>
 
 
 
=={{header|Scheme}}==