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(462.23,464.79,465.22,468.52,469.02,469.15,469.15,469.15,469.15,469.41,469.45,469.45,469.93,477.19,478.97,480.44,480.56,481.8,483.24,483.45,483.53,483.59,483.59,483.59,492.36,495.71,499.29,499.78,500,500,500.29,500.42,500.61,498.9,499.06,496.61,498.41,501.26,505.4,506.07,506.2,507.14,507.14,507.28,507.34,507.48,506.97,506.97,510.1,515.84,519,520.1,521.26,521.04,521.12,521.12,521.1,521.16,521.14,521.13,522.17,531.39,532.12,533.34,535.72,536.25,536.25,536.68,536.76,536.79,536.99,536.99,542.38,544.1,546.96,547.04,550.27,550.32,551.17,552.83,552.35,552.44,552.47,548.78) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 462.23 469.93 492.36 498.41 510.10 522.17 542.38 NA [2,] 464.79 477.19 495.71 501.26 515.84 531.39 544.10 NA [3,] 465.22 478.97 499.29 505.40 519.00 532.12 546.96 NA [4,] 468.52 480.44 499.78 506.07 520.10 533.34 547.04 NA [5,] 469.02 480.56 500.00 506.20 521.26 535.72 550.27 NA [6,] 469.15 481.80 500.00 507.14 521.04 536.25 550.32 NA [7,] 469.15 483.24 500.29 507.14 521.12 536.25 551.17 NA [8,] 469.15 483.45 500.42 507.28 521.12 536.68 552.83 NA [9,] 469.15 483.53 500.61 507.34 521.10 536.76 552.35 NA [10,] 469.41 483.59 498.90 507.48 521.16 536.79 552.44 NA [11,] 469.45 483.59 499.06 506.97 521.14 536.99 552.47 NA [12,] 469.45 483.59 496.61 506.97 521.13 536.99 548.78 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/1xjpx1386156772.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/2m7k11386156772.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/3eo5o1386156772.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/4w6q11386156772.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,] 462.230 464.790 465.22 468.52 469.02 469.150 469.150 469.150 469.15 [2,] 481.145 486.450 489.13 490.11 490.28 490.900 491.765 491.935 492.07 [3,] 498.410 501.260 505.40 506.07 506.20 507.140 507.140 507.280 507.34 [4,] 516.135 523.615 525.56 526.72 528.49 528.645 528.685 528.900 528.93 [5,] 542.380 544.100 546.96 547.04 550.27 550.320 551.170 552.830 552.35 [,10] [,11] [,12] [1,] 469.410 469.450 469.45 [2,] 491.245 491.325 490.10 [3,] 507.480 506.970 506.97 [4,] 528.975 529.065 529.06 [5,] 552.440 552.470 548.78 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 477.5145 479.0657 483.6446 484.2071 483.3816 484.5993 485.092 485.2051 [2,] 519.3055 523.4543 527.1554 527.9329 529.0184 529.6807 529.188 529.3549 [,9] [,10] [,11] [,12] [1,] 485.3278 484.9483 484.4323 483.7037 [2,] 529.3522 530.0117 529.5077 530.2363 $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(462.23, 481.145, 498.41, 516.135, 542.38, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rq6w1386156772.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] [1,] 464.79 477.190 495.710 505.400 519.000 531.390 542.380 NA [2,] 466.87 479.705 497.755 505.735 519.550 532.730 547.000 NA [3,] 469.15 482.520 499.535 506.970 521.110 536.250 550.295 NA [4,] 469.28 483.560 500.145 507.210 521.135 536.775 552.395 NA [5,] 469.45 483.590 500.610 507.480 521.260 536.990 552.830 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 468.0508 480.7617 498.4449 506.2972 520.3871 534.405 547.8343 NA [2,] 470.2492 484.2783 500.6251 507.6428 521.8329 538.095 552.7557 NA $out [1] 462.23 469.93 492.36 498.41 501.26 510.10 515.84 522.17 $group [1] 1 2 3 4 4 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(464.79, 466.87, 469.15, 469.28, 469.45, 477.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6s0rc1386156772.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,] 27.99432 78.520 36.4300 [2,] 28.44662 79.740 36.7350 [3,] 28.86857 81.495 37.0650 [4,] 29.17668 83.025 37.7425 [5,] 29.27616 83.680 38.9600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 28.53558 79.99669 36.60547 [2,] 29.20155 82.99331 37.52453 $out [1] 34.99 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(27.9943222985016, 28.4466195456234, 28.8685659515968, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xjpx1386156772.ps tmp/1xjpx1386156772.png",intern=TRUE)) character(0) > try(system("convert tmp/2m7k11386156772.ps tmp/2m7k11386156772.png",intern=TRUE)) character(0) > try(system("convert tmp/3eo5o1386156772.ps tmp/3eo5o1386156772.png",intern=TRUE)) character(0) > try(system("convert tmp/4w6q11386156772.ps tmp/4w6q11386156772.png",intern=TRUE)) character(0) > try(system("convert tmp/5rq6w1386156772.ps tmp/5rq6w1386156772.png",intern=TRUE)) character(0) > try(system("convert tmp/6s0rc1386156772.ps tmp/6s0rc1386156772.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.450 1.678 9.367