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.05,1.07,1.07,1.06,1.08,1.11,1.09,1.1,1.11,1.12,1.13,1.13,1.13,1.18,1.21,1.22,1.22,1.24,1.24,1.25,1.25,1.26,1.26,1.26,1.26,1.3,1.32,1.34,1.35,1.35,1.34,1.33,1.32,1.32,1.33,1.31,1.33,1.34,1.34,1.33,1.3,1.28,1.27,1.28,1.27,1.29,1.28,1.29,1.28,1.28,1.28,1.25,1.24,1.24,1.25,1.25,1.26,1.26,1.26,1.28) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.05 1.13 1.26 1.33 1.28 NA [2,] 1.07 1.18 1.30 1.34 1.28 NA [3,] 1.07 1.21 1.32 1.34 1.28 NA [4,] 1.06 1.22 1.34 1.33 1.25 NA [5,] 1.08 1.22 1.35 1.30 1.24 NA [6,] 1.11 1.24 1.35 1.28 1.24 NA [7,] 1.09 1.24 1.34 1.27 1.25 NA [8,] 1.10 1.25 1.33 1.28 1.25 NA [9,] 1.11 1.25 1.32 1.27 1.26 NA [10,] 1.12 1.26 1.32 1.29 1.26 NA [11,] 1.13 1.26 1.33 1.28 1.26 NA [12,] 1.13 1.26 1.31 1.29 1.28 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/1352z1335730432.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/2bdr71335730432.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/3vz121335730432.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/488w51335730432.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,] 1.05 1.07 1.07 1.06 1.22 1.24 1.24 1.25 1.25 1.26 1.26 1.26 [2,] 1.13 1.18 1.21 1.22 1.22 1.24 1.24 1.25 1.25 1.26 1.26 1.26 [3,] 1.26 1.28 1.28 1.25 1.24 1.24 1.25 1.25 1.26 1.26 1.26 1.28 [4,] 1.28 1.30 1.32 1.33 1.30 1.28 1.27 1.28 1.27 1.29 1.28 1.29 [5,] 1.33 1.34 1.34 1.34 1.35 1.28 1.27 1.28 1.27 1.32 1.28 1.31 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.15401 1.195208 1.202274 1.172274 1.183472 1.211736 1.228802 1.228802 [2,] 1.36599 1.364792 1.357726 1.327726 1.296528 1.268264 1.271198 1.271198 [,9] [,10] [,11] [,12] [1,] 1.245868 1.238802 1.245868 1.258802 [2,] 1.274132 1.281198 1.274132 1.301198 $out [1] 1.08 1.11 1.35 1.09 1.34 1.10 1.33 1.11 1.32 1.12 1.13 1.33 1.13 $group [1] 5 6 6 7 7 8 8 9 9 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.05, 1.13, 1.26, 1.28, 1.33, 1.07, 1.18, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z3nb1335730432.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] [1,] 1.050 1.180 1.300 1.27 1.24 NA [2,] 1.070 1.215 1.315 1.28 1.25 NA [3,] 1.095 1.240 1.325 1.29 1.26 NA [4,] 1.115 1.255 1.340 1.33 1.28 NA [5,] 1.130 1.260 1.350 1.34 1.28 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.074475 1.221756 1.313597 1.267195 1.246317 NA [2,] 1.115525 1.258244 1.336403 1.312805 1.273683 NA $out [1] 1.13 1.26 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(1.05, 1.07, 1.095, 1.115, 1.13, 1.18, 1.215, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69rlb1335730432.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.07162402 0.180 0.020 [2,] 0.07768040 0.205 0.030 [3,] 0.08941879 0.245 0.035 [4,] 0.10910998 0.270 0.110 [5,] 0.11597414 0.280 0.150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.07508355 0.2153531 -0.001488537 [2,] 0.10375403 0.2746469 0.071488537 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.07162401831788, 0.077680402512654, 0.0894187876497756, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1352z1335730432.ps tmp/1352z1335730432.png",intern=TRUE)) character(0) > try(system("convert tmp/2bdr71335730432.ps tmp/2bdr71335730432.png",intern=TRUE)) character(0) > try(system("convert tmp/3vz121335730432.ps tmp/3vz121335730432.png",intern=TRUE)) character(0) > try(system("convert tmp/488w51335730432.ps tmp/488w51335730432.png",intern=TRUE)) character(0) > try(system("convert tmp/5z3nb1335730432.ps tmp/5z3nb1335730432.png",intern=TRUE)) character(0) > try(system("convert tmp/69rlb1335730432.ps tmp/69rlb1335730432.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.631 0.540 2.176