R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(58109,57087,56064,54019,74712,73689,58109,47763,48785,48785,49808,51964,45718,39462,34339,34339,54019,56064,40484,22859,32183,32183,39462,43663,42640,32183,37417,35362,52987,48785,32183,19782,31160,34339,37417,41507,33205,26038,29116,30138,57087,57087,41507,39462,45718,42640,50942,61288,63343,48785,44685,40484,68567,70622,65388,70622,69589,61288,70622,80968,85169,72667,64365,70622,97570,105872,103827,107916,106894,96548,114173,118374,124519,105872,98593,106894,126675,144300,140099,140099,142154,134976,153634,153634,150455,132820,135999,138054,151579,169204,156701,162958,157724,154656,178538,173304,166025,155679,166025,171259,177505,185806,177505,182628,176381,175359,201285,203441,195140,180583,192984,198208,204464,213788,204464,211743,208564,197185,221066,221066) > 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,] 58109 45718 42640 33205 63343 85169 124519 150455 166025 195140 NA [2,] 57087 39462 32183 26038 48785 72667 105872 132820 155679 180583 NA [3,] 56064 34339 37417 29116 44685 64365 98593 135999 166025 192984 NA [4,] 54019 34339 35362 30138 40484 70622 106894 138054 171259 198208 NA [5,] 74712 54019 52987 57087 68567 97570 126675 151579 177505 204464 NA [6,] 73689 56064 48785 57087 70622 105872 144300 169204 185806 213788 NA [7,] 58109 40484 32183 41507 65388 103827 140099 156701 177505 204464 NA [8,] 47763 22859 19782 39462 70622 107916 140099 162958 182628 211743 NA [9,] 48785 32183 31160 45718 69589 106894 142154 157724 176381 208564 NA [10,] 48785 32183 34339 42640 61288 96548 134976 154656 175359 197185 NA [11,] 49808 39462 37417 50942 70622 114173 153634 178538 201285 221066 NA [12,] 51964 43663 41507 61288 80968 118374 153634 173304 203441 221066 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/1l4mh1471216040.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/2yc791471216040.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/3u8sb1471216040.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/4tg6k1471216040.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,] 33205 26038 29116.0 30138.0 52987 48785.0 32183.0 19782 31160.0 [2,] 45718 39462 37417.0 35362.0 57087 57087.0 41507.0 39462 45718.0 [3,] 74256 64877 60214.5 62320.5 86141 89780.5 84607.5 89269 88241.5 [4,] 150455 132820 135999.0 138054.0 151579 169204.0 156701.0 162958 157724.0 [5,] 195140 180583 192984.0 198208.0 204464 213788.0 204464.0 211743 208564.0 [,10] [,11] [,12] [1,] 32183 37417.0 41507 [2,] 42640 49808.0 51964 [3,] 78918 92397.5 99671 [4,] 154656 178538.0 173304 [5,] 197185 221066.0 221066 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 21925.22 18231.62 10959 11011.48 38929.03 33762.38 27051.98 [2,] 126586.78 111522.38 109470 113629.52 133352.97 145798.62 142163.02 [,8] [,9] [,10] [,11] [,12] [1,] 27565.47 32278.84 22950.34 28078.86 39044.7 [2,] 150972.53 144204.16 134885.66 156716.14 160297.3 $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(33205, 45718, 74256, 150455, 195140, 26038, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cpyz1471216040.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,] 47763.0 22859.0 19782.0 26038.0 40484.0 64365.0 98593.0 132820.0 155679 [2,] 49296.5 33261.0 32183.0 31671.5 55036.5 78918.0 115706.5 144254.5 168642 [3,] 55041.5 39462.0 36389.5 42073.5 66977.5 100698.5 137537.5 155678.5 176943 [4,] 58109.0 44690.5 42073.5 54014.5 70622.0 107405.0 143227.0 166081.0 184217 [5,] 58109.0 56064.0 52987.0 61288.0 80968.0 118374.0 153634.0 178538.0 203441 [,10] [,11] [1,] 180583.0 NA [2,] 196162.5 NA [3,] 204464.0 NA [4,] 212765.5 NA [5,] 221066.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,] 51022.06 34248.93 31878.38 31882.71 59868.85 87705.39 124985.2 145723.3 [2,] 59060.94 44675.07 40900.62 52264.29 74086.15 113691.61 150089.8 165633.7 [,9] [,10] [,11] [1,] 169839.1 196891.3 NA [2,] 184046.9 212036.7 NA $out [1] 74712 73689 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(47763, 49296.5, 55041.5, 58109, 58109, 22859, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60ujy1471216040.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,] 55213.24 151477.0 84290.25 [2,] 58823.51 162901.5 90517.50 [3,] 62481.00 166536.5 104033.50 [4,] 67085.05 178481.5 110719.12 [5,] 71619.47 191961.0 122220.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 58712.85 159430.4 94819.4 [2,] 66249.14 173642.6 113247.6 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(55213.2356076572, 58823.5052356145, 62480.9951172611, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1l4mh1471216040.ps tmp/1l4mh1471216040.png",intern=TRUE)) character(0) > try(system("convert tmp/2yc791471216040.ps tmp/2yc791471216040.png",intern=TRUE)) character(0) > try(system("convert tmp/3u8sb1471216040.ps tmp/3u8sb1471216040.png",intern=TRUE)) character(0) > try(system("convert tmp/4tg6k1471216040.ps tmp/4tg6k1471216040.png",intern=TRUE)) character(0) > try(system("convert tmp/5cpyz1471216040.ps tmp/5cpyz1471216040.png",intern=TRUE)) character(0) > try(system("convert tmp/60ujy1471216040.ps tmp/60ujy1471216040.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.248 0.209 2.508