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(41086,39690,43129,37863,35953,29133,24693,22205,21725,27192,21790,13253,37702,30364,32609,30212,29965,28352,25814,22414,20506,28806,22228,13971,36845,35338,35022,34777,26887,23970,22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698) > par1 = '48' > par1 <- '48' > #'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] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 41086 28029 [2,] 39690 29383 [3,] 43129 36438 [4,] 37863 32034 [5,] 35953 22679 [6,] 29133 24319 [7,] 24693 18004 [8,] 22205 17537 [9,] 21725 20366 [10,] 27192 22782 [11,] 21790 19169 [12,] 13253 13807 [13,] 37702 29743 [14,] 30364 25591 [15,] 32609 29096 [16,] 30212 26482 [17,] 29965 22405 [18,] 28352 27044 [19,] 25814 17970 [20,] 22414 18730 [21,] 20506 19684 [22,] 28806 19785 [23,] 22228 18479 [24,] 13971 10698 [25,] 36845 NA [26,] 35338 NA [27,] 35022 NA [28,] 34777 NA [29,] 26887 NA [30,] 23970 NA [31,] 22780 NA [32,] 17351 NA [33,] 21382 NA [34,] 24561 NA [35,] 17409 NA [36,] 11514 NA [37,] 31514 NA [38,] 27071 NA [39,] 29462 NA [40,] 26105 NA [41,] 22397 NA [42,] 23843 NA [43,] 21705 NA [44,] 18089 NA [45,] 20764 NA [46,] 25316 NA [47,] 17704 NA [48,] 15548 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/1fxc51354214529.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/2c5cr1354214529.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/3bk8x1354214529.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/4gg3c1354214529.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,] 28029.0 29383.0 36438.0 32034.0 22679 24319 18004.0 17537 20366.0 22782 [2,] 28029.0 29383.0 36438.0 32034.0 22679 24319 18004.0 17537 20366.0 22782 [3,] 34557.5 34536.5 39783.5 34948.5 29316 26726 21348.5 19871 21045.5 24987 [4,] 41086.0 39690.0 43129.0 37863.0 35953 29133 24693.0 22205 21725.0 27192 [5,] 41086.0 39690.0 43129.0 37863.0 35953 29133 24693.0 22205 21725.0 27192 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 19169.0 13253 29743.0 25591.0 29096.0 26482 22405 27044 17970 18730 19684 [2,] 19169.0 13253 29743.0 25591.0 29096.0 26482 22405 27044 17970 18730 19684 [3,] 20479.5 13530 33722.5 27977.5 30852.5 28347 26185 27698 21892 20572 20095 [4,] 21790.0 13807 37702.0 30364.0 32609.0 30212 29965 28352 25814 22414 20506 [5,] 21790.0 13807 37702.0 30364.0 32609.0 30212 29965 28352 25814 22414 20506 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 19785.0 18479.0 10698.0 36845 35338 35022 34777 26887 23970 22780 17351 [2,] 19785.0 18479.0 10698.0 36845 35338 35022 34777 26887 23970 22780 17351 [3,] 24295.5 20353.5 12334.5 36845 35338 35022 34777 26887 23970 22780 17351 [4,] 28806.0 22228.0 13971.0 36845 35338 35022 34777 26887 23970 22780 17351 [5,] 28806.0 22228.0 13971.0 36845 35338 35022 34777 26887 23970 22780 17351 [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [1,] 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 [2,] 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 [3,] 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 [4,] 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 [5,] 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 [,45] [,46] [,47] [,48] [1,] 20764 25316 17704 15548 [2,] 20764 25316 17704 15548 [3,] 20764 25316 17704 15548 [4,] 20764 25316 17704 15548 [5,] 20764 25316 17704 15548 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 19969.84 23021.22 32308.12 28436.17 14485.91 21347.66 13875.36 14655.78 [2,] 49145.16 46051.78 47258.88 41460.83 44146.09 32104.34 28821.64 25086.22 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 19527.19 20060.02 17551.24 12911.06 24830.48 22644.97 26927.68 24179.74 [2,] 22563.81 29913.98 23407.76 14148.94 42614.52 33310.03 34777.32 32514.26 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 17738.75 26236.66 13128.46 16456.13 19176.64 14216.98 16165.01 8677.81 [2,] 34631.25 29159.34 30655.54 24687.87 21013.36 34374.02 24541.99 15991.19 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 36845 35338 35022 34777 26887 23970 22780 17351 21382 24561 17409 11514 [2,] 36845 35338 35022 34777 26887 23970 22780 17351 21382 24561 17409 11514 [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 [2,] 31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" Warning message: In bxp(list(stats = c(28029, 28029, 34557.5, 41086, 41086, 29383, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5q4vd1354214529.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] [1,] 11514 10698.0 [2,] 21715 18604.5 [3,] 25565 22542.0 [4,] 30939 27536.5 [5,] 43129 36438.0 $n [1] 48 24 $conf [,1] [,2] [1,] 23461.44 19661.29 [2,] 27668.56 25422.71 $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q13b1354214529.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,] 391.7372 0.0 0.00 [2,] 2399.2133 0.0 0.00 [3,] 3337.8976 277.0 138.50 [4,] 5446.1364 4720.5 2360.25 [5,] 9386.1354 10307.0 5153.50 $n [1] 24 48 48 $conf [,1] [,2] [,3] [1,] 2355.216 -799.5259 -399.7629 [2,] 4320.579 1353.5259 676.7629 $out [1] 13057.0 13274.0 6528.5 6637.0 $group [1] 2 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(391.737156777347, 2399.21330856596, 3337.8975605911, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fxc51354214529.ps tmp/1fxc51354214529.png",intern=TRUE)) character(0) > try(system("convert tmp/2c5cr1354214529.ps tmp/2c5cr1354214529.png",intern=TRUE)) character(0) > try(system("convert tmp/3bk8x1354214529.ps tmp/3bk8x1354214529.png",intern=TRUE)) character(0) > try(system("convert tmp/4gg3c1354214529.ps tmp/4gg3c1354214529.png",intern=TRUE)) character(0) > try(system("convert tmp/5q4vd1354214529.ps tmp/5q4vd1354214529.png",intern=TRUE)) character(0) > try(system("convert tmp/6q13b1354214529.ps tmp/6q13b1354214529.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.200 0.682 3.864