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(88.05,93.25,92.96,93.08,90.67,92.17,94.28,95.01,93.27,95.59,97.4,97.05,97.38,96.23,96.65,96.46,97.87,98.59,99.54,97.39,97.09,97.83,97.58,96.81,97.52,98.19,96.18,97.41,99.23,96.93,98.82,102.47,95.95,101.17,100.55,99.5,99.89,100.43,100.63,99.36,100,99.55,100.12,101.31,96.59,98.79,100.93,102.4,106.99,105.27,107.27,109.21,108.57,110.17,108.1,107.58,106.91,103,106.12,109.69) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 88.05 97.38 97.52 99.89 106.99 NA [2,] 93.25 96.23 98.19 100.43 105.27 NA [3,] 92.96 96.65 96.18 100.63 107.27 NA [4,] 93.08 96.46 97.41 99.36 109.21 NA [5,] 90.67 97.87 99.23 100.00 108.57 NA [6,] 92.17 98.59 96.93 99.55 110.17 NA [7,] 94.28 99.54 98.82 100.12 108.10 NA [8,] 95.01 97.39 102.47 101.31 107.58 NA [9,] 93.27 97.09 95.95 96.59 106.91 NA [10,] 95.59 97.83 101.17 98.79 103.00 NA [11,] 97.40 97.58 100.55 100.93 106.12 NA [12,] 97.05 96.81 99.50 102.40 109.69 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/14f031492795134.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/2cd8o1492795134.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/3wwrk1492795134.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/4za351492795134.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] [,11] [1,] 97.38 93.25 92.96 93.08 97.87 96.93 98.82 95.01 95.95 95.59 97.40 [2,] 97.38 96.23 96.18 96.46 97.87 96.93 98.82 97.39 95.95 97.83 97.58 [3,] 97.52 98.19 96.65 97.41 99.23 98.59 99.54 101.31 96.59 98.79 100.55 [4,] 99.89 100.43 100.63 99.36 100.00 99.55 100.12 102.47 97.09 101.17 100.93 [5,] 99.89 105.27 107.27 99.36 100.00 99.55 100.12 107.58 97.09 103.00 100.93 [,12] [1,] 96.81 [2,] 97.05 [3,] 99.50 [4,] 102.40 [5,] 109.69 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.74644 95.22229 93.50564 95.36087 97.72495 96.73871 98.62142 [2,] 99.29356 101.15771 99.79436 99.45913 100.73505 100.44129 100.45858 [,8] [,9] [,10] [,11] [,12] [1,] 97.72048 95.78448 96.42996 98.1829 95.7197 [2,] 104.89952 97.39552 101.15004 102.9171 103.2803 $out [1] 88.05 106.99 109.21 90.67 108.57 92.17 110.17 94.28 108.10 93.27 [11] 106.91 106.12 $group [1] 1 1 4 5 5 6 6 7 7 9 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(97.38, 97.38, 97.52, 99.89, 99.89, 93.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o8n71492795134.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] [1,] 90.670 96.230 95.950 98.790 103.000 NA [2,] 92.565 96.730 97.170 99.455 106.515 NA [3,] 93.260 97.385 98.505 100.060 107.425 NA [4,] 95.300 97.850 100.025 100.780 108.890 NA [5,] 97.400 98.590 102.470 102.400 110.170 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.01255 96.87416 97.20282 99.45566 106.3417 NA [2,] 94.50745 97.89584 99.80718 100.66434 108.5083 NA $out [1] 88.05 99.54 96.59 $group [1] 1 2 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(90.67, 92.565, 93.26, 95.3, 97.4, 96.23, 96.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66b3c1492795134.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,] 2.888301 7.410 1.140 [2,] 4.692730 12.295 2.320 [3,] 5.263055 13.730 3.120 [4,] 6.236174 17.015 4.325 [5,] 6.782399 18.940 5.350 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.559079 11.57718 2.205506 [2,] 5.967030 15.88282 4.034494 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.88830053837893, 4.69272960431335, 5.26305491364417, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14f031492795134.ps tmp/14f031492795134.png",intern=TRUE)) character(0) > try(system("convert tmp/2cd8o1492795134.ps tmp/2cd8o1492795134.png",intern=TRUE)) character(0) > try(system("convert tmp/3wwrk1492795134.ps tmp/3wwrk1492795134.png",intern=TRUE)) character(0) > try(system("convert tmp/4za351492795134.ps tmp/4za351492795134.png",intern=TRUE)) character(0) > try(system("convert tmp/5o8n71492795134.ps tmp/5o8n71492795134.png",intern=TRUE)) character(0) > try(system("convert tmp/66b3c1492795134.ps tmp/66b3c1492795134.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.575 0.268 2.896