R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(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,41.126,42.362,40.740,40.256,39.804,41.002,41.702,42.254,43.605,43.271,43.221,41.373,40.435,39.217,39.457,36.710,34.977,32.729,31.584,32.510,32.565,30.988,30.383,28.673) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.579 19.394 20.830 25.204 32.810 41.126 40.435 NA [2,] 16.348 20.148 23.595 25.739 32.242 42.362 39.217 NA [3,] 15.928 20.108 22.937 26.434 32.700 40.740 39.457 NA [4,] 16.171 18.584 21.814 27.525 32.819 40.256 36.710 NA [5,] 15.937 18.441 21.928 30.695 33.947 39.804 34.977 NA [6,] 15.713 18.391 21.777 32.436 34.148 41.002 32.729 NA [7,] 15.594 19.178 21.383 30.160 35.261 41.702 31.584 NA [8,] 15.683 18.079 21.467 30.236 39.506 42.254 32.510 NA [9,] 16.438 18.483 22.052 31.293 41.591 43.605 32.565 NA [10,] 17.032 19.644 22.680 31.077 39.148 43.271 30.988 NA [11,] 17.696 19.195 24.320 32.226 41.216 43.221 30.383 NA [12,] 17.745 19.650 24.977 33.865 40.225 41.373 28.673 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/1x49i1416755221.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/2yz0f1416755221.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/3kzsk1416755221.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/4jc231416755221.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] [1,] 15.5790 16.3480 15.9280 16.1710 15.9370 15.7130 15.5940 15.683 16.4380 [2,] 20.1120 21.8715 21.5225 20.1990 20.1845 20.0840 20.2805 19.773 20.2675 [3,] 25.2040 25.7390 26.4340 27.5250 30.6950 32.4360 30.1600 30.236 31.2930 [4,] 36.6225 35.7295 36.0785 34.7645 34.4620 33.4385 33.4225 36.008 37.0780 [5,] 41.1260 42.3620 40.7400 40.2560 39.8040 41.0020 41.7020 42.254 43.6050 [,10] [,11] [,12] [1,] 17.0320 17.6960 17.7450 [2,] 21.1620 21.7575 22.3135 [3,] 30.9880 30.3830 28.6730 [4,] 35.1125 36.7210 37.0450 [5,] 43.2710 43.2210 41.3730 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.3442 17.46323 17.74139 18.82672 22.16871 24.46091 22.31181 20.54072 [2,] 35.0638 34.01477 35.12661 36.22328 39.22129 40.41109 38.00819 39.93128 [,9] [,10] [,11] [,12] [1,] 21.25404 22.65699 21.44704 19.87559 [2,] 41.33196 39.31901 39.31896 37.47041 $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(15.579, 20.112, 25.204, 36.6225, 41.126, 16.348, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5awjw1416755221.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] [1,] 15.579 18.0790 20.830 25.2040 32.2420 39.8040 28.6730 NA [2,] 15.698 18.4620 21.622 26.9795 32.8145 40.8710 31.2860 NA [3,] 16.054 19.1865 21.990 30.4655 34.7045 41.5375 32.6470 NA [4,] 16.735 19.6470 23.266 31.7595 39.8655 42.7915 37.9635 NA [5,] 17.745 20.1480 24.977 33.8650 41.5910 43.6050 40.4350 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.58102 18.64601 21.24016 28.28531 31.48849 40.66155 29.60135 NA [2,] 16.52698 19.72699 22.73984 32.64569 37.92051 42.41345 35.69265 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(15.579, 15.698, 16.054, 16.735, 17.745, 18.079, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6i1091416755221.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.168714 23.6280 13.14200 [2,] 9.408798 24.4485 13.90425 [3,] 9.665408 25.5360 14.56075 [4,] 10.177705 26.1735 15.59925 [5,] 10.841150 27.1670 16.81050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.314705 24.74922 13.78765 [2,] 10.016112 26.32278 15.33385 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(9.16871420855156, 9.40879834486327, 9.66540829649268, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1x49i1416755221.ps tmp/1x49i1416755221.png",intern=TRUE)) character(0) > try(system("convert tmp/2yz0f1416755221.ps tmp/2yz0f1416755221.png",intern=TRUE)) character(0) > try(system("convert tmp/3kzsk1416755221.ps tmp/3kzsk1416755221.png",intern=TRUE)) character(0) > try(system("convert tmp/4jc231416755221.ps tmp/4jc231416755221.png",intern=TRUE)) character(0) > try(system("convert tmp/5awjw1416755221.ps tmp/5awjw1416755221.png",intern=TRUE)) character(0) > try(system("convert tmp/6i1091416755221.ps tmp/6i1091416755221.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.119 0.326 2.475