R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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(227.81,227.81,227.01,227.26,227.1,227.59,227.59,227.7,227.75,226.33,225.95,226.33,226.33,226.22,224.84,221.88,222.37,221.8,221.8,221.8,221.9,220.2,219.95,220.05,220.05,220.05,220.62,221.53,221.61,221.5,221.5,221.87,222.27,220.86,221.49,221.67,221.67,221.72,221.67,220.29,220.75,219.59,219.59,219.59,219.82,221.59,220.9,221.01,221.01,219.69,221,219.82,218.04,217.97,217.97,217.53,217,217.18,217.68,217.71,217.71,218.5,218.8,218.94,220,219.89,219.89,220.08,220.16,221,222.16,221.5) > 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,] 227.81 226.33 220.05 221.67 221.01 217.71 NA [2,] 227.81 226.22 220.05 221.72 219.69 218.50 NA [3,] 227.01 224.84 220.62 221.67 221.00 218.80 NA [4,] 227.26 221.88 221.53 220.29 219.82 218.94 NA [5,] 227.10 222.37 221.61 220.75 218.04 220.00 NA [6,] 227.59 221.80 221.50 219.59 217.97 219.89 NA [7,] 227.59 221.80 221.50 219.59 217.97 219.89 NA [8,] 227.70 221.80 221.87 219.59 217.53 220.08 NA [9,] 227.75 221.90 222.27 219.82 217.00 220.16 NA [10,] 226.33 220.20 220.86 221.59 217.18 221.00 NA [11,] 225.95 219.95 221.49 220.90 217.68 222.16 NA [12,] 226.33 220.05 221.67 221.01 217.71 221.50 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/1rjq01357257262.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/250qs1357257262.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/3dnt91357257262.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/4hpih1357257262.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] [1,] 217.71 218.500 218.800 218.94 218.04 217.970 217.970 217.53 217.00 220.20 [2,] 220.05 219.690 220.620 219.82 220.00 219.590 219.590 219.59 219.82 220.20 [3,] 221.34 220.885 221.335 220.91 221.18 220.695 220.695 220.94 221.03 220.93 [4,] 226.33 226.220 224.840 221.88 222.37 221.800 221.800 221.87 222.27 221.59 [5,] 227.81 227.810 227.010 221.88 222.37 221.800 221.800 221.87 222.27 221.59 [,11] [,12] [1,] 217.680 217.710 [2,] 219.950 220.050 [3,] 221.195 221.255 [4,] 222.160 221.670 [5,] 222.160 221.670 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 217.2892 216.6729 218.613 219.5812 219.6513 219.2695 219.2695 219.4693 [2,] 225.3908 225.0971 224.057 222.2388 222.7087 222.1205 222.1205 222.4107 [,9] [,10] [,11] [,12] [1,] 219.4497 220.0334 219.7695 220.21 [2,] 222.6103 221.8266 222.6205 222.30 $out [1] 227.26 227.10 227.59 227.59 227.70 227.75 226.33 217.18 225.95 226.33 $group [1] 4 5 6 7 8 9 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(217.71, 220.05, 221.34, 226.33, 227.81, 218.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5fl0a1357257262.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,] 225.950 219.950 220.05 219.590 217.000 217.710 NA [2,] 226.670 221.000 220.74 219.705 217.605 218.870 NA [3,] 227.425 221.840 221.50 220.825 217.970 219.945 NA [4,] 227.725 223.605 221.64 221.630 219.755 220.580 NA [5,] 227.810 226.330 222.27 221.720 221.010 222.160 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 226.9438 220.6518 221.0895 219.947 216.9894 219.1651 NA [2,] 227.9062 223.0282 221.9105 221.703 218.9506 220.7249 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(225.95, 226.67, 227.425, 227.725, 227.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6rhsd1357257262.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,] 2.737406 8.21 1.0775 [2,] 2.964137 8.47 1.8300 [3,] 3.199921 9.23 2.0600 [4,] 3.531295 9.86 2.8025 [5,] 3.865002 10.75 3.3325 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.941236 8.596012 1.616436 [2,] 3.458605 9.863988 2.503564 $out [1] 4.875 5.315 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.73740570613856, 2.96413715851019, 3.19992065175528, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rjq01357257262.ps tmp/1rjq01357257262.png",intern=TRUE)) character(0) > try(system("convert tmp/250qs1357257262.ps tmp/250qs1357257262.png",intern=TRUE)) character(0) > try(system("convert tmp/3dnt91357257262.ps tmp/3dnt91357257262.png",intern=TRUE)) character(0) > try(system("convert tmp/4hpih1357257262.ps tmp/4hpih1357257262.png",intern=TRUE)) character(0) > try(system("convert tmp/5fl0a1357257262.ps tmp/5fl0a1357257262.png",intern=TRUE)) character(0) > try(system("convert tmp/6rhsd1357257262.ps tmp/6rhsd1357257262.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.036 0.807 3.835