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(62.38,62.62,64.15,64.97,66.12,67.08,68.66,69.04,70.8,73.2,74.19,75.36,75.54,76.81,77.69,79.34,80.36,80.74,81.12,82.95,87.31,88.93,90.8,91.29,91.36,92.72,95.75,97.19,98.73,99.03,99.4,99.66,100.5,101.21,101.26,101.44,101.97,102.23,102.58,101.91,101.63,101.1,100.71,100.75,100.14,97.72,94.91,94.34,97.11,96.51,95.8,95.25,95.09,94.97,95.21,95.46,95.33,95.14,95.6,95.66,95.66,96.33,97.66,98.27,99.53,100.86,101.26,101.29,101.38,101.49,101.29,101.26) > 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,] 62.38 75.54 91.36 101.97 97.11 95.66 NA [2,] 62.62 76.81 92.72 102.23 96.51 96.33 NA [3,] 64.15 77.69 95.75 102.58 95.80 97.66 NA [4,] 64.97 79.34 97.19 101.91 95.25 98.27 NA [5,] 66.12 80.36 98.73 101.63 95.09 99.53 NA [6,] 67.08 80.74 99.03 101.10 94.97 100.86 NA [7,] 68.66 81.12 99.40 100.71 95.21 101.26 NA [8,] 69.04 82.95 99.66 100.75 95.46 101.29 NA [9,] 70.80 87.31 100.50 100.14 95.33 101.38 NA [10,] 73.20 88.93 101.21 97.72 95.14 101.49 NA [11,] 74.19 90.80 101.26 94.91 95.60 101.29 NA [12,] 75.36 91.29 101.44 94.34 95.66 101.26 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/1r6zf1492854245.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/2fx6c1492854245.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/3pjw91492854245.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/4lexr1492854245.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,] 62.38 62.620 64.150 64.97 66.12 67.08 68.660 69.04 70.800 73.20 [2,] 75.54 76.810 77.690 79.34 80.36 80.74 81.120 82.95 87.310 88.93 [3,] 93.51 94.525 95.775 96.22 96.91 97.00 97.305 97.56 97.735 96.43 [4,] 97.11 96.510 97.660 98.27 99.53 100.86 100.710 100.75 100.500 101.21 [5,] 101.97 102.230 102.580 101.91 101.63 101.10 101.260 101.29 101.380 101.49 [,11] [,12] [1,] 90.800 91.29 [2,] 90.800 91.29 [3,] 95.255 95.00 [4,] 101.260 101.26 [5,] 101.290 101.44 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.59665 81.81786 82.8937 84.00954 84.54473 84.02195 84.66882 [2,] 107.42335 107.23214 108.6563 108.43046 109.27527 109.97805 109.94118 [,8] [,9] [,10] [,11] [,12] [1,] 86.07843 89.22702 88.509 88.50796 88.56903 [2,] 109.04157 106.24298 104.351 102.00204 101.43097 $out [1] 74.19 75.36 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(62.38, 75.54, 93.51, 97.11, 101.97, 62.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56uzk1492854245.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,] 62.38 75.540 91.360 94.910 94.970 95.660 NA [2,] 64.56 78.515 96.470 98.930 95.175 97.965 NA [3,] 67.87 80.930 99.215 100.925 95.395 101.060 NA [4,] 72.00 88.120 100.855 101.940 95.730 101.290 NA [5,] 75.36 91.290 101.440 102.580 96.510 101.490 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 64.47657 76.5491 97.21497 99.55212 95.14186 99.54345 NA [2,] 71.26343 85.3109 101.21503 102.29788 95.64814 102.57655 NA $out [1] 94.34 97.11 $group [1] 4 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(62.38, 64.56, 67.87, 72, 75.36, 75.54, 78.515, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hz0q1492854245.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,] 9.613765 26.080 7.80750 [2,] 11.307268 29.435 10.47500 [3,] 13.564262 33.310 14.83625 [4,] 14.574437 37.685 15.70875 [5,] 15.212588 39.610 17.25250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 12.07408 29.54712 12.4491 [2,] 15.05444 37.07288 17.2234 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(9.61376461122281, 11.3072677036882, 13.5642618989309, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r6zf1492854245.ps tmp/1r6zf1492854245.png",intern=TRUE)) character(0) > try(system("convert tmp/2fx6c1492854245.ps tmp/2fx6c1492854245.png",intern=TRUE)) character(0) > try(system("convert tmp/3pjw91492854245.ps tmp/3pjw91492854245.png",intern=TRUE)) character(0) > try(system("convert tmp/4lexr1492854245.ps tmp/4lexr1492854245.png",intern=TRUE)) character(0) > try(system("convert tmp/56uzk1492854245.ps tmp/56uzk1492854245.png",intern=TRUE)) character(0) > try(system("convert tmp/6hz0q1492854245.ps tmp/6hz0q1492854245.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.506 0.302 2.866