R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" 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(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 = '60' > par1 <- '60' > #'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 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 41086 29743 [2,] 39690 25591 [3,] 43129 29096 [4,] 37863 26482 [5,] 35953 22405 [6,] 29133 27044 [7,] 24693 17970 [8,] 22205 18730 [9,] 21725 19684 [10,] 27192 19785 [11,] 21790 18479 [12,] 13253 10698 [13,] 37702 NA [14,] 30364 NA [15,] 32609 NA [16,] 30212 NA [17,] 29965 NA [18,] 28352 NA [19,] 25814 NA [20,] 22414 NA [21,] 20506 NA [22,] 28806 NA [23,] 22228 NA [24,] 13971 NA [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 [49,] 28029 NA [50,] 29383 NA [51,] 36438 NA [52,] 32034 NA [53,] 22679 NA [54,] 24319 NA [55,] 18004 NA [56,] 17537 NA [57,] 20366 NA [58,] 22782 NA [59,] 19169 NA [60,] 13807 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/11sx31385975700.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/2wvpp1385975700.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/3pr1a1385975700.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/4gzre1385975700.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,] 29743.0 25591.0 29096.0 26482.0 22405 27044.0 17970.0 18730.0 19684.0 [2,] 29743.0 25591.0 29096.0 26482.0 22405 27044.0 17970.0 18730.0 19684.0 [3,] 35414.5 32640.5 36112.5 32172.5 29179 28088.5 21331.5 20467.5 20704.5 [4,] 41086.0 39690.0 43129.0 37863.0 35953 29133.0 24693.0 22205.0 21725.0 [5,] 41086.0 39690.0 43129.0 37863.0 35953 29133.0 24693.0 22205.0 21725.0 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 19785.0 18479.0 10698.0 37702 30364 32609 30212 29965 28352 25814 22414 [2,] 19785.0 18479.0 10698.0 37702 30364 32609 30212 29965 28352 25814 22414 [3,] 23488.5 20134.5 11975.5 37702 30364 32609 30212 29965 28352 25814 22414 [4,] 27192.0 21790.0 13253.0 37702 30364 32609 30212 29965 28352 25814 22414 [5,] 27192.0 21790.0 13253.0 37702 30364 32609 30212 29965 28352 25814 22414 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 22780 17351 [2,] 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 22780 17351 [3,] 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 22780 17351 [4,] 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 22780 17351 [5,] 20506 28806 22228 13971 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] [,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56] [1,] 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 [2,] 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 [3,] 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 [4,] 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 [5,] 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 [,57] [,58] [,59] [,60] [1,] 20366 22782 19169 13807 [2,] 20366 22782 19169 13807 [3,] 20366 22782 19169 13807 [4,] 20366 22782 19169 13807 [5,] 20366 22782 19169 13807 $n [1] 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 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 22741.77 16888.69 20434.43 19457.32 14042.79 25754.61 13820.37 16585.13 [2,] 48087.23 48392.31 51790.57 44887.68 44315.21 30422.39 28842.63 24349.87 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 18424.24 15213.19 16435.36 9120.981 37702 30364 32609 30212 29965 28352 [2,] 22984.76 31763.81 23833.64 14830.019 37702 30364 32609 30212 29965 28352 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 25814 22414 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 [2,] 25814 22414 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 22780 17351 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 [2,] 22780 17351 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [,51] [,52] [,53] [,54] [1,] 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 [2,] 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 [,55] [,56] [,57] [,58] [,59] [,60] [1,] 18004 17537 20366 22782 19169 13807 [2,] 18004 17537 20366 22782 19169 13807 $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" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" Warning message: In bxp(list(stats = c(29743, 29743, 35414.5, 41086, 41086, 25591, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bs241385975700.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,] 21073 18604.5 [3,] 24627 21095.0 [4,] 30288 26763.0 [5,] 43129 29743.0 $n [1] 60 12 $conf [,1] [,2] [1,] 22747.35 17373.85 [2,] 26506.65 24816.15 $out numeric(0) $group numeric(0) $names [1] "1" NA Warning message: In bxp(list(stats = c(11514, 21073, 24627, 30288, 43129, 10698, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tizk1385975700.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,] 1443.205 0 0 [2,] 2073.944 0 0 [3,] 4995.709 0 0 [4,] 8813.732 0 0 [5,] 9969.499 0 0 $n [1] 12 60 60 $conf [,1] [,2] [,3] [1,] 1921.647 0 0 [2,] 8069.772 0 0 $out [1] 11343.0 14099.0 14033.0 11381.0 13548.0 2089.0 6723.0 3475.0 2041.0 [10] 7407.0 3311.0 2555.0 5671.5 7049.5 7016.5 5690.5 6774.0 1044.5 [19] 3361.5 1737.5 1020.5 3703.5 1655.5 1277.5 $group [1] 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1443.20494040174, 2073.94418922014, 4995.70940908296, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11sx31385975700.ps tmp/11sx31385975700.png",intern=TRUE)) character(0) > try(system("convert tmp/2wvpp1385975700.ps tmp/2wvpp1385975700.png",intern=TRUE)) character(0) > try(system("convert tmp/3pr1a1385975700.ps tmp/3pr1a1385975700.png",intern=TRUE)) character(0) > try(system("convert tmp/4gzre1385975700.ps tmp/4gzre1385975700.png",intern=TRUE)) character(0) > try(system("convert tmp/5bs241385975700.ps tmp/5bs241385975700.png",intern=TRUE)) character(0) > try(system("convert tmp/6tizk1385975700.ps tmp/6tizk1385975700.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.732 1.082 6.788