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(1.93,2.02,1.85,1.77,1.81,1.67,1.55,1.62,1.79,1.73,1.77,1.95,2.08,2.26,2.02,1.9,1.97,1.76,1.93,1.91,1.96,1.99,1.98,1.96,1.95,2.26,2.07,2.02,2.07,1.88,1.75,1.78,1.87,1.94,2.03,2.13,2.04,2.18,2.02,1.99,2.09,1.88,1.8,1.77,1.85,1.9,2.03,2.02,2.09,2.3,2.16,2.02,2.31,1.98,1.74,1.82,2.07,2.04,2.07,2.13,2.14,2.43,2.26,2.11,2.19,2.04,2.04,2.05,2.08,1.98,2.07,2.12,2.15,2.35,2.19,2.17,2.3,2.09,1.95,1.89,1.95,1.98,1.95,2.06) > 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,] 1.93 2.08 1.95 2.04 2.09 2.14 2.15 NA [2,] 2.02 2.26 2.26 2.18 2.30 2.43 2.35 NA [3,] 1.85 2.02 2.07 2.02 2.16 2.26 2.19 NA [4,] 1.77 1.90 2.02 1.99 2.02 2.11 2.17 NA [5,] 1.81 1.97 2.07 2.09 2.31 2.19 2.30 NA [6,] 1.67 1.76 1.88 1.88 1.98 2.04 2.09 NA [7,] 1.55 1.93 1.75 1.80 1.74 2.04 1.95 NA [8,] 1.62 1.91 1.78 1.77 1.82 2.05 1.89 NA [9,] 1.79 1.96 1.87 1.85 2.07 2.08 1.95 NA [10,] 1.73 1.99 1.94 1.90 2.04 1.98 1.98 NA [11,] 1.77 1.98 2.03 2.03 2.07 2.07 1.95 NA [12,] 1.95 1.96 2.13 2.02 2.13 2.12 2.06 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/16r8z1386151239.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/26yur1386151239.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/3onna1386151240.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/4cadu1386151240.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] [,12] [1,] 1.930 2.180 1.850 1.770 1.810 1.67 1.550 1.620 1.790 1.900 1.950 1.950 [2,] 1.995 2.220 2.020 1.945 2.020 1.82 1.745 1.775 1.860 1.920 1.965 1.990 [3,] 2.080 2.260 2.070 2.020 2.090 1.88 1.800 1.820 1.950 1.980 2.030 2.060 [4,] 2.115 2.325 2.175 2.065 2.245 2.01 1.940 1.900 2.015 1.985 2.050 2.125 [5,] 2.150 2.430 2.260 2.170 2.310 2.09 2.040 2.050 2.080 2.040 2.070 2.130 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.008338 2.197296 1.977437 1.948338 1.955634 1.766535 1.683549 1.745352 [2,] 2.151662 2.322704 2.162563 2.091662 2.224366 1.993465 1.916451 1.894648 [,9] [,10] [,11] [,12] [1,] 1.857437 1.941183 1.979239 1.97938 [2,] 2.042563 2.018817 2.080761 2.14062 $out [1] 2.02 1.73 1.77 $group [1] 2 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.93, 1.995, 2.08, 2.115, 2.15, 2.18, 2.22, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5em5n1386151240.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,] 1.55 1.900 1.750 1.770 1.820 1.980 1.890 NA [2,] 1.70 1.920 1.875 1.865 2.000 2.045 1.950 NA [3,] 1.78 1.965 1.985 2.005 2.070 2.095 2.075 NA [4,] 1.89 2.005 2.070 2.035 2.145 2.165 2.180 NA [5,] 2.02 2.080 2.260 2.180 2.310 2.260 2.350 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.69334 1.926231 1.896059 1.927462 2.003865 2.040267 1.970095 NA [2,] 1.86666 2.003769 2.073941 2.082538 2.136135 2.149733 2.179905 NA $out [1] 2.26 1.76 1.74 2.43 $group [1] 2 2 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.55, 1.7, 1.78, 1.89, 2.02, 1.9, 1.92, 1.965, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kk9w1386151240.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.07825477 0.180 0.0650 [2,] 0.10298552 0.295 0.1125 [3,] 0.13142801 0.405 0.1300 [4,] 0.14314463 0.425 0.1725 [5,] 0.17980148 0.500 0.2250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1131112 0.3457061 0.1026336 [2,] 0.1497449 0.4642939 0.1573664 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0782547731694976, 0.102985518126458, 0.13142801476086, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16r8z1386151239.ps tmp/16r8z1386151239.png",intern=TRUE)) character(0) > try(system("convert tmp/26yur1386151239.ps tmp/26yur1386151239.png",intern=TRUE)) character(0) > try(system("convert tmp/3onna1386151240.ps tmp/3onna1386151240.png",intern=TRUE)) character(0) > try(system("convert tmp/4cadu1386151240.ps tmp/4cadu1386151240.png",intern=TRUE)) character(0) > try(system("convert tmp/5em5n1386151240.ps tmp/5em5n1386151240.png",intern=TRUE)) character(0) > try(system("convert tmp/6kk9w1386151240.ps tmp/6kk9w1386151240.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.804 1.630 8.628