R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(91.16,91.17,91.17,91.38,92.68,92.72,92.79,92.81,92.81,92.81,92.81,92.81,92.81,92.82,92.82,92.88,93.38,93.89,94.1,94.18,94.3,94.31,94.36,94.38,94.38,94.5,94.57,94.89,96.71,97.57,97.88,97.97,98.4,98.51,98.46,98.46,98.48,98.6,98.6,98.71,99.13,99.2,99.3,100.18,101.37,101.77,102.28,102.38,102.35,103.23,105.37,106.62,107,107.24,107.31,107.35,107.42,107.58,107.64,107.64,107.68,108.51,110.37,111.31,111.57,111.66,111.69,111.9,111.95,112.04,112.13,112.14) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.16 92.81 94.38 98.48 102.35 107.68 NA [2,] 91.17 92.82 94.50 98.60 103.23 108.51 NA [3,] 91.17 92.82 94.57 98.60 105.37 110.37 NA [4,] 91.38 92.88 94.89 98.71 106.62 111.31 NA [5,] 92.68 93.38 96.71 99.13 107.00 111.57 NA [6,] 92.72 93.89 97.57 99.20 107.24 111.66 NA [7,] 92.79 94.10 97.88 99.30 107.31 111.69 NA [8,] 92.81 94.18 97.97 100.18 107.35 111.90 NA [9,] 92.81 94.30 98.40 101.37 107.42 111.95 NA [10,] 92.81 94.31 98.51 101.77 107.58 112.04 NA [11,] 92.81 94.36 98.46 102.28 107.64 112.13 NA [12,] 92.81 94.38 98.46 102.38 107.64 112.14 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/1aw5z1492893335.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/26r0n1492893335.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/32vma1492893335.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/49c3d1492893335.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,] 91.16 91.17 91.170 91.38 92.68 92.720 92.79 92.810 92.810 92.81 [2,] 92.81 92.82 92.820 92.88 93.38 93.890 94.10 94.180 94.300 94.31 [3,] 96.43 96.55 96.585 96.80 97.92 98.385 98.59 99.075 99.885 100.14 [4,] 102.35 103.23 105.370 106.62 107.00 107.240 107.31 107.350 107.420 107.58 [5,] 107.68 108.51 110.370 111.31 111.57 111.660 111.69 111.900 111.950 112.04 [,11] [,12] [1,] 92.81 92.81 [2,] 94.36 94.38 [3,] 100.37 100.42 [4,] 107.64 107.64 [5,] 112.13 112.14 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.27639 89.83521 88.48984 87.93726 89.13466 89.77382 90.06912 [2,] 102.58361 103.26479 104.68016 105.66274 106.70534 106.99618 107.11088 [,8] [,9] [,10] [,11] [,12] [1,] 90.57992 91.42218 91.58042 91.80397 91.86687 [2,] 107.57008 108.34782 108.69958 108.93603 108.97313 $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(91.16, 92.81, 96.43, 102.35, 107.68, 91.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jbr71492893335.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] [1,] 91.160 92.810 94.380 98.480 105.370 110.370 NA [2,] 91.275 92.850 94.730 98.655 105.995 110.840 NA [3,] 92.755 93.995 97.725 99.250 107.275 111.675 NA [4,] 92.810 94.305 98.430 101.570 107.500 111.995 NA [5,] 92.810 94.380 98.510 102.380 107.640 112.140 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.05488 93.33136 96.03741 97.92045 106.5886 111.1482 NA [2,] 93.45512 94.65864 99.41259 100.57955 107.9614 112.2018 NA $out [1] 102.35 103.23 107.68 108.51 $group [1] 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(91.16, 91.275, 92.755, 92.81, 92.81, 92.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w8911492893335.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,] 7.482934 18.890 10.26250 [2,] 7.485127 18.895 10.34125 [3,] 7.536655 19.115 10.50625 [4,] 7.588387 19.275 10.86750 [5,] 7.639580 19.330 11.26000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.489558 18.94168 10.26622 [2,] 7.583753 19.28832 10.74628 $out [1] 6.316087 6.690134 8.019495 16.520000 17.340000 19.930000 8.180000 [8] 8.832500 $group [1] 1 1 1 2 2 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.48293369385742, 7.48512737730091, 7.53665543088502, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1aw5z1492893335.ps tmp/1aw5z1492893335.png",intern=TRUE)) character(0) > try(system("convert tmp/26r0n1492893335.ps tmp/26r0n1492893335.png",intern=TRUE)) character(0) > try(system("convert tmp/32vma1492893335.ps tmp/32vma1492893335.png",intern=TRUE)) character(0) > try(system("convert tmp/49c3d1492893335.ps tmp/49c3d1492893335.png",intern=TRUE)) character(0) > try(system("convert tmp/5jbr71492893335.ps tmp/5jbr71492893335.png",intern=TRUE)) character(0) > try(system("convert tmp/6w8911492893335.ps tmp/6w8911492893335.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.529 0.245 2.845