R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(1.974,2.037,2.259,2.550,2.549,2.738,2.228,2.533,2.475,2.260,2.158,2.253,2.670,2.449,2.620,2.205,2.589,2.706,2.352,2.478,2.316,2.295,2.110,1.944,2.202,2.036,2.434,2.297,2.354,2.650,2.555,2.477,2.268,2.510,2.015,1.994,2.271,2.289,2.333,2.795,2.332,2.799,2.294,2.415,2.473,2.236,1.970,2.318,2.108,2.064,2.519,2.298,2.187,2.746,2.364,2.512,2.224,2.209,2.186,2.303,2.381,2.432,2.913,2.392,2.532,2.709,2.387,2.609,2.399,2.184,1.839,2.056,2.151,2.155,2.463,2.155,2.679,2.367,2.052,2.547,2.466) > 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] 81 > (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] 7 7 7 7 7 7 7 7 7 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.974 2.670 2.202 2.271 2.108 2.381 2.151 [2,] 2.037 2.449 2.036 2.289 2.064 2.432 2.155 [3,] 2.259 2.620 2.434 2.333 2.519 2.913 2.463 [4,] 2.550 2.205 2.297 2.795 2.298 2.392 2.155 [5,] 2.549 2.589 2.354 2.332 2.187 2.532 2.679 [6,] 2.738 2.706 2.650 2.799 2.746 2.709 2.367 [7,] 2.228 2.352 2.555 2.294 2.364 2.387 2.052 [8,] 2.533 2.478 2.477 2.415 2.512 2.609 2.547 [9,] 2.475 2.316 2.268 2.473 2.224 2.399 2.466 [10,] 2.260 2.295 2.510 2.236 2.209 2.184 NA [11,] 2.158 2.110 2.015 1.970 2.186 1.839 NA [12,] 2.253 1.944 1.994 2.318 2.303 2.056 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/1n29e1336336835.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/295cy1336336835.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/328m81336336835.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/4za4d1336336835.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,] 1.9740 2.0360 2.2590 2.155 2.187 2.650 2.2280 2.4150 2.2240 2.184 1.8390 [2,] 2.1295 2.0505 2.3835 2.251 2.343 2.678 2.2610 2.4775 2.2920 2.209 1.9700 [3,] 2.2020 2.1550 2.4630 2.298 2.532 2.709 2.3520 2.5120 2.3990 2.248 2.0625 [4,] 2.3260 2.3605 2.5695 2.471 2.569 2.742 2.3755 2.5400 2.4695 2.295 2.1580 [5,] 2.3810 2.4490 2.6200 2.795 2.679 2.799 2.3870 2.6090 2.4750 2.295 2.1860 [,12] [1,] 1.9440 [2,] 1.9940 [3,] 2.1545 [4,] 2.3030 [5,] 2.3180 $n [1] 7 7 7 7 7 7 7 7 7 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.084653 1.969873 2.351924 2.16662 2.397036 2.67078 2.283622 2.474676 [2,] 2.319347 2.340127 2.574076 2.42938 2.666964 2.74722 2.420378 2.549324 [,9] [,10] [,11] [,12] [1,] 2.293 2.192527 1.941234 1.955185 [2,] 2.505 2.303473 2.183766 2.353815 $out [1] 2.670 2.913 2.367 2.555 2.052 2.510 $group [1] 1 3 6 7 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.974, 2.1295, 2.202, 2.326, 2.381, 2.036, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5joes1336336835.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,] 1.9740 1.9440 1.9940 2.236 2.0640 2.0560 2.052 [2,] 2.1930 2.2500 2.1190 2.280 2.1865 2.2825 2.155 [3,] 2.2595 2.4005 2.3255 2.325 2.2610 2.3955 2.367 [4,] 2.5410 2.6045 2.4935 2.444 2.4380 2.5705 2.466 [5,] 2.7380 2.7060 2.6500 2.473 2.7460 2.9130 2.679 $n [1] 12 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.100775 2.23881 2.154688 2.250198 2.146289 2.264141 2.203207 [2,] 2.418225 2.56219 2.496312 2.399802 2.375711 2.526859 2.530793 $out [1] 2.795 2.799 1.970 1.839 $group [1] 4 4 4 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.974, 2.193, 2.2595, 2.541, 2.738, 1.944, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6do8d1336336835.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,] 0.06169935 0.1940 0.06250 [2,] 0.12453544 0.3365 0.09250 [3,] 0.16032945 0.4225 0.18175 [4,] 0.19803231 0.5715 0.22300 [5,] 0.22451429 0.6960 0.31000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1268070 0.3153149 0.1222281 [2,] 0.1938519 0.5296851 0.2412719 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0616993478394182, 0.124535437478628, 0.160329454160941, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1n29e1336336835.ps tmp/1n29e1336336835.png",intern=TRUE)) character(0) > try(system("convert tmp/295cy1336336835.ps tmp/295cy1336336835.png",intern=TRUE)) character(0) > try(system("convert tmp/328m81336336835.ps tmp/328m81336336835.png",intern=TRUE)) character(0) > try(system("convert tmp/4za4d1336336835.ps tmp/4za4d1336336835.png",intern=TRUE)) character(0) > try(system("convert tmp/5joes1336336835.ps tmp/5joes1336336835.png",intern=TRUE)) character(0) > try(system("convert tmp/6do8d1336336835.ps tmp/6do8d1336336835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.485 0.434 1.928