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.83,71.39,73.71,74.13,74.45,74.95,75.09,75.23,76.11,76.64,76.97,78.23,77.15,76.33,70.19,68.42,66.49,63.41,62.92,65.53,65.26,68.25,74.39,78.71,82.15,86.05,89.46,89.32,88.94,93.35,94.72,96.11,104.06,104.11,103.9,110.75,110.82,107.59,96.03,95.69,90.63,75.87,75.57,78.78,74.93,75.85,75.49,76.87,78.18,79.37,80.59,81.18,81.02,82.75,83.63,85.35,90.52,90.66,90.69,92.56,92.87,93.82,96.32,96.03,96.53,102.96,102.38,102.66,106.83,106.5,106.78,108.49,108.77,110.43,110.84,110.52,110.11,109.42,109.06,108.98,108.36,108.11,108.44,107.76,106.27,101.07,100.79,100.97,99.33,99.35,99.23,98.14,98.17,98.48,99,99.19,99.1,100.13,100.07,95.26,94.72,94.25,89.46,88.38,88.57,93.82,93.94,93.92) > 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.83 77.15 82.15 110.82 78.18 92.87 108.77 106.27 99.10 NA [2,] 71.39 76.33 86.05 107.59 79.37 93.82 110.43 101.07 100.13 NA [3,] 73.71 70.19 89.46 96.03 80.59 96.32 110.84 100.79 100.07 NA [4,] 74.13 68.42 89.32 95.69 81.18 96.03 110.52 100.97 95.26 NA [5,] 74.45 66.49 88.94 90.63 81.02 96.53 110.11 99.33 94.72 NA [6,] 74.95 63.41 93.35 75.87 82.75 102.96 109.42 99.35 94.25 NA [7,] 75.09 62.92 94.72 75.57 83.63 102.38 109.06 99.23 89.46 NA [8,] 75.23 65.53 96.11 78.78 85.35 102.66 108.98 98.14 88.38 NA [9,] 76.11 65.26 104.06 74.93 90.52 106.83 108.36 98.17 88.57 NA [10,] 76.64 68.25 104.11 75.85 90.66 106.50 108.11 98.48 93.82 NA [11,] 76.97 74.39 103.90 75.49 90.69 106.78 108.44 99.00 93.94 NA [12,] 78.23 78.71 110.75 76.87 92.56 108.49 107.76 99.19 93.92 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/1g3rt1447959614.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/26pru1447959614.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/3kk731447959614.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/47qwo1447959614.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.83 71.39 70.19 68.42 66.49 63.41 62.92 65.53 65.26 68.25 [2,] 78.18 79.37 80.59 81.18 81.02 75.87 75.57 78.78 76.11 76.64 [3,] 92.87 93.82 96.03 95.26 90.63 93.35 89.46 88.38 90.52 93.82 [4,] 106.27 101.07 100.07 96.03 96.53 99.35 99.23 98.14 104.06 104.11 [5,] 110.82 110.43 110.84 110.52 110.11 109.42 109.06 108.98 108.36 108.11 [,11] [,12] [1,] 74.39 76.87 [2,] 76.97 78.71 [3,] 93.94 93.92 [4,] 103.90 107.76 [5,] 108.44 110.75 $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.07593 82.39133 85.77053 87.439 82.4614 80.98387 76.99907 78.18373 [2,] 107.66407 105.24867 106.28947 103.081 98.7986 105.71613 101.92093 98.57627 [,9] [,10] [,11] [,12] [1,] 75.79967 79.35247 79.75687 78.62033 [2,] 105.24033 108.28753 108.12313 109.21967 $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.83, 78.18, 92.87, 106.27, 110.82, 71.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zeia1447959614.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.390 62.920 82.150 74.930 78.180 92.870 107.76 98.14 88.380 NA [2,] 73.920 65.395 89.130 75.710 80.805 96.175 108.40 98.74 91.640 NA [3,] 75.020 68.335 94.035 77.825 83.190 102.520 109.02 99.28 94.095 NA [4,] 76.375 75.360 103.980 95.860 90.590 106.640 110.27 100.88 97.180 NA [5,] 78.230 78.710 110.750 110.820 92.560 108.490 110.84 101.07 100.130 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.90026 63.7899 87.26182 68.63445 78.727 97.74684 108.1671 98.30393 [2,] 76.13974 72.8801 100.80818 87.01555 87.653 107.29316 109.8729 100.25607 [,9] [,10] [1,] 91.56817 NA [2,] 96.62183 NA $out [1] 106.27 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(71.39, 73.92, 75.02, 76.375, 78.23, 62.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6wz131447959614.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,] 13.35261 33.880 14.85 [2,] 13.58471 39.015 19.42 [3,] 14.09199 41.375 23.57 [4,] 14.99684 43.535 27.71 [5,] 15.48513 46.140 29.05 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 13.44790 39.3134 19.78888 [2,] 14.73607 43.4366 27.35112 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(13.3526140803132, 13.584705090005, 14.0919857950189, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1g3rt1447959614.ps tmp/1g3rt1447959614.png",intern=TRUE)) character(0) > try(system("convert tmp/26pru1447959614.ps tmp/26pru1447959614.png",intern=TRUE)) character(0) > try(system("convert tmp/3kk731447959614.ps tmp/3kk731447959614.png",intern=TRUE)) character(0) > try(system("convert tmp/47qwo1447959614.ps tmp/47qwo1447959614.png",intern=TRUE)) character(0) > try(system("convert tmp/5zeia1447959614.ps tmp/5zeia1447959614.png",intern=TRUE)) character(0) > try(system("convert tmp/6wz131447959614.ps tmp/6wz131447959614.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.282 0.429 2.727