Standard Deviation

  • Statistical simulation of the standard deviation with R-Project

     x1 <- c(rep(15,2),rep(30,4),rep(40,10),rep(50,10),rep(60,3),rep(75,1));
     x2 <- (x1-40)/5;
    ni<- table(x1);
    
    n<-sum(ni)
    
    s1 <-sd(x1)*sqrt((n-1)/n)
    s1
    [1] 12.52664
    
    s2 <- sd(x2)*sqrt((n-1)/n)
    s2
    [1] 2.505328
    
    s2*5
    [1] 12.52664
    



  • Statistical simulation of the standard deviation with Mathematica

    x1 := Join[ConstantArray[15, 2], ConstantArray[30, 4], 
       ConstantArray[40, 10], ConstantArray[50, 10], ConstantArray[60, 3], 
       ConstantArray[75, 1]];
    x2 := (x1-40)/5;
       
    ni := Tally [x1];
    
    n := Sum[ni[[i, 2]], {i, Length[ni]}];
    
    s1:=StandardDeviation[x1]  Sqrt[(n - 1)/n];
    s2:=StandardDeviation[x2]  Sqrt[(n - 1)/n];
    
    N[s1]
    N[s2]
    N[s2 5]
    
    
    12.5266
    2.50533
    12.5266