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(155.28,173.24,180.16,181.52,182.25,182.19,182,181.65,180.07,182.62,180.38,181.15,180.5,181.14,180.93,211.91,223.81,226.88,226.8,231.81,232.06,232.32,228.37,226.31,225.72,219.98,219.31,215.19,213.81,213.7,213.6,213.52,218.39,219.97,221.09,219.17,219.17,218.45,216.88,216.19,214.59,269.87,272.71,280.35,274.5,268.86,261.7,263.98,263.01,262.79,263.59,267,267.89,267.86,266.84,268.24,267.67,269.07,270.87,271.68,271.63,275.21,276.66,276.08,278.3,279.06,279.28,279.12,262.72,262.55,260.7,259.14) > 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,] 155.28 180.50 225.72 219.17 263.01 271.63 NA [2,] 173.24 181.14 219.98 218.45 262.79 275.21 NA [3,] 180.16 180.93 219.31 216.88 263.59 276.66 NA [4,] 181.52 211.91 215.19 216.19 267.00 276.08 NA [5,] 182.25 223.81 213.81 214.59 267.89 278.30 NA [6,] 182.19 226.88 213.70 269.87 267.86 279.06 NA [7,] 182.00 226.80 213.60 272.71 266.84 279.28 NA [8,] 181.65 231.81 213.52 280.35 268.24 279.12 NA [9,] 180.07 232.06 218.39 274.50 267.67 262.72 NA [10,] 182.62 232.32 219.97 268.86 269.07 262.55 NA [11,] 180.38 228.37 221.09 261.70 270.87 260.70 NA [12,] 181.15 226.31 219.17 263.98 271.68 259.14 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/17f101354463220.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/2ui1f1354463220.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/3m11w1354463220.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/49my11354463220.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,] 155.280 173.240 180.160 181.52 182.25 182.19 182.00 181.650 180.07 182.620 [2,] 180.500 181.140 180.930 211.91 213.81 213.70 213.60 213.520 218.39 219.970 [3,] 222.445 219.215 218.095 215.69 219.20 247.37 246.82 250.025 247.39 247.435 [4,] 263.010 262.790 263.590 267.00 267.89 269.87 272.71 279.120 267.67 268.860 [5,] 271.630 275.210 276.660 276.08 278.30 279.06 279.28 280.350 274.50 269.070 [,11] [,12] [1,] 180.380 181.150 [2,] 221.090 219.170 [3,] 244.535 242.725 [4,] 261.700 263.980 [5,] 270.870 271.680 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 169.2234 166.5481 164.7766 180.1552 184.3167 211.1385 208.6921 207.7109 [2,] 275.6666 271.8819 271.4134 251.2248 254.0833 283.6015 284.9479 292.3391 [,9] [,10] [,11] [,12] [1,] 215.6028 215.8994 218.3402 213.8211 [2,] 279.1772 278.9706 270.7298 271.6289 $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(155.28, 180.5, 222.445, 263.01, 271.63, 173.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5gs0l1354463220.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,] 180.070 180.500 213.520 214.590 262.790 259.140 NA [2,] 180.115 196.525 213.755 217.665 265.215 262.635 NA [3,] 181.335 226.555 218.780 262.840 267.765 275.645 NA [4,] 182.095 230.090 219.975 271.290 268.655 278.680 NA [5,] 182.620 232.320 225.720 280.350 271.680 279.280 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 180.4319 211.2458 215.943 238.3813 266.196 268.3268 NA [2,] 182.2381 241.8642 221.617 287.2987 269.334 282.9632 NA $out [1] 155.28 173.24 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(180.07, 180.115, 181.335, 182.095, 182.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6klrh1354463220.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,] 34.21164 86.450 38.54000 [2,] 35.38488 92.480 42.34000 [3,] 37.38763 96.275 48.49875 [4,] 40.34355 97.990 59.96375 [5,] 45.37441 101.970 63.52000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 35.12595 93.76185 40.46044 [2,] 39.64932 98.78815 56.53706 $out [1] 116.35 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(34.2116382244405, 35.3848775095821, 37.3876322644229, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17f101354463220.ps tmp/17f101354463220.png",intern=TRUE)) character(0) > try(system("convert tmp/2ui1f1354463220.ps tmp/2ui1f1354463220.png",intern=TRUE)) character(0) > try(system("convert tmp/3m11w1354463220.ps tmp/3m11w1354463220.png",intern=TRUE)) character(0) > try(system("convert tmp/49my11354463220.ps tmp/49my11354463220.png",intern=TRUE)) character(0) > try(system("convert tmp/5gs0l1354463220.ps tmp/5gs0l1354463220.png",intern=TRUE)) character(0) > try(system("convert tmp/6klrh1354463220.ps tmp/6klrh1354463220.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.114 0.809 3.911