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(16.3,16.37,16.38,16.37,16.42,16.43,16.44,16.53,16.55,16.56,16.6,16.61,16.62,16.64,16.61,16.74,16.87,16.89,16.89,16.99,17.06,17.1,17.11,17.17,17.17,17.21,17.37,17.43,17.44,17.46,17.42,17.47,17.45,17.44,17.46,17.47,17.47,17.56,17.61,17.61,17.6,17.57,17.59,17.59,17.68,17.73,17.75,17.75,17.75,17.85,18.06,18.05,18.16,18.2,18.21,18.33,18.36,18.37,18.4,18.47,18.49,18.5,18.53,18.56,18.6,18.61,18.62,18.61,18.65,18.77,18.78,18.78,18.8,18.85,18.85,18.98,19.06,19.08,19.19,19.21,19.29,19.3,19.36,19.36) > 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,] 16.30 16.62 17.17 17.47 17.75 18.49 18.80 NA [2,] 16.37 16.64 17.21 17.56 17.85 18.50 18.85 NA [3,] 16.38 16.61 17.37 17.61 18.06 18.53 18.85 NA [4,] 16.37 16.74 17.43 17.61 18.05 18.56 18.98 NA [5,] 16.42 16.87 17.44 17.60 18.16 18.60 19.06 NA [6,] 16.43 16.89 17.46 17.57 18.20 18.61 19.08 NA [7,] 16.44 16.89 17.42 17.59 18.21 18.62 19.19 NA [8,] 16.53 16.99 17.47 17.59 18.33 18.61 19.21 NA [9,] 16.55 17.06 17.45 17.68 18.36 18.65 19.29 NA [10,] 16.56 17.10 17.44 17.73 18.37 18.77 19.30 NA [11,] 16.60 17.11 17.46 17.75 18.40 18.78 19.36 NA [12,] 16.61 17.17 17.47 17.75 18.47 18.78 19.36 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/fisher/rcomp/tmp/14vuq1385571641.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/fisher/rcomp/tmp/2a2df1385571641.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/fisher/rcomp/tmp/3fng91385571641.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/fisher/rcomp/tmp/4jf5l1385571641.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] [1,] 16.300 16.370 16.380 16.370 16.420 16.430 16.440 16.53 16.550 16.56 16.600 [2,] 16.895 16.925 16.990 17.085 17.155 17.175 17.155 17.23 17.255 17.27 17.285 [3,] 17.470 17.560 17.610 17.610 17.600 17.570 17.590 17.59 17.680 17.73 17.750 [4,] 18.120 18.175 18.295 18.305 18.380 18.405 18.415 18.47 18.505 18.57 18.590 [5,] 18.800 18.850 18.850 18.980 19.060 19.080 19.190 19.21 19.290 19.30 19.360 [,12] [1,] 16.610 [2,] 17.320 [3,] 17.750 [4,] 18.625 [5,] 19.360 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.73845 16.81352 16.83068 16.88144 16.86845 16.83546 16.83755 16.84949 [2,] 18.20155 18.30648 18.38932 18.33856 18.33155 18.30454 18.34245 18.33051 [,9] [,10] [,11] [,12] [1,] 16.93352 16.95366 16.97068 16.97068 [2,] 18.42648 18.50634 18.52932 18.52932 $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(16.3, 16.895, 17.47, 18.12, 18.8, 16.37, 16.925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/51yud1385571641.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,] 16.300 16.61 17.370 17.470 17.750 18.490 18.800 NA [2,] 16.375 16.69 17.395 17.580 18.055 18.545 18.915 NA [3,] 16.435 16.89 17.440 17.605 18.205 18.610 19.135 NA [4,] 16.555 17.08 17.460 17.705 18.365 18.710 19.295 NA [5,] 16.610 17.17 17.470 17.750 18.470 18.780 19.360 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.3529 16.71212 17.41035 17.54799 18.06361 18.53474 18.96168 NA [2,] 16.5171 17.06788 17.46965 17.66201 18.34639 18.68526 19.30832 NA $out [1] 17.17 17.21 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(16.3, 16.375, 16.435, 16.555, 16.61, 16.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/64wf71385571641.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,] 0.9143564 2.470 1.2200 [2,] 0.9318917 2.555 1.2275 [3,] 0.9422554 2.665 1.2500 [4,] 0.9676148 2.745 1.3025 [5,] 0.9731857 2.760 1.3050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.9259618 2.57834 1.215792 [2,] 0.9585489 2.75166 1.284208 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.914356396077383, 0.931891680794536, 0.942255377380689, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14vuq1385571641.ps tmp/14vuq1385571641.png",intern=TRUE)) character(0) > try(system("convert tmp/2a2df1385571641.ps tmp/2a2df1385571641.png",intern=TRUE)) character(0) > try(system("convert tmp/3fng91385571641.ps tmp/3fng91385571641.png",intern=TRUE)) character(0) > try(system("convert tmp/4jf5l1385571641.ps tmp/4jf5l1385571641.png",intern=TRUE)) character(0) > try(system("convert tmp/51yud1385571641.ps tmp/51yud1385571641.png",intern=TRUE)) character(0) > try(system("convert tmp/64wf71385571641.ps tmp/64wf71385571641.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.663 1.921 11.607