R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(14.544,14.931,14.886,16.005,17.064,15.168,16.050,15.839,15.137,14.954,15.648,15.305,15.579,16.348,15.928,16.171,15.937,15.713,15.594,15.683,16.438,17.032,17.696,17.745,19.394,20.148,20.108,18.584,18.441,18.391,19.178,18.079,18.483,19.644,19.195,19.650,20.830,23.595,22.937,21.814,21.928,21.777,21.383,21.467,22.052,22.680,24.320,24.977,25.204,25.739,26.434,27.525,30.695,32.436,30.160,30.236,31.293,31.077,32.226,33.865,32.810,32.242,32.700,32.819,33.947,34.148,35.261,39.506,41.591,39.148,41.216,40.225) > 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,] 14.544 15.579 19.394 20.830 25.204 32.810 NA [2,] 14.931 16.348 20.148 23.595 25.739 32.242 NA [3,] 14.886 15.928 20.108 22.937 26.434 32.700 NA [4,] 16.005 16.171 18.584 21.814 27.525 32.819 NA [5,] 17.064 15.937 18.441 21.928 30.695 33.947 NA [6,] 15.168 15.713 18.391 21.777 32.436 34.148 NA [7,] 16.050 15.594 19.178 21.383 30.160 35.261 NA [8,] 15.839 15.683 18.079 21.467 30.236 39.506 NA [9,] 15.137 16.438 18.483 22.052 31.293 41.591 NA [10,] 14.954 17.032 19.644 22.680 31.077 39.148 NA [11,] 15.648 17.696 19.195 24.320 32.226 41.216 NA [12,] 15.305 17.745 19.650 24.977 33.865 40.225 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/1w42l1366619655.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/2fvuu1366619655.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/33ung1366619655.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/46vbm1366619655.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,] 14.544 14.9310 14.8860 16.005 15.9370 15.168 15.5940 15.683 15.1370 14.954 [2,] 15.579 16.3480 15.9280 16.171 17.0640 15.713 16.0500 15.839 16.4380 17.032 [3,] 20.112 21.8715 21.5225 20.199 20.1845 20.084 20.2805 19.773 20.2675 21.162 [4,] 25.204 25.7390 26.4340 27.525 30.6950 32.436 30.1600 30.236 31.2930 31.077 [5,] 32.810 32.2420 32.7000 32.819 33.9470 34.148 35.2610 39.506 41.5910 39.148 [,11] [,12] [1,] 15.6480 15.3050 [2,] 17.6960 17.7450 [3,] 21.7575 22.3135 [4,] 32.2260 33.8650 [5,] 41.2160 40.2250 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13.90356 15.814 14.74579 12.8753 11.39206 9.297125 11.17909 10.48647 [2,] 26.32044 27.929 28.29921 27.5227 28.97694 30.870875 29.38191 29.05953 [,9] [,10] [,11] [,12] [1,] 10.68555 12.10252 12.38518 11.91558 [2,] 29.84945 30.22148 31.12982 32.71142 $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(14.544, 15.579, 20.112, 25.204, 32.81, 14.931, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5icoz1366619655.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,] 14.5440 15.579 18.0790 20.830 25.2040 32.2420 NA [2,] 14.9425 15.698 18.4620 21.622 26.9795 32.8145 NA [3,] 15.2365 16.054 19.1865 21.990 30.4655 34.7045 NA [4,] 15.9220 16.735 19.6470 23.266 31.7595 39.8655 NA [5,] 17.0640 17.745 20.1480 24.977 33.8650 41.5910 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 14.78974 15.58102 18.64601 21.24016 28.28531 31.48849 NA [2,] 15.68326 16.52698 19.72699 22.73984 32.64569 37.92051 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14.544, 14.9425, 15.2365, 15.922, 17.064, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6063q1366619655.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,] 6.428076 16.8140 7.577750 [2,] 6.774603 17.9120 8.954875 [3,] 8.198282 19.3235 11.213250 [4,] 9.694084 24.5570 12.106125 [5,] 10.319254 26.4540 13.421750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.866687 16.29267 9.775944 [2,] 9.529877 22.35433 12.650556 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.42807608594256, 6.77460288095408, 8.19828168825451, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w42l1366619655.ps tmp/1w42l1366619655.png",intern=TRUE)) character(0) > try(system("convert tmp/2fvuu1366619655.ps tmp/2fvuu1366619655.png",intern=TRUE)) character(0) > try(system("convert tmp/33ung1366619655.ps tmp/33ung1366619655.png",intern=TRUE)) character(0) > try(system("convert tmp/46vbm1366619655.ps tmp/46vbm1366619655.png",intern=TRUE)) character(0) > try(system("convert tmp/5icoz1366619655.ps tmp/5icoz1366619655.png",intern=TRUE)) character(0) > try(system("convert tmp/6063q1366619655.ps tmp/6063q1366619655.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.091 1.119 6.192