R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(25,24,25,27,24,26,24,24,21,23,24,23,22,25,26,22,24,22,23,25,24,24,21,22,21,21,20,20,22,21,23,22,24,21,22,20,23,21,21,21,22,24,21,23,25,23,24,25,28,26,25,24,25,26,24,21,22,25,27,26,24,27,23,23,23,25,26,22,23,27,25,24,21,24,22,26,22,25,20,21,23,24,24,18) > 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,] 25 22 21 23 28 24 21 NA [2,] 24 25 21 21 26 27 24 NA [3,] 25 26 20 21 25 23 22 NA [4,] 27 22 20 21 24 23 26 NA [5,] 24 24 22 22 25 23 22 NA [6,] 26 22 21 24 26 25 25 NA [7,] 24 23 23 21 24 26 20 NA [8,] 24 25 22 23 21 22 21 NA [9,] 21 24 24 25 22 23 23 NA [10,] 23 24 21 23 25 27 24 NA [11,] 24 21 22 24 27 25 24 NA [12,] 23 22 20 25 26 24 18 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/fisher/rcomp/tmp/10b4d1385575642.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/fisher/rcomp/tmp/2gl7w1385575642.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/fisher/rcomp/tmp/32bj91385575642.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/fisher/rcomp/tmp/43bjk1385575642.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,] 21.0 21.0 20.0 20.0 22 21.0 20 21.0 21.0 21.0 21.0 18.0 [2,] 21.5 22.5 21.5 21.5 22 23.0 22 21.5 22.5 23.0 23.0 21.0 [3,] 23.0 24.0 23.0 23.0 23 25.0 23 22.0 23.0 24.0 24.0 23.0 [4,] 24.5 25.5 25.0 25.0 24 25.5 24 23.5 24.0 24.5 24.5 24.5 [5,] 28.0 27.0 26.0 27.0 25 26.0 26 25.0 25.0 25.0 25.0 26.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 21.20845 22.20845 20.90986 20.90986 21.80563 23.50704 21.80563 20.80563 [2,] 24.79155 25.79155 25.09014 25.09014 24.19437 26.49296 24.19437 23.19437 [,9] [,10] [,11] [,12] [1,] 22.10422 23.10422 23.10422 20.90986 [2,] 23.89578 24.89578 24.89578 25.09014 $out [1] 27 27 $group [1] 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(21, 21.5, 23, 24.5, 28, 21, 22.5, 24, 25.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5zfdj1385575642.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,] 23.0 21.0 20.0 21 21 22.0 18.0 NA [2,] 23.5 22.0 20.5 21 24 23.0 21.0 NA [3,] 24.0 23.5 21.0 23 25 24.0 22.5 NA [4,] 25.0 24.5 22.0 24 26 25.5 24.0 NA [5,] 27.0 26.0 24.0 25 28 27.0 26.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 23.31584 22.35973 20.31584 21.63168 24.08779 22.85973 21.13168 NA [2,] 24.68416 24.64027 21.68416 24.36832 25.91221 25.14027 23.86832 NA $out [1] 21 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(23, 23.5, 24, 25, 27, 21, 22, 23.5, 24.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6nt4b1385575642.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,] 1.214986 3.0 1.50 [2,] 1.688156 4.5 1.75 [3,] 1.975900 6.0 2.25 [4,] 2.408267 6.5 3.25 [5,] 2.819997 8.0 3.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.647453 5.087787 1.56584 [2,] 2.304347 6.912213 2.93416 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.21498579258791, 1.68815618175426, 1.97590007294853, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10b4d1385575642.ps tmp/10b4d1385575642.png",intern=TRUE)) character(0) > try(system("convert tmp/2gl7w1385575642.ps tmp/2gl7w1385575642.png",intern=TRUE)) character(0) > try(system("convert tmp/32bj91385575642.ps tmp/32bj91385575642.png",intern=TRUE)) character(0) > try(system("convert tmp/43bjk1385575642.ps tmp/43bjk1385575642.png",intern=TRUE)) character(0) > try(system("convert tmp/5zfdj1385575642.ps tmp/5zfdj1385575642.png",intern=TRUE)) character(0) > try(system("convert tmp/6nt4b1385575642.ps tmp/6nt4b1385575642.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.690 1.241 5.888