R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(71.59,71.65,71.47,71.82,71.76,71.88,73.31,73.22,72.74,72.95,73.71,74.45,76.54,77.41,76.87,76.51,75.66,75.09,75.16,75,75.05,74.78,75.43,75.61,77.12,83.09,86.09,87.64,88.29,89.3,89.99,90.43,91.03,91.4,92.19,92.45,92.42,90.2,88.23,84.91,82.92,81.8,81.7,83.22,82.7,82.83,83.66,84.28,84.37,86.49,87.62,88.59,89.74,89.73,89.14,88.37,88.65,89.16,89.56,89.37,89.67,93.04,94.4,95.5,101.66,102.86,102.48,102.02,101.83,101.3,101.29,100.53,100.45,101.88,101.95,102.18,100.95,100.52,100.39,99.61,99.43,99.34,100.73,102.14,102.22,101.14,100.91,101.62,100,99.92,100.07,98.48,98.3,98.86,98.96,99.52,99.06,100.47,100.24,86.43,85.14,85.41,86.13,86.19,86.29,87.55,87.87,88.37) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Standard Deviation Plot (v1.0.2) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_sdplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > arr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + if (j == par1) j = 0 + } > ari [1] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 71.59 76.54 77.12 92.42 84.37 89.67 100.45 102.22 99.06 NA [2,] 71.65 77.41 83.09 90.20 86.49 93.04 101.88 101.14 100.47 NA [3,] 71.47 76.87 86.09 88.23 87.62 94.40 101.95 100.91 100.24 NA [4,] 71.82 76.51 87.64 84.91 88.59 95.50 102.18 101.62 86.43 NA [5,] 71.76 75.66 88.29 82.92 89.74 101.66 100.95 100.00 85.14 NA [6,] 71.88 75.09 89.30 81.80 89.73 102.86 100.52 99.92 85.41 NA [7,] 73.31 75.16 89.99 81.70 89.14 102.48 100.39 100.07 86.13 NA [8,] 73.22 75.00 90.43 83.22 88.37 102.02 99.61 98.48 86.19 NA [9,] 72.74 75.05 91.03 82.70 88.65 101.83 99.43 98.30 86.29 NA [10,] 72.95 74.78 91.40 82.83 89.16 101.30 99.34 98.86 87.55 NA [11,] 73.71 75.43 92.19 83.66 89.56 101.29 100.73 98.96 87.87 NA [12,] 74.45 75.61 92.45 84.28 89.37 100.53 102.14 99.52 88.37 NA > arr.sd <- array(NA,dim=par1) > arr.range <- array(NA,dim=par1) > arr.iqr <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.sd[j] <- sqrt(var(arr[j,],na.rm=TRUE)) + arr.range[j] <- max(arr[j,],na.rm=TRUE) - min(arr[j,],na.rm=TRUE) + arr.iqr[j] <- quantile(arr[j,],0.75,na.rm=TRUE) - quantile(arr[j,],0.25,na.rm=TRUE) + } > overall.sd <- sqrt(var(x)) > overall.range <- max(x) - min(x) > overall.iqr <- quantile(x,0.75) - quantile(x,0.25) > postscript(file="/var/wessaorg/rcomp/tmp/122ti1447870542.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.sd,type='b',ylab='S.D.',main='Standard Deviation Plot',xlab='Periodic Index') > mtext(paste('# blocks = ',np)) > abline(overall.sd,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2lwar1447870542.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.range,type='b',ylab='range',main='Range Plot',xlab='Periodic Index') > mtext(paste('# blocks = ',np)) > abline(overall.range,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3kxhl1447870542.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.iqr,type='b',ylab='IQR',main='Interquartile Range Plot',xlab='Periodic Index') > mtext(paste('# blocks = ',np)) > abline(overall.iqr,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4osb31447870542.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(arr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 71.59 71.65 71.47 71.82 71.76 71.88 73.31 73.22 72.74 72.95 [2,] 77.12 83.09 86.09 84.91 82.92 81.80 81.70 83.22 82.70 82.83 [3,] 89.67 90.20 88.23 87.64 88.29 89.30 89.14 88.37 88.65 89.16 [4,] 99.06 100.47 100.24 95.50 100.00 99.92 100.07 98.48 98.30 98.86 [5,] 102.22 101.88 101.95 102.18 101.66 102.86 102.48 102.02 101.83 101.30 [,11] [,12] [1,] 73.71 74.45 [2,] 83.66 84.28 [3,] 89.56 89.37 [4,] 98.96 99.52 [5,] 101.29 102.14 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 78.11493 81.04653 80.77767 82.0626 79.29453 79.7568 79.46513 80.33307 [2,] 101.22507 99.35347 95.68233 93.2174 97.28547 98.8432 98.81487 96.40693 [,9] [,10] [,11] [,12] [1,] 80.434 80.71753 81.502 81.3436 [2,] 96.866 97.60247 97.618 97.3964 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(71.59, 77.12, 89.67, 99.06, 102.22, 71.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54f6t1447870542.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(arr) > names(z) <- c(1:np) > (boxplot(z,notch=TRUE,col='grey',xlab='Block Index',ylab='Value',main='Notched Box Plots - Sequential Blocks')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 71.470 74.780 83.090 81.700 86.490 89.670 99.340 98.300 85.140 NA [2,] 71.705 75.070 86.865 82.765 87.995 94.950 100.000 98.910 86.160 NA [3,] 72.310 75.520 89.645 83.440 88.895 101.295 100.625 99.960 86.990 NA [4,] 73.265 76.525 91.215 86.570 89.465 101.925 101.915 101.025 93.715 NA [5,] 74.450 77.410 92.450 90.200 89.740 102.860 102.180 102.220 100.470 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 71.59847 74.85636 87.66094 81.70451 88.22452 98.11366 99.75156 98.99533 [2,] 73.02153 76.18364 91.62906 85.17549 89.56548 104.47634 101.49844 100.92467 [,9] [,10] [1,] 83.54411 NA [2,] 90.43589 NA $out [1] 77.12 92.42 84.37 $group [1] 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(71.47, 71.705, 72.31, 73.265, 74.45, 74.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66u921447870542.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.sd,arr.range,arr.iqr)) > names(z) <- list('S.D.','Range','IQR') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Variability',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 10.23685 27.580 14.150 [2,] 10.32740 28.575 15.250 [3,] 10.58381 29.535 15.815 [4,] 10.85862 30.420 17.750 [5,] 11.36772 30.980 18.370 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 10.34151 28.69348 14.67473 [2,] 10.82610 30.37652 16.95527 $out [1] 21.94 10.59 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(10.2368502371471, 10.3274011917672, 10.5838060379781, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/122ti1447870542.ps tmp/122ti1447870542.png",intern=TRUE)) character(0) > try(system("convert tmp/2lwar1447870542.ps tmp/2lwar1447870542.png",intern=TRUE)) character(0) > try(system("convert tmp/3kxhl1447870542.ps tmp/3kxhl1447870542.png",intern=TRUE)) character(0) > try(system("convert tmp/4osb31447870542.ps tmp/4osb31447870542.png",intern=TRUE)) character(0) > try(system("convert tmp/54f6t1447870542.ps tmp/54f6t1447870542.png",intern=TRUE)) character(0) > try(system("convert tmp/66u921447870542.ps tmp/66u921447870542.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.052 0.379 2.451