R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(152512,151944,151368,150176,161968,161344,152512,146640,147208,147208,147840,148976,150744,150744,149608,146640,161968,164304,160776,152512,156048,150744,153136,154280,155472,152512,153136,148976,161968,166072,162544,156048,163112,155472,162544,161968,163736,157240,164304,163736,174336,171944,162544,157808,164304,155472,161968,163112,165504,160208,163112,164880,171376,166072,159008,151368,158440,139000,148408,153704,159008,151368,151368,151368,155472,149608,141912,135472,140144,121904,133080,139576,140768,134272,134840,133080,139000,134840,126640,120712,130736,108968,123104,129544,129544,121904,114840,114272,120712,114840,103672,95976,104240,84808,102472,111872,114840,108344,100136,106008,108344,106576,88904,80704,86568,68904,87144,93640,98936,90104,81840,86568,88904,84232,66568,58872,65936,46504,67704,80704) > 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] [1,] 152512 150744 155472 163736 165504 159008 140768 129544 114840 98936 [2,] 151944 150744 152512 157240 160208 151368 134272 121904 108344 90104 [3,] 151368 149608 153136 164304 163112 151368 134840 114840 100136 81840 [4,] 150176 146640 148976 163736 164880 151368 133080 114272 106008 86568 [5,] 161968 161968 161968 174336 171376 155472 139000 120712 108344 88904 [6,] 161344 164304 166072 171944 166072 149608 134840 114840 106576 84232 [7,] 152512 160776 162544 162544 159008 141912 126640 103672 88904 66568 [8,] 146640 152512 156048 157808 151368 135472 120712 95976 80704 58872 [9,] 147208 156048 163112 164304 158440 140144 130736 104240 86568 65936 [10,] 147208 150744 155472 155472 139000 121904 108968 84808 68904 46504 [11,] 147840 153136 162544 161968 148408 133080 123104 102472 87144 67704 [12,] 148976 154280 161968 163112 153704 139576 129544 111872 93640 80704 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1omcq1438258389.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/2u5421438258389.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/3y63h1438258389.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/44mj31438258389.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,] 98936 90104 81840 86568 88904 84232 66568 58872 65936 46504 [2,] 129544 121904 114840 114272 120712 114840 103672 95976 104240 84808 [3,] 151628 151056 150488 147808 158720 155476 147212 141056 143676 130452 [4,] 159008 152512 153136 151368 161968 166072 160776 152512 158440 150744 [5,] 165504 160208 164304 164880 174336 171944 162544 157808 164304 155472 [,11] [,12] [1,] 67704 80704 [2,] 102472 111872 [3,] 140460 144276 [4,] 153136 154280 [5,] 162544 163112 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 136906.6 135763 131353.8 129273.4 138106.9 129878.5 118680.6 112808.4 [2,] 166349.4 166349 169622.2 166342.6 179333.1 181073.5 175743.4 169303.6 [,9] [,10] [,11] [,12] [1,] 116595.5 97507.75 115146.2 123087.3 [2,] 170756.5 163396.25 165773.8 165464.7 $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(98936, 129544, 151628, 159008, 165504, 90104, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g0t11438258389.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] [,11] [1,] 146640 146640 148976 155472 139000 121904 120712 84808 68904 46504 NA [2,] 147524 150744 154304 159888 152536 137524 124872 103072 86856 66252 NA [3,] 150772 152824 159008 163424 159608 145760 131908 113072 96888 81272 NA [4,] 152512 158412 162544 164304 165192 151368 134840 117776 107460 87736 NA [5,] 152512 164304 166072 164304 171376 159008 140768 129544 114840 98936 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 148496.9 149326.6 155249.7 161409.8 153835.5 139445.7 127361.5 106365.4 [2,] 153047.1 156321.4 162766.3 165438.2 165380.5 152074.3 136454.5 119778.6 [,9] [,10] [,11] [1,] 87490.38 71473 NA [2,] 106285.62 91071 NA $out [1] 161968 161344 174336 171944 108968 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(146640, 147524, 150772, 152512, 152512, 146640, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kurx1438258389.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,] 22159.07 66568 25774 [2,] 27159.12 80360 32475 [3,] 29833.93 86572 41085 [4,] 34717.57 97172 48522 [5,] 39292.49 108968 59012 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26386.47 78903.93 33765.86 [2,] 33281.39 94240.07 48404.14 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(22159.0725999282, 27159.1191823975, 29833.9333073353, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1omcq1438258389.ps tmp/1omcq1438258389.png",intern=TRUE)) character(0) > try(system("convert tmp/2u5421438258389.ps tmp/2u5421438258389.png",intern=TRUE)) character(0) > try(system("convert tmp/3y63h1438258389.ps tmp/3y63h1438258389.png",intern=TRUE)) character(0) > try(system("convert tmp/44mj31438258389.ps tmp/44mj31438258389.png",intern=TRUE)) character(0) > try(system("convert tmp/5g0t11438258389.ps tmp/5g0t11438258389.png",intern=TRUE)) character(0) > try(system("convert tmp/6kurx1438258389.ps tmp/6kurx1438258389.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.119 0.385 2.531