R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(9.11,9.06,9.11,9.13,9.13,9.19,9.2,9.23,9.24,9.28,9.32,9.32,9.32,9.36,9.37,9.38,9.41,9.44,9.44,9.44,9.47,9.48,9.56,9.58,9.56,9.58,9.7,9.74,9.76,9.78,9.84,9.88,9.96,9.97,9.96,9.96,9.96,10.02,10.08,10.09,10.12,10.14,10.17,10.22,10.25,10.25,10.26,10.34,10.33,10.3,10.33,10.33,10.37,10.44,10.45,10.45,10.44,10.43,10.4,10.43,10.47,10.52,10.55,10.5,10.44,10.47,10.5,10.54,10.55,10.53,10.54,10.54) > 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,] 9.11 9.32 9.56 9.96 10.33 10.47 NA [2,] 9.06 9.36 9.58 10.02 10.30 10.52 NA [3,] 9.11 9.37 9.70 10.08 10.33 10.55 NA [4,] 9.13 9.38 9.74 10.09 10.33 10.50 NA [5,] 9.13 9.41 9.76 10.12 10.37 10.44 NA [6,] 9.19 9.44 9.78 10.14 10.44 10.47 NA [7,] 9.20 9.44 9.84 10.17 10.45 10.50 NA [8,] 9.23 9.44 9.88 10.22 10.45 10.54 NA [9,] 9.24 9.47 9.96 10.25 10.44 10.55 NA [10,] 9.28 9.48 9.97 10.25 10.43 10.53 NA [11,] 9.32 9.56 9.96 10.26 10.40 10.54 NA [12,] 9.32 9.58 9.96 10.34 10.43 10.54 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/10p381367005772.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/285tb1367005772.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/3zuir1367005772.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/49qrh1367005772.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,] 9.11 9.06 9.11 9.130 9.13 9.19 9.200 9.23 9.240 9.28 9.32 9.32 [2,] 9.32 9.36 9.37 9.380 9.41 9.44 9.440 9.44 9.470 9.48 9.56 9.58 [3,] 9.76 9.80 9.89 9.915 9.94 9.96 10.005 10.05 10.105 10.11 10.11 10.15 [4,] 10.33 10.30 10.33 10.330 10.37 10.44 10.450 10.45 10.440 10.43 10.40 10.43 [5,] 10.47 10.52 10.55 10.500 10.44 10.47 10.500 10.54 10.550 10.53 10.54 10.54 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.108517 9.19367 9.270769 9.302219 9.320769 9.314968 9.353517 [2,] 10.411483 10.40633 10.509231 10.527781 10.559231 10.605032 10.656483 [,8] [,9] [,10] [,11] [,12] [1,] 9.398517 9.479319 9.497219 9.568173 9.601723 [2,] 10.701483 10.730681 10.722781 10.651827 10.698277 $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(9.11, 9.32, 9.76, 10.33, 10.47, 9.06, 9.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/51ego1367005772.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,] 9.060 9.320 9.56 9.960 10.300 10.440 NA [2,] 9.120 9.375 9.72 10.085 10.330 10.485 NA [3,] 9.195 9.440 9.81 10.155 10.415 10.525 NA [4,] 9.260 9.475 9.96 10.250 10.440 10.540 NA [5,] 9.320 9.580 9.97 10.340 10.450 10.550 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.131145 9.394389 9.700534 10.07974 10.36483 10.49991 NA [2,] 9.258855 9.485611 9.919466 10.23026 10.46517 10.55009 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(9.06, 9.12, 9.195, 9.26, 9.32, 9.32, 9.375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ca961367005772.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.4955166 1.220 0.73250 [2,] 0.5215666 1.265 0.79125 [3,] 0.5339718 1.310 0.81250 [4,] 0.5458832 1.365 0.84000 [5,] 0.5667686 1.460 0.85750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5228809 1.264389 0.7902648 [2,] 0.5450628 1.355611 0.8347352 $out [1] 0.4850842 0.7050000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.495516565481585, 0.521566595437708, 0.533971836389424, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10p381367005772.ps tmp/10p381367005772.png",intern=TRUE)) character(0) > try(system("convert tmp/285tb1367005772.ps tmp/285tb1367005772.png",intern=TRUE)) character(0) > try(system("convert tmp/3zuir1367005772.ps tmp/3zuir1367005772.png",intern=TRUE)) character(0) > try(system("convert tmp/49qrh1367005772.ps tmp/49qrh1367005772.png",intern=TRUE)) character(0) > try(system("convert tmp/51ego1367005772.ps tmp/51ego1367005772.png",intern=TRUE)) character(0) > try(system("convert tmp/6ca961367005772.ps tmp/6ca961367005772.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.879 0.507 3.379