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.94,1.82,1.8,1.79,1.79,1.78,1.81,1.84,1.87,1.87,1.87,1.84,1.82,1.83,1.83,1.82,1.83,1.87,1.88,1.9,1.98,2.03,2.14,2.42,2.73,2.84,2.85,2.94,3.06,3.24,3.18,3.01,2.87,2.73,2.63,2.39,2.26,2.11,2.01,1.99,1.96,1.93,1.98,2.07,2.24,2.31,2.23,2.26,2.28,2.3,2.33,2.26,2.24,2.47,2.55,2.89,3.21,3.21,2.92,2.68,2.4,2.28,2.24,2.2,2.18,2.23,2.24,2.25,2.23,2.25,2.23,2.21,2.17,2.17,2.13,2.12,2.13,2.17,2.33,2.5,2.57,2.59,2.58,2.31) > 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.94 1.82 2.73 2.26 2.28 2.40 2.17 NA [2,] 1.82 1.83 2.84 2.11 2.30 2.28 2.17 NA [3,] 1.80 1.83 2.85 2.01 2.33 2.24 2.13 NA [4,] 1.79 1.82 2.94 1.99 2.26 2.20 2.12 NA [5,] 1.79 1.83 3.06 1.96 2.24 2.18 2.13 NA [6,] 1.78 1.87 3.24 1.93 2.47 2.23 2.17 NA [7,] 1.81 1.88 3.18 1.98 2.55 2.24 2.33 NA [8,] 1.84 1.90 3.01 2.07 2.89 2.25 2.50 NA [9,] 1.87 1.98 2.87 2.24 3.21 2.23 2.57 NA [10,] 1.87 2.03 2.73 2.31 3.21 2.25 2.59 NA [11,] 1.87 2.14 2.63 2.23 2.92 2.23 2.58 NA [12,] 1.84 2.42 2.39 2.26 2.68 2.21 2.31 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/1fyhz1386191116.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/2217r1386191116.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/32lje1386191116.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/4gnii1386191116.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.820 1.82 1.800 1.790 1.790 1.78 1.81 1.840 1.870 1.87 1.870 2.210 [2,] 2.055 1.97 1.920 1.905 1.895 1.90 1.93 1.985 2.105 2.14 2.185 2.235 [3,] 2.260 2.17 2.130 2.120 2.130 2.17 2.24 2.250 2.240 2.31 2.230 2.310 [4,] 2.340 2.29 2.285 2.230 2.210 2.35 2.44 2.695 2.720 2.66 2.605 2.405 [5,] 2.730 2.30 2.330 2.260 2.240 2.47 3.18 3.010 3.210 3.21 2.920 2.420 $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.089803 1.978901 1.912028 1.925915 1.941887 1.901267 1.935436 1.825999 [2,] 2.430197 2.361099 2.347972 2.314085 2.318113 2.438733 2.544564 2.674001 [,9] [,10] [,11] [,12] [1,] 1.872732 1.999464 1.979183 2.208479 [2,] 2.607268 2.620536 2.480817 2.411521 $out [1] 2.84 2.85 2.94 3.06 3.24 1.84 2.68 $group [1] 2 3 4 5 6 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.82, 2.055, 2.26, 2.34, 2.73, 1.82, 1.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vhnh1386191116.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.780 1.820 2.390 1.930 2.240 2.180 2.120 NA [2,] 1.795 1.830 2.730 1.985 2.290 2.220 2.150 NA [3,] 1.830 1.875 2.860 2.090 2.510 2.235 2.240 NA [4,] 1.870 2.005 3.035 2.250 2.905 2.250 2.535 NA [5,] 1.940 2.140 3.240 2.310 3.210 2.280 2.590 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.795792 1.795181 2.720887 1.969132 2.229494 2.221317 2.064399 NA [2,] 1.864208 1.954819 2.999113 2.210868 2.790506 2.248683 2.415601 NA $out [1] 2.42 2.40 $group [1] 2 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.78, 1.795, 1.83, 1.87, 1.94, 1.82, 1.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6znar1386191116.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.2543900 0.840 0.1700 [2,] 0.3502323 1.035 0.3175 [3,] 0.4083312 1.160 0.3925 [4,] 0.4706612 1.340 0.5150 [5,] 0.5004141 1.460 0.7100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.3534027 1.020887 0.3024189 [2,] 0.4632596 1.299113 0.4825811 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.254390026758687, 0.350232321105321, 0.408331158514968, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fyhz1386191116.ps tmp/1fyhz1386191116.png",intern=TRUE)) character(0) > try(system("convert tmp/2217r1386191116.ps tmp/2217r1386191116.png",intern=TRUE)) character(0) > try(system("convert tmp/32lje1386191116.ps tmp/32lje1386191116.png",intern=TRUE)) character(0) > try(system("convert tmp/4gnii1386191116.ps tmp/4gnii1386191116.png",intern=TRUE)) character(0) > try(system("convert tmp/5vhnh1386191116.ps tmp/5vhnh1386191116.png",intern=TRUE)) character(0) > try(system("convert tmp/6znar1386191116.ps tmp/6znar1386191116.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.710 1.415 7.102