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(85.13,85.54,85.47,85.78,86.07,86.05,86.32,86.43,86.41,86.38,86.59,86.68,86.87,87.32,87.13,87.42,87.22,87.17,87.52,87.49,87.53,87.93,88.54,88.96,89.3,90.01,90.52,90.64,91.25,91.59,92.09,91.81,92.03,92.15,91.98,92.11,92.28,92.53,91.97,92.05,91.87,91.49,91.48,91.63,91.46,91.61,91.7,91.87,92.21,92.65,92.83,93.02,93.33,93.35,93.45,93.51,93.8,93.94,94.02,94.26,94.71,95.26,95.54,95.69,96.03,96.4,96.55,96.45,96.65,96.84,97.21,97.31,97.91,98.51,98.54,98.52,98.66,98.53,98.71,98.92,98.96,99.25,99.32,99.41,99.36,99.58,99.77,99.77,100.03,100.2,100.24,100.1,100.03,100.18,100.29,100.41,100.6,100.75,100.79,100.44,100.29,100.34,100.46,100.12,100.06,100.28,100.28,100.4) > 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,] 85.13 86.87 89.30 92.28 92.21 94.71 97.91 99.36 100.60 NA [2,] 85.54 87.32 90.01 92.53 92.65 95.26 98.51 99.58 100.75 NA [3,] 85.47 87.13 90.52 91.97 92.83 95.54 98.54 99.77 100.79 NA [4,] 85.78 87.42 90.64 92.05 93.02 95.69 98.52 99.77 100.44 NA [5,] 86.07 87.22 91.25 91.87 93.33 96.03 98.66 100.03 100.29 NA [6,] 86.05 87.17 91.59 91.49 93.35 96.40 98.53 100.20 100.34 NA [7,] 86.32 87.52 92.09 91.48 93.45 96.55 98.71 100.24 100.46 NA [8,] 86.43 87.49 91.81 91.63 93.51 96.45 98.92 100.10 100.12 NA [9,] 86.41 87.53 92.03 91.46 93.80 96.65 98.96 100.03 100.06 NA [10,] 86.38 87.93 92.15 91.61 93.94 96.84 99.25 100.18 100.28 NA [11,] 86.59 88.54 91.98 91.70 94.02 97.21 99.32 100.29 100.28 NA [12,] 86.68 88.96 92.11 91.87 94.26 97.31 99.41 100.41 100.40 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/11zaf1447938502.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/2fh7m1447938502.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/3gte71447938502.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/437251447938502.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,] 85.13 85.54 85.47 85.78 86.07 86.05 86.32 86.43 86.41 86.38 [2,] 89.30 90.01 90.52 90.64 91.25 91.49 91.48 91.63 91.46 91.61 [3,] 92.28 92.65 92.83 93.02 93.33 93.35 93.45 93.51 93.80 93.94 [4,] 97.91 98.51 98.54 98.52 98.66 98.53 98.71 98.92 98.96 99.25 [5,] 100.60 100.75 100.79 100.44 100.29 100.34 100.46 100.12 100.06 100.28 [,11] [,12] [1,] 86.59 86.68 [2,] 91.70 91.87 [3,] 94.02 94.26 [4,] 99.32 99.41 [5,] 100.29 100.41 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 87.7454 88.17333 88.60613 88.86987 89.4274 89.64227 89.6422 89.6706 89.85 [2,] 96.8146 97.12667 97.05387 97.17013 97.2326 97.05773 97.2578 97.3494 97.75 [,10] [,11] [,12] [1,] 89.91627 90.0068 90.28893 [2,] 97.96373 98.0332 98.23107 $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(85.13, 89.3, 92.28, 97.91, 100.6, 85.54, 90.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5iqs01447938502.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,] 85.130 86.870 89.30 91.460 92.210 94.710 97.910 99.360 100.06 NA [2,] 85.660 87.195 90.58 91.550 92.925 95.615 98.525 99.770 100.28 NA [3,] 86.195 87.455 91.70 91.785 93.400 96.425 98.685 100.065 100.37 NA [4,] 86.420 87.730 92.06 92.010 93.870 96.745 99.105 100.220 100.53 NA [5,] 86.680 87.930 92.15 92.530 94.260 97.310 99.410 100.410 100.79 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.84836 87.21098 91.02496 91.57519 92.96898 95.9096 98.42046 99.85975 [2,] 86.54164 87.69902 92.37504 91.99481 93.83102 96.9404 98.94954 100.27025 [,9] [,10] [1,] 100.256 NA [2,] 100.484 NA $out [1] 88.54 88.96 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(85.13, 85.66, 86.195, 86.42, 86.68, 86.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69s471447938502.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,] 5.076673 13.650 7.04 [2,] 5.181949 13.715 7.35 [3,] 5.265103 14.180 7.58 [4,] 5.363482 14.935 7.95 [5,] 5.470141 15.470 8.61 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.182305 13.62355 7.306336 [2,] 5.347902 14.73645 7.853664 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.0766732326506, 5.18194929232868, 5.26510349431442, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11zaf1447938502.ps tmp/11zaf1447938502.png",intern=TRUE)) character(0) > try(system("convert tmp/2fh7m1447938502.ps tmp/2fh7m1447938502.png",intern=TRUE)) character(0) > try(system("convert tmp/3gte71447938502.ps tmp/3gte71447938502.png",intern=TRUE)) character(0) > try(system("convert tmp/437251447938502.ps tmp/437251447938502.png",intern=TRUE)) character(0) > try(system("convert tmp/5iqs01447938502.ps tmp/5iqs01447938502.png",intern=TRUE)) character(0) > try(system("convert tmp/69s471447938502.ps tmp/69s471447938502.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.129 0.379 2.535