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(36439,36368,36290,36147,37615,37543,36439,35705,35777,35777,35848,35998,35998,35335,35043,35335,36368,36218,34822,33640,33419,32977,33276,33640,33497,33198,32614,33198,33718,33568,31873,31139,30405,29814,29743,30184,29593,29372,29151,30405,30548,29814,27826,26943,25547,24955,25247,25689,25689,25326,25247,26430,27385,26943,25468,24735,23189,22234,22968,23702,23702,22747,22676,23922,24735,24442,22968,22013,19947,19142,19434,20688,20759,18921,19584,21201,21935,21493,19506,18109,16492,15238,15751,16855,16563,14946,15459,17076,17960,17447,15459,14576,13251,11854,12075,13179,13322,11997,12218,14063,14504,13764,11042,9646,7801,5963,6554,7359,7217,5813,6625,8613,9496,9055,7288,5892,4417,2721,3021,3534) > 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,] 36439 35998 33497 29593 25689 23702 20759 16563 13322 7217 NA [2,] 36368 35335 33198 29372 25326 22747 18921 14946 11997 5813 NA [3,] 36290 35043 32614 29151 25247 22676 19584 15459 12218 6625 NA [4,] 36147 35335 33198 30405 26430 23922 21201 17076 14063 8613 NA [5,] 37615 36368 33718 30548 27385 24735 21935 17960 14504 9496 NA [6,] 37543 36218 33568 29814 26943 24442 21493 17447 13764 9055 NA [7,] 36439 34822 31873 27826 25468 22968 19506 15459 11042 7288 NA [8,] 35705 33640 31139 26943 24735 22013 18109 14576 9646 5892 NA [9,] 35777 33419 30405 25547 23189 19947 16492 13251 7801 4417 NA [10,] 35777 32977 29814 24955 22234 19142 15238 11854 5963 2721 NA [11,] 35848 33276 29743 25247 22968 19434 15751 12075 6554 3021 NA [12,] 35998 33640 30184 25689 23702 20688 16855 13179 7359 3534 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/1du461376316345.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/2f1gs1376316345.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/378fp1376316345.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/4d71o1376316345.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] [1,] 7217.0 5813.0 6625.0 8613 9496 9055.0 7288 5892 4417 2721 3021 [2,] 16563.0 14946.0 15459.0 17076 17960 17447.0 15459 14576 13251 11854 12075 [3,] 24695.5 24036.5 23961.5 25176 26060 25692.5 24218 23374 21568 20688 21201 [4,] 33497.0 33198.0 32614.0 33198 33718 33568.0 31873 31139 30405 29814 29743 [5,] 36439.0 36368.0 36290.0 36147 37615 37543.0 36439 35705 35777 35777 35848 [,12] [1,] 3534 [2,] 13179 [3,] 22195 [4,] 30184 [5,] 35998 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16234.6 14917.07 15390.18 17120.81 18186.67 17637.81 16016.91 15098.46 [2,] 33156.4 33155.93 32532.82 33231.19 33933.33 33747.19 32419.09 31649.54 [,9] [,10] [,11] [,12] [1,] 12997.18 11714.47 12373.36 13698.62 [2,] 30138.82 29661.53 30028.64 30691.38 $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(7217, 16563, 24695.5, 33497, 36439, 5813, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51oxt1376316345.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] [1,] 35705.0 32977.0 29743.0 24955.0 22234.0 19142.0 15238.0 11854.0 5963.0 [2,] 35812.5 33529.5 30294.5 25618.0 23445.5 20317.5 16673.5 13215.0 7580.0 [3,] 36218.5 34932.5 32243.5 28488.5 25286.5 22711.5 19213.5 15202.5 11519.5 [4,] 36439.0 35666.5 33347.5 29703.5 26059.5 23812.0 20980.0 16819.5 13543.0 [5,] 36439.0 36368.0 33718.0 30548.0 27385.0 24735.0 21935.0 17960.0 14504.0 [,10] [,11] [1,] 2721.0 NA [2,] 3975.5 NA [3,] 6258.5 NA [4,] 7950.5 NA [5,] 9496.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 35932.75 33957.8 30851.01 26625.08 24094.24 21117.64 17249.28 13558.46 [2,] 36504.25 35907.2 33635.99 30351.92 26478.76 24305.36 21177.72 16846.54 [,9] [,10] [,11] [1,] 8799.736 4445.476 NA [2,] 14239.264 8071.524 NA $out [1] 37615 37543 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(35705, 35812.5, 36218.5, 36439, 36439, 32977, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tjgt1376316345.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,] 9397.203 27534.0 13971.75 [2,] 9767.098 28819.5 14391.50 [3,] 10077.737 29739.0 14935.62 [4,] 10761.930 31912.0 15441.50 [5,] 11197.715 33056.0 16301.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9623.987 28328.49 14456.71 [2,] 10531.487 31149.51 15414.54 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(9397.20260976046, 9767.09827616178, 10077.7369884964, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1du461376316345.ps tmp/1du461376316345.png",intern=TRUE)) character(0) > try(system("convert tmp/2f1gs1376316345.ps tmp/2f1gs1376316345.png",intern=TRUE)) character(0) > try(system("convert tmp/378fp1376316345.ps tmp/378fp1376316345.png",intern=TRUE)) character(0) > try(system("convert tmp/4d71o1376316345.ps tmp/4d71o1376316345.png",intern=TRUE)) character(0) > try(system("convert tmp/51oxt1376316345.ps tmp/51oxt1376316345.png",intern=TRUE)) character(0) > try(system("convert tmp/6tjgt1376316345.ps tmp/6tjgt1376316345.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.671 1.005 5.673