R version 3.0.1 (2013-05-16) -- "Good Sport" 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(69731,68504,67277,64823,89654,88427,69731,57316,58542,58542,59770,62357,54862,47354,41207,41207,64823,67277,48581,27431,38620,38620,47354,52396,51168,38620,44900,42434,63584,58542,38620,23738,37392,41207,44900,49808,39846,31246,34939,36166,68504,68504,49808,47354,54862,51168,61130,73546,76012,58542,53622,48581,82280,84746,78466,84746,83507,73546,84746,97162,102203,87200,77238,84746,117084,127046,124592,129499,128273,115858,137008,142049,149423,127046,118312,128273,152010,173160,168119,168119,170585,161971,184361,184361,180546,159384,163199,165665,181895,203045,188041,195550,189269,185587,214246,207965,199230,186815,199230,205511,213006,222967,213006,219154,211657,210431,241542,244129,234168,216700,231581,237850,245357,256546,245357,254092,250277,236622,265279,265279) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 69731 54862 51168 39846 76012 102203 149423 180546 199230 234168 NA [2,] 68504 47354 38620 31246 58542 87200 127046 159384 186815 216700 NA [3,] 67277 41207 44900 34939 53622 77238 118312 163199 199230 231581 NA [4,] 64823 41207 42434 36166 48581 84746 128273 165665 205511 237850 NA [5,] 89654 64823 63584 68504 82280 117084 152010 181895 213006 245357 NA [6,] 88427 67277 58542 68504 84746 127046 173160 203045 222967 256546 NA [7,] 69731 48581 38620 49808 78466 124592 168119 188041 213006 245357 NA [8,] 57316 27431 23738 47354 84746 129499 168119 195550 219154 254092 NA [9,] 58542 38620 37392 54862 83507 128273 170585 189269 211657 250277 NA [10,] 58542 38620 41207 51168 73546 115858 161971 185587 210431 236622 NA [11,] 59770 47354 44900 61130 84746 137008 184361 214246 241542 265279 NA [12,] 62357 52396 49808 73546 97162 142049 184361 207965 244129 265279 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/1pnar1375360981.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/2v6xn1375360981.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/3ygqa1375360981.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/4t5jo1375360981.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] [1,] 39846.0 31246 34939.0 36166.0 63584 58542.0 38620 23738.0 37392 [2,] 54862.0 47354 44900.0 42434.0 68504 68504.0 49808 47354.0 54862 [3,] 89107.5 77852 72257.5 74784.5 103369 107736.5 101529 107122.5 105890 [4,] 180546.0 159384 163199.0 165665.0 181895 203045.0 188041 195550.0 189269 [5,] 234168.0 216700 231581.0 237850.0 245357 256546.0 245357 254092.0 250277 [,10] [,11] [,12] [1,] 38620 44900 49808.0 [2,] 51168 59770 62357.0 [3,] 94702 110877 119605.5 [4,] 185587 214246 207965.0 [5,] 236622 265279 265279.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 26310.76 21877.35 13150.6 13213.38 46714.34 40514.45 32462.28 [2,] 151904.24 133826.65 131364.4 136355.62 160023.66 174958.55 170595.72 [,8] [,9] [,10] [,11] [,12] [1,] 33077.87 38734.9 27540.91 33694.63 46853.94 [2,] 181167.13 173045.1 161863.09 188059.37 192357.06 $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(39846, 54862, 89107.5, 180546, 234168, 31246, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5yrhg1375360981.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] [,9] [,10] [1,] 57316 27431.0 23738 31246 48581 77238.0 118312.0 159384.0 186815.0 216700 [2,] 59156 39913.5 38620 38006 66044 94701.5 138848.0 173105.5 202370.5 235395 [3,] 66050 47354.0 43667 50488 80373 120838.0 165045.0 186814.0 212331.5 245357 [4,] 69731 53629.0 50488 64817 84746 128886.0 171872.5 199297.5 221060.5 255319 [5,] 69731 67277.0 63584 73546 97162 142049.0 184361.0 214246.0 244129.0 265279 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 61226.67 41098.27 38253.93 38259.32 71842.89 105246.2 149982.3 174867.7 [2,] 70873.33 53609.73 49080.07 62716.68 88903.11 136429.8 180107.7 198760.3 [,9] [,10] [,11] [1,] 203806.9 236269.5 NA [2,] 220856.1 254444.5 NA $out [1] 89654 88427 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(57316, 59156, 66050, 69731, 69731, 27431, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ct8x1375360981.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,] 66255.95 181773 101148.5 [2,] 70588.22 195482 108621.5 [3,] 74977.19 199844 124840.4 [4,] 80501.99 214178 132862.9 [5,] 85943.50 230354 146664.8 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 70455.45 191316.6 113783.7 [2,] 79498.93 208371.4 135897.0 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(66255.9504387677, 70588.2177427447, 74977.190451102, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pnar1375360981.ps tmp/1pnar1375360981.png",intern=TRUE)) character(0) > try(system("convert tmp/2v6xn1375360981.ps tmp/2v6xn1375360981.png",intern=TRUE)) character(0) > try(system("convert tmp/3ygqa1375360981.ps tmp/3ygqa1375360981.png",intern=TRUE)) character(0) > try(system("convert tmp/4t5jo1375360981.ps tmp/4t5jo1375360981.png",intern=TRUE)) character(0) > try(system("convert tmp/5yrhg1375360981.ps tmp/5yrhg1375360981.png",intern=TRUE)) character(0) > try(system("convert tmp/6ct8x1375360981.ps tmp/6ct8x1375360981.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.381 0.613 3.979