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(1.11,1.11,1.2,1.21,1.31,1.37,1.37,1.26,1.23,1.17,1.06,0.95,0.92,0.92,0.9,0.93,0.93,0.97,0.96,0.99,0.98,0.96,1,0.99,1.03,1.02,1.07,1.13,1.15,1.16,1.14,1.15,1.15,1.16,1.17,1.22,1.26,1.29,1.36,1.38,1.37,1.37,1.37,1.36,1.38,1.4,1.44,1.42,1.45,1.45,1.49,1.48,1.44,1.39,1.41,1.48,1.51,1.49,1.46,1.43,1.42,1.43,1.42,1.39,1.36,1.36,1.39,1.39,1.43,1.38,1.36,1.38) > 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,] 1.11 0.92 1.03 1.26 1.45 1.42 NA [2,] 1.11 0.92 1.02 1.29 1.45 1.43 NA [3,] 1.20 0.90 1.07 1.36 1.49 1.42 NA [4,] 1.21 0.93 1.13 1.38 1.48 1.39 NA [5,] 1.31 0.93 1.15 1.37 1.44 1.36 NA [6,] 1.37 0.97 1.16 1.37 1.39 1.36 NA [7,] 1.37 0.96 1.14 1.37 1.41 1.39 NA [8,] 1.26 0.99 1.15 1.36 1.48 1.39 NA [9,] 1.23 0.98 1.15 1.38 1.51 1.43 NA [10,] 1.17 0.96 1.16 1.40 1.49 1.38 NA [11,] 1.06 1.00 1.17 1.44 1.46 1.36 NA [12,] 0.95 0.99 1.22 1.42 1.43 1.38 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/1vmqd1416735409.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/207zy1416735409.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/3oyo31416735409.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/4kyk51416735409.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] [,12] [1,] 0.920 0.92 0.90 0.930 0.930 0.970 0.96 0.99 0.980 0.960 1.000 0.95 [2,] 1.030 1.02 1.07 1.130 1.150 1.160 1.14 1.15 1.150 1.160 1.060 0.99 [3,] 1.185 1.20 1.28 1.295 1.335 1.365 1.37 1.31 1.305 1.275 1.265 1.30 [4,] 1.420 1.43 1.42 1.390 1.370 1.370 1.39 1.39 1.430 1.400 1.440 1.42 [5,] 1.450 1.45 1.49 1.480 1.440 1.390 1.41 1.48 1.510 1.490 1.460 1.43 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.9334374 0.9355368 1.054239 1.127292 1.193093 1.229543 1.208742 1.155192 [2,] 1.4365626 1.4644632 1.505761 1.462708 1.476907 1.500457 1.531258 1.464808 [,9] [,10] [,11] [,12] [1,] 1.124391 1.120192 1.019888 1.022636 [2,] 1.485609 1.429808 1.510112 1.577364 $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(0.92, 1.03, 1.185, 1.42, 1.45, 0.92, 1.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lfud1416735409.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,] 0.950 0.900 1.02 1.36 1.390 1.36 NA [2,] 1.110 0.925 1.10 1.36 1.435 1.37 NA [3,] 1.205 0.960 1.15 1.37 1.455 1.39 NA [4,] 1.285 0.985 1.16 1.39 1.485 1.42 NA [5,] 1.370 1.000 1.22 1.42 1.510 1.43 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.125181 0.9326336 1.122634 1.356317 1.432195 1.367195 NA [2,] 1.284819 0.9873664 1.177366 1.383683 1.477805 1.412805 NA $out [1] 1.26 1.29 1.44 $group [1] 4 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.95, 1.11, 1.205, 1.285, 1.37, 0.9, 0.925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6avd91416735409.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.1700588 0.42 0.16000 [2,] 0.1856999 0.47 0.19625 [3,] 0.1980606 0.52 0.24250 [4,] 0.2155352 0.53 0.33125 [5,] 0.2260088 0.59 0.36250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1844525 0.4926336 0.1809256 [2,] 0.2116687 0.5473664 0.3040744 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.170058813355851, 0.185699904723904, 0.198060599489057, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vmqd1416735409.ps tmp/1vmqd1416735409.png",intern=TRUE)) character(0) > try(system("convert tmp/207zy1416735409.ps tmp/207zy1416735409.png",intern=TRUE)) character(0) > try(system("convert tmp/3oyo31416735409.ps tmp/3oyo31416735409.png",intern=TRUE)) character(0) > try(system("convert tmp/4kyk51416735409.ps tmp/4kyk51416735409.png",intern=TRUE)) character(0) > try(system("convert tmp/5lfud1416735409.ps tmp/5lfud1416735409.png",intern=TRUE)) character(0) > try(system("convert tmp/6avd91416735409.ps tmp/6avd91416735409.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.102 0.355 2.483