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(9.84,9.87,9.9,9.9,9.87,9.87,9.88,9.76,9.76,9.76,9.77,9.77,9.77,9.83,9.85,9.85,9.89,9.9,9.92,9.91,9.92,9.92,9.96,9.97,9.98,10.06,10.07,10.12,10.1,10.1,10.1,10.19,10.21,10.2,10.39,10.39,10.39,10.45,10.49,10.48,10.49,10.49,10.5,10.51,10.51,10.53,10.54,10.54,10.55,10.58,10.59,10.56,10.57,10.59,10.63,10.63,10.66,10.69,10.72,10.72,10.73,10.75,10.78,10.79,10.83,10.83,10.85,10.88,10.97,10.98,11,11.04,11.08,11.16,11.19,11.2,11.22,11.26,11.29,11.31,11.39,11.37,11.39,11.39) > 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,] 9.84 9.77 9.98 10.39 10.55 10.73 11.08 NA [2,] 9.87 9.83 10.06 10.45 10.58 10.75 11.16 NA [3,] 9.90 9.85 10.07 10.49 10.59 10.78 11.19 NA [4,] 9.90 9.85 10.12 10.48 10.56 10.79 11.20 NA [5,] 9.87 9.89 10.10 10.49 10.57 10.83 11.22 NA [6,] 9.87 9.90 10.10 10.49 10.59 10.83 11.26 NA [7,] 9.88 9.92 10.10 10.50 10.63 10.85 11.29 NA [8,] 9.76 9.91 10.19 10.51 10.63 10.88 11.31 NA [9,] 9.76 9.92 10.21 10.51 10.66 10.97 11.39 NA [10,] 9.76 9.92 10.20 10.53 10.69 10.98 11.37 NA [11,] 9.77 9.96 10.39 10.54 10.72 11.00 11.39 NA [12,] 9.77 9.97 10.39 10.54 10.72 11.04 11.39 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/1795n1386152818.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/2hig51386152818.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/3pa2i1386152818.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/4ixpw1386152818.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,] 9.77 9.830 9.850 9.850 9.870 9.87 9.88 9.760 9.760 9.760 9.770 [2,] 9.91 9.965 9.985 10.010 9.995 10.00 10.01 10.050 10.065 10.060 10.175 [3,] 10.39 10.450 10.490 10.480 10.490 10.49 10.50 10.510 10.510 10.530 10.540 [4,] 10.64 10.665 10.685 10.675 10.700 10.71 10.74 10.755 10.815 10.835 10.860 [5,] 11.08 11.160 11.190 11.200 11.220 11.26 11.29 11.310 11.390 11.370 11.390 [,12] [1,] 9.77 [2,] 10.18 [3,] 10.54 [4,] 10.88 [5,] 11.39 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 9.954056 10.03197 10.07197 10.08287 10.06899 10.066 10.06406 10.08899 [2,] 10.825944 10.86803 10.90803 10.87713 10.91101 10.914 10.93594 10.93101 [,9] [,10] [,11] [,12] [1,] 10.06211 10.06718 10.13093 10.12197 [2,] 10.95789 10.99282 10.94907 10.95803 $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(9.77, 9.91, 10.39, 10.64, 11.08, 9.83, 9.965, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nqyg1386152818.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,] 9.760 9.770 9.980 10.450 10.550 10.730 11.080 NA [2,] 9.765 9.850 10.085 10.485 10.575 10.785 11.195 NA [3,] 9.855 9.905 10.110 10.495 10.610 10.840 11.275 NA [4,] 9.875 9.920 10.205 10.520 10.675 10.975 11.380 NA [5,] 9.900 9.970 10.210 10.540 10.720 11.040 11.390 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 9.804828 9.873073 10.05527 10.47904 10.56439 10.75334 11.19062 NA [2,] 9.905172 9.936927 10.16473 10.51096 10.65561 10.92666 11.35938 NA $out [1] 10.39 10.39 10.39 $group [1] 3 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(9.76, 9.765, 9.855, 9.875, 9.9, 9.77, 9.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65tdl1386152818.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.4916929 1.310 0.665 [2,] 0.4939924 1.345 0.700 [3,] 0.5171991 1.400 0.705 [4,] 0.5673925 1.615 0.730 [5,] 0.5781992 1.630 0.775 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.4837209 1.276851 0.6913168 [2,] 0.5506774 1.523149 0.7186832 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.491692896798301, 0.49399244554068, 0.517199148619825, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1795n1386152818.ps tmp/1795n1386152818.png",intern=TRUE)) character(0) > try(system("convert tmp/2hig51386152818.ps tmp/2hig51386152818.png",intern=TRUE)) character(0) > try(system("convert tmp/3pa2i1386152818.ps tmp/3pa2i1386152818.png",intern=TRUE)) character(0) > try(system("convert tmp/4ixpw1386152818.ps tmp/4ixpw1386152818.png",intern=TRUE)) character(0) > try(system("convert tmp/5nqyg1386152818.ps tmp/5nqyg1386152818.png",intern=TRUE)) character(0) > try(system("convert tmp/65tdl1386152818.ps tmp/65tdl1386152818.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.245 1.263 6.538