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(15.13,15.25,15.33,15.36,15.40,15.40,15.41,15.47,15.54,15.55,15.59,15.65,15.75,15.86,15.89,15.94,15.93,15.95,15.99,15.99,16.06,16.08,16.07,16.11,16.15,16.18,16.30,16.42,16.49,16.50,16.58,16.64,16.66,16.81,16.91,16.92,16.95,17.11,17.16,17.16,17.27,17.34,17.39,17.43,17.45,17.50,17.56,17.65,17.62,17.70,17.72,17.71,17.74,17.75,17.78,17.80,17.86,17.88,17.89,17.94,17.98,18.10,18.14,18.19,18.23,18.24,18.27,18.30,18.34,18.36,18.36,18.40,18.43,18.47,18.56,18.58,18.61,18.61,18.69,18.74,18.75,18.81,18.85,18.88) > 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,] 15.13 15.75 16.15 16.95 17.62 17.98 18.43 NA [2,] 15.25 15.86 16.18 17.11 17.70 18.10 18.47 NA [3,] 15.33 15.89 16.30 17.16 17.72 18.14 18.56 NA [4,] 15.36 15.94 16.42 17.16 17.71 18.19 18.58 NA [5,] 15.40 15.93 16.49 17.27 17.74 18.23 18.61 NA [6,] 15.40 15.95 16.50 17.34 17.75 18.24 18.61 NA [7,] 15.41 15.99 16.58 17.39 17.78 18.27 18.69 NA [8,] 15.47 15.99 16.64 17.43 17.80 18.30 18.74 NA [9,] 15.54 16.06 16.66 17.45 17.86 18.34 18.75 NA [10,] 15.55 16.08 16.81 17.50 17.88 18.36 18.81 NA [11,] 15.59 16.07 16.91 17.56 17.89 18.36 18.85 NA [12,] 15.65 16.11 16.92 17.65 17.94 18.40 18.88 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/1iygb1386535573.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/2l1w71386535573.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/3av5x1386535573.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/44l8h1386535573.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,] 15.13 15.25 15.330 15.36 15.400 15.400 15.410 15.470 15.54 15.550 15.590 [2,] 15.95 16.02 16.095 16.18 16.210 16.225 16.285 16.315 16.36 16.445 16.490 [3,] 16.95 17.11 17.160 17.16 17.270 17.340 17.390 17.430 17.45 17.500 17.560 [4,] 17.80 17.90 17.930 17.95 17.985 17.995 18.025 18.050 18.10 18.120 18.125 [5,] 18.43 18.47 18.560 18.58 18.610 18.610 18.690 18.740 18.75 18.810 18.850 [,12] [1,] 15.650 [2,] 16.515 [3,] 17.650 [4,] 18.170 [5,] 18.880 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.84521 15.98729 16.06417 16.10298 16.21 16.28298 16.3509 16.39389 [2,] 18.05479 18.23271 18.25583 18.21702 18.33 18.39702 18.4291 18.46611 [,9] [,10] [,11] [,12] [1,] 16.4109 16.49972 16.5836 16.66166 [2,] 18.4891 18.50028 18.5364 18.63834 $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(15.13, 15.95, 16.95, 17.8, 18.43, 15.25, 16.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53pdy1386535573.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,] 15.130 15.750 16.150 16.950 17.620 17.980 18.43 NA [2,] 15.345 15.910 16.360 17.160 17.715 18.165 18.57 NA [3,] 15.405 15.970 16.540 17.365 17.765 18.255 18.65 NA [4,] 15.545 16.065 16.735 17.475 17.870 18.350 18.78 NA [5,] 15.650 16.110 16.920 17.650 17.940 18.400 18.88 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.31378 15.8993 16.36896 17.22133 17.6943 18.17062 18.55422 NA [2,] 15.49622 16.0407 16.71104 17.50867 17.8357 18.33938 18.74578 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(15.13, 15.345, 15.405, 15.545, 15.65, 15.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6h5fe1386535573.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,] 1.189718 3.210 1.635 [2,] 1.193967 3.215 1.705 [3,] 1.199219 3.230 1.755 [4,] 1.209850 3.265 1.805 [5,] 1.227062 3.300 1.880 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.191975 3.207195 1.709389 [2,] 1.206463 3.252805 1.800611 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.18971785370674, 1.19396745119238, 1.19921898041698, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1iygb1386535573.ps tmp/1iygb1386535573.png",intern=TRUE)) character(0) > try(system("convert tmp/2l1w71386535573.ps tmp/2l1w71386535573.png",intern=TRUE)) character(0) > try(system("convert tmp/3av5x1386535573.ps tmp/3av5x1386535573.png",intern=TRUE)) character(0) > try(system("convert tmp/44l8h1386535573.ps tmp/44l8h1386535573.png",intern=TRUE)) character(0) > try(system("convert tmp/53pdy1386535573.ps tmp/53pdy1386535573.png",intern=TRUE)) character(0) > try(system("convert tmp/6h5fe1386535573.ps tmp/6h5fe1386535573.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.730 1.173 6.862