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(104.4,104.4,104.4,104.4,104.4,104.41,104.42,104.68,106.02,106.35,106.38,106.47,106.5,106.56,113.07,116.26,118,118.02,118.04,118.12,118.12,118.17,118.22,118.22,118.23,118.23,118.23,119.94,120.88,121.14,121.16,121.2,121.2,121.2,121.2,121.2,121.22,121.22,121.95,123.05,123.44,123.65,123.79,123.87,123.91,123.94,124.28,126.28,126.68,126.69,126.69,126.99,128.79,128.84,128.95,128.97,128.97,128.97,128.97,128.97,128.97,128.98,128.99,129.07,129.76,130.47,130.76,130.88,131.04,131.06,131.13,131.15,131.16,131.33,131.42,131.86,134.39,135.59,136.01,136.14,136.74,136.89,136.82,136.82) > 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,] 104.40 106.50 118.23 121.22 126.68 128.97 131.16 NA [2,] 104.40 106.56 118.23 121.22 126.69 128.98 131.33 NA [3,] 104.40 113.07 118.23 121.95 126.69 128.99 131.42 NA [4,] 104.40 116.26 119.94 123.05 126.99 129.07 131.86 NA [5,] 104.40 118.00 120.88 123.44 128.79 129.76 134.39 NA [6,] 104.41 118.02 121.14 123.65 128.84 130.47 135.59 NA [7,] 104.42 118.04 121.16 123.79 128.95 130.76 136.01 NA [8,] 104.68 118.12 121.20 123.87 128.97 130.88 136.14 NA [9,] 106.02 118.12 121.20 123.91 128.97 131.04 136.74 NA [10,] 106.35 118.17 121.20 123.94 128.97 131.06 136.89 NA [11,] 106.38 118.22 121.20 124.28 128.97 131.13 136.82 NA [12,] 106.47 118.22 121.20 126.28 128.97 131.15 136.82 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/1r91q1385991504.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/2sa631385991504.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/3a3up1385991504.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/41o481385991504.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,] 104.400 104.400 104.40 104.40 118.000 118.020 104.420 104.680 106.020 [2,] 112.365 112.395 115.65 118.10 119.440 119.580 119.600 119.660 119.660 [3,] 121.220 121.220 121.95 123.05 123.440 123.650 123.790 123.870 123.910 [4,] 127.825 127.835 127.84 128.03 129.275 129.655 129.855 129.925 130.005 [5,] 131.160 131.330 131.42 131.86 134.390 135.590 136.010 136.140 136.740 [,10] [,11] [,12] [1,] 106.350 106.38 106.47 [2,] 119.685 119.71 119.71 [3,] 123.940 124.28 126.28 [4,] 130.015 130.05 130.06 [5,] 136.890 136.82 136.82 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 111.9875 111.9995 114.6703 117.12 117.5667 117.6334 117.6659 117.7399 [2,] 130.4525 130.4405 129.2297 128.98 129.3133 129.6666 129.9141 130.0001 [,9] [,10] [,11] [,12] [1,] 117.7321 117.7711 118.1051 120.0991 [2,] 130.0879 130.1089 130.4549 132.4609 $out [1] 104.40 104.41 $group [1] 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(104.4, 112.365, 121.22, 127.825, 131.16, 104.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/514vg1385991504.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,] 104.400 113.070 118.230 121.220 126.680 128.970 131.16 NA [2,] 104.400 114.665 119.085 122.500 126.840 129.030 131.64 NA [3,] 104.415 118.030 121.150 123.720 128.895 130.615 135.80 NA [4,] 106.185 118.145 121.200 123.925 128.970 131.050 136.78 NA [5,] 106.470 118.220 121.200 124.280 128.970 131.150 136.89 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.6008 116.4427 120.1853 123.07 127.9235 129.6937 133.4556 NA [2,] 105.2292 119.6173 122.1147 124.37 129.8665 131.5363 138.1444 NA $out [1] 106.50 106.56 126.28 $group [1] 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(104.4, 104.4, 104.415, 106.185, 106.47, 113.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qpj01385991504.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,] 9.583751 26.760 9.835 [2,] 9.898960 27.240 10.165 [3,] 9.981032 30.395 10.335 [4,] 10.290425 30.950 11.270 [5,] 10.656938 31.590 12.190 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.802482 28.70284 9.831002 [2,] 10.159582 32.08716 10.838998 $out [1] 9.303357 15.460000 15.440000 $group [1] 1 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(9.58375088117283, 9.89895965748151, 9.9810317468531, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r91q1385991504.ps tmp/1r91q1385991504.png",intern=TRUE)) character(0) > try(system("convert tmp/2sa631385991504.ps tmp/2sa631385991504.png",intern=TRUE)) character(0) > try(system("convert tmp/3a3up1385991504.ps tmp/3a3up1385991504.png",intern=TRUE)) character(0) > try(system("convert tmp/41o481385991504.ps tmp/41o481385991504.png",intern=TRUE)) character(0) > try(system("convert tmp/514vg1385991504.ps tmp/514vg1385991504.png",intern=TRUE)) character(0) > try(system("convert tmp/6qpj01385991504.ps tmp/6qpj01385991504.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.448 1.455 7.888