Cumulative standard deviation: Difference between revisions

m
Added small COBOL example. Corrected PL/I and R lang tags.
(Added COBOL example.)
m (Added small COBOL example. Corrected PL/I and R lang tags.)
Line 472:
Using an intrinsic function:
<lang cobol>FUNCTION STANDARD-DEVIATION(2, 4, 4, 4, 5, 5, 7, 9)</lang>
 
The implementation of this based of the standard's implementation:
<lang cobol>FUNCTION SQRT(FUNCTION VARIANCE(2, 4, 4, 4, 5, 5, 7, 9))</lang>
 
=={{header|CoffeeScript}}==
Line 1,771 ⟶ 1,774:
 
=={{header|PL/I}}==
<lang PL/Ipli>
declare A(200) float;
declare ap fixed binary;
Line 1,991 ⟶ 1,994:
=={{header|R}}==
===Built-in Std Dev fn===
<lang Rrsplus>#The built-in standard deviation function applies the Bessel correction. To reverse this, we can apply an uncorrection.
#If na.rm is true, missing data points (NA values) are removed.
reverseBesselCorrection <- function(x, na.rm=FALSE)
Line 2,003 ⟶ 2,006:
reverseBesselCorrection(testdata)*sd(testdata) #2</lang>
===From scratch===
<lang Rrsplus>#Again, if na.rm is true, missing data points (NA values) are removed.
uncorrectedsd <- function(x, na.rm=FALSE)
{
Anonymous user