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(101.1,101.35,101.45,101.49,101.68,101.92,102.04,102.55,104.02,105.41,105.48,105.54,105.16,105.16,105.16,105.16,105.16,105.17,105.17,105.54,106.9,107.27,107.31,107.39,107.41,107.46,113.14,117,119.28,119.39,119.5,119.67,119.67,119.73,119.77,119.77,119.78,119.78,119.78,121.28,122.44,122.72,122.75,122.8,122.81,122.83,122.83,122.83,122.84,122.85,123.61,124.74,125.1,125.29,125.45,125.51,125.55,125.57,125.81,127.41,127.75,127.76,127.8,128.23,130.01,130.07,130.17,130.21,130.22,130.23,130.23,130.23,130.23,130.24,130.13,130.14,130.79,131.38,131.61,131.72,131.89,131.89,131.96,131.99,132,132.06,132.11,132.88,135.48,136.56,136.96,137.4,138.32,138.82,138.96,138.94,139,139.19,139.22,139.37,140.74,141.17,141.51,142.94,144.81,145.41,146.11,146.23) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 101.10 105.16 107.41 119.78 122.84 127.75 130.23 132.00 139.00 NA [2,] 101.35 105.16 107.46 119.78 122.85 127.76 130.24 132.06 139.19 NA [3,] 101.45 105.16 113.14 119.78 123.61 127.80 130.13 132.11 139.22 NA [4,] 101.49 105.16 117.00 121.28 124.74 128.23 130.14 132.88 139.37 NA [5,] 101.68 105.16 119.28 122.44 125.10 130.01 130.79 135.48 140.74 NA [6,] 101.92 105.17 119.39 122.72 125.29 130.07 131.38 136.56 141.17 NA [7,] 102.04 105.17 119.50 122.75 125.45 130.17 131.61 136.96 141.51 NA [8,] 102.55 105.54 119.67 122.80 125.51 130.21 131.72 137.40 142.94 NA [9,] 104.02 106.90 119.67 122.81 125.55 130.22 131.89 138.32 144.81 NA [10,] 105.41 107.27 119.73 122.83 125.57 130.23 131.89 138.82 145.41 NA [11,] 105.48 107.31 119.77 122.83 125.81 130.23 131.96 138.96 146.11 NA [12,] 105.54 107.39 119.77 122.83 127.41 130.23 131.99 138.94 146.23 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/1tfva1416751118.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/2xani1416751118.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/3a5cm1416751118.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/4im521416751118.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,] 101.10 101.35 101.45 101.49 105.16 101.92 102.04 102.55 104.02 105.41 [2,] 107.41 107.46 113.14 117.00 119.28 119.39 119.50 119.67 119.67 119.73 [3,] 122.84 122.85 123.61 124.74 125.10 125.29 125.45 125.51 125.55 125.57 [4,] 130.23 130.24 130.13 130.14 130.79 131.38 131.61 131.72 131.89 131.89 [5,] 139.00 139.19 139.22 139.37 140.74 141.17 141.51 142.94 144.81 145.41 [,11] [,12] [1,] 105.48 105.54 [2,] 119.77 119.77 [3,] 125.81 127.41 [4,] 131.96 131.99 [5,] 146.11 146.23 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.8215 110.8525 114.6619 117.8196 119.0381 118.9753 119.0721 119.1637 [2,] 134.8585 134.8475 132.5581 131.6604 131.1619 131.6047 131.8279 131.8563 [,9] [,10] [,11] [,12] [1,] 119.1141 119.1657 119.3899 120.9741 [2,] 131.9859 131.9743 132.2301 133.8459 $out [1] 101.68 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(101.1, 107.41, 122.84, 130.23, 139, 101.35, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u67h1416751118.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,] 101.100 105.160 113.140 119.780 122.840 127.750 130.130 132.000 139.000 [2,] 101.470 105.160 115.070 120.530 124.175 128.015 130.235 132.495 139.295 [3,] 101.980 105.170 119.445 122.735 125.370 130.120 131.495 136.760 141.340 [4,] 104.715 107.085 119.700 122.820 125.560 130.225 131.890 138.570 145.110 [5,] 105.540 107.390 119.770 122.830 127.410 130.230 131.990 138.960 146.230 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.4999 104.292 117.3332 121.6905 124.7383 129.112 130.7401 133.9892 [2,] 103.4601 106.048 121.5568 123.7795 126.0017 131.128 132.2499 139.5308 [,9] [,10] [1,] 138.6877 NA [2,] 143.9923 NA $out [1] 107.41 107.46 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(101.1, 101.47, 101.98, 104.715, 105.54, 105.16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ibc81416751118.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,] 13.08696 37.77 11.510 [2,] 13.17777 37.89 12.080 [3,] 13.28411 39.36 12.205 [4,] 13.43137 40.51 15.065 [5,] 13.50547 40.79 16.990 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 13.16844 38.165 10.84352 [2,] 13.39978 40.555 13.56648 $out [1] 12.68316 12.55912 22.82000 22.78000 $group [1] 1 1 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(13.0869567169419, 13.1777713690336, 13.284110877576, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tfva1416751118.ps tmp/1tfva1416751118.png",intern=TRUE)) character(0) > try(system("convert tmp/2xani1416751118.ps tmp/2xani1416751118.png",intern=TRUE)) character(0) > try(system("convert tmp/3a5cm1416751118.ps tmp/3a5cm1416751118.png",intern=TRUE)) character(0) > try(system("convert tmp/4im521416751118.ps tmp/4im521416751118.png",intern=TRUE)) character(0) > try(system("convert tmp/5u67h1416751118.ps tmp/5u67h1416751118.png",intern=TRUE)) character(0) > try(system("convert tmp/6ibc81416751118.ps tmp/6ibc81416751118.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.172 0.366 2.547