R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 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(812,100,113,213,149,134,228,138,162,291,182,2081,2752,125,144,274,257,186,327,209,213,375,400,1054,3377,101,120,221,222,167,297,185,189,298,237,1011,3013,110,109,215,176,134,202,139,169,262,214,1238,3748,127,160,138,134,163,172,163,193,226,344,1294,3524,141,186,135,161,131,170,146,160,151,151,1365) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 812 2752 3377 3013 3748 3524 NA [2,] 100 125 101 110 127 141 NA [3,] 113 144 120 109 160 186 NA [4,] 213 274 221 215 138 135 NA [5,] 149 257 222 176 134 161 NA [6,] 134 186 167 134 163 131 NA [7,] 228 327 297 202 172 170 NA [8,] 138 209 185 139 163 146 NA [9,] 162 213 189 169 193 160 NA [10,] 291 375 298 262 226 151 NA [11,] 182 400 237 214 344 151 NA [12,] 2081 1054 1011 1238 1294 1365 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/1ewq41399922668.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/2gqk51399922668.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/3mcwj1399922668.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/4qjla1399922668.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] [,12] [1,] 2752 100.0 109 135 134.0 131.0 170 138.0 160 151.0 151.0 1011 [2,] 2752 101.0 113 138 149.0 134.0 172 139.0 162 226.0 182.0 1054 [3,] 3195 117.5 132 214 168.5 148.5 215 154.5 179 276.5 225.5 1266 [4,] 3524 127.0 160 221 222.0 167.0 297 185.0 193 298.0 344.0 1365 [5,] 3748 141.0 186 274 257.0 186.0 327 209.0 213 375.0 400.0 1365 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2697.035 100.7292 101.6835 160.4623 121.4126 127.2139 134.371 124.8285 [2,] 3692.965 134.2708 162.3165 267.5377 215.5874 169.7861 295.629 184.1715 [,9] [,10] [,11] [,12] [1,] 159.004 230.0577 121.0048 1065.395 [2,] 198.996 322.9423 329.9952 1466.605 $out [1] 812 2081 $group [1] 1 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2752, 2752, 3195, 3524, 3748, 100, 101, 117.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qxqb1399922668.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] [1,] 100.0 125.0 101.0 109.0 127.0 131.0 NA [2,] 136.0 197.5 176.0 136.5 149.0 143.5 NA [3,] 172.0 265.5 221.5 189.0 167.5 155.5 NA [4,] 259.5 387.5 297.5 238.5 285.0 178.0 NA [5,] 291.0 400.0 298.0 262.0 344.0 186.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 115.6708 178.8397 166.083 142.4771 105.4695 139.7643 NA [2,] 228.3292 352.1603 276.917 235.5229 229.5305 171.2357 NA $out [1] 812 2081 2752 1054 3377 1011 3013 1238 3748 1294 3524 1365 $group [1] 1 1 2 2 3 3 4 4 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100, 136, 172, 259.5, 291, 125, 197.5, 265.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z6ph1399922668.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,] 16.32993 41.0 23.250 [2,] 25.67789 63.0 35.375 [3,] 50.35615 131.0 59.875 [4,] 86.18416 236.5 113.750 [5,] 97.05188 249.0 127.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 22.75884 51.86549 24.12764 [2,] 77.95347 210.13451 95.62236 $out [1] 1070.0822 387.8818 2936.0000 1070.0000 670.0000 247.2500 $group [1] 1 1 2 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(16.3299316185545, 25.6778923126943, 50.3561504791933, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ewq41399922668.ps tmp/1ewq41399922668.png",intern=TRUE)) character(0) > try(system("convert tmp/2gqk51399922668.ps tmp/2gqk51399922668.png",intern=TRUE)) character(0) > try(system("convert tmp/3mcwj1399922668.ps tmp/3mcwj1399922668.png",intern=TRUE)) character(0) > try(system("convert tmp/4qjla1399922668.ps tmp/4qjla1399922668.png",intern=TRUE)) character(0) > try(system("convert tmp/5qxqb1399922668.ps tmp/5qxqb1399922668.png",intern=TRUE)) character(0) > try(system("convert tmp/6z6ph1399922668.ps tmp/6z6ph1399922668.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.762 0.538 3.341