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(6.11,6.13,6.15,6.15,6.16,6.18,6.21,6.22,6.23,6.26,6.28,6.28,6.29,6.32,6.36,6.37,6.38,6.38,6.4,6.41,6.42,6.43,6.44,6.47,6.47,6.48,6.51,6.54,6.56,6.57,6.6,6.62,6.65,6.71,6.76,6.78,6.8,6.83,6.86,6.86,6.87,6.88,6.9,6.92,6.93,6.94,6.96,6.98,6.99,7.01,7.06,7.07,7.08,7.08,7.1,7.11,7.22,7.24,7.25,7.26,7.27,7.3,7.32,7.34,7.35,7.36,7.39,7.41,7.43,7.46,7.47,7.5,7.51,7.52,7.58,7.59,7.63,7.64,7.64,7.66,7.67,7.68,7.69,7.7) > 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,] 6.11 6.29 6.47 6.80 6.99 7.27 7.51 NA [2,] 6.13 6.32 6.48 6.83 7.01 7.30 7.52 NA [3,] 6.15 6.36 6.51 6.86 7.06 7.32 7.58 NA [4,] 6.15 6.37 6.54 6.86 7.07 7.34 7.59 NA [5,] 6.16 6.38 6.56 6.87 7.08 7.35 7.63 NA [6,] 6.18 6.38 6.57 6.88 7.08 7.36 7.64 NA [7,] 6.21 6.40 6.60 6.90 7.10 7.39 7.64 NA [8,] 6.22 6.41 6.62 6.92 7.11 7.41 7.66 NA [9,] 6.23 6.42 6.65 6.93 7.22 7.43 7.67 NA [10,] 6.26 6.43 6.71 6.94 7.24 7.46 7.68 NA [11,] 6.28 6.44 6.76 6.96 7.25 7.47 7.69 NA [12,] 6.28 6.47 6.78 6.98 7.26 7.50 7.70 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/1sg0w1386263900.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/2qnse1386263900.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/3rwje1386263900.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/4a7l41386263900.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,] 6.11 6.130 6.150 6.150 6.160 6.180 6.210 6.220 6.230 6.26 6.28 6.280 [2,] 6.38 6.400 6.435 6.455 6.470 6.475 6.500 6.515 6.535 6.57 6.60 6.625 [3,] 6.80 6.830 6.860 6.860 6.870 6.880 6.900 6.920 6.930 6.94 6.96 6.980 [4,] 7.13 7.155 7.190 7.205 7.215 7.220 7.245 7.260 7.325 7.35 7.36 7.380 [5,] 7.51 7.520 7.580 7.590 7.630 7.640 7.640 7.660 7.670 7.68 7.69 7.700 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6.352112 6.379126 6.409126 6.412112 6.425098 6.435098 6.455098 6.475098 [2,] 7.247888 7.280874 7.310874 7.307888 7.314902 7.324902 7.344902 7.364902 [,9] [,10] [,11] [,12] [1,] 6.458225 6.474197 6.50614 6.529126 [2,] 7.401775 7.405803 7.41386 7.430874 $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(6.11, 6.38, 6.8, 7.13, 7.51, 6.13, 6.4, 6.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/52agr1386263900.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,] 6.110 6.290 6.470 6.800 6.990 7.270 7.510 NA [2,] 6.150 6.365 6.525 6.860 7.065 7.330 7.585 NA [3,] 6.195 6.390 6.585 6.890 7.090 7.375 7.640 NA [4,] 6.245 6.425 6.680 6.935 7.230 7.445 7.675 NA [5,] 6.280 6.470 6.780 6.980 7.260 7.500 7.700 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6.15167 6.362634 6.514303 6.855792 7.014742 7.322548 7.59895 NA [2,] 6.23833 6.417366 6.655697 6.924208 7.165258 7.427452 7.68105 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(6.11, 6.15, 6.195, 6.245, 6.28, 6.29, 6.365, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6vavd1386263900.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.5156041 1.390 0.7450 [2,] 0.5232317 1.415 0.7450 [3,] 0.5250510 1.430 0.7525 [4,] 0.5294651 1.440 0.7575 [5,] 0.5338495 1.470 0.7600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5222079 1.418597 0.7467987 [2,] 0.5278941 1.441403 0.7582013 $out [1] 0.79 0.78 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.515604130169279, 0.523231705478102, 0.525050963955151, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1sg0w1386263900.ps tmp/1sg0w1386263900.png",intern=TRUE)) character(0) > try(system("convert tmp/2qnse1386263900.ps tmp/2qnse1386263900.png",intern=TRUE)) character(0) > try(system("convert tmp/3rwje1386263900.ps tmp/3rwje1386263900.png",intern=TRUE)) character(0) > try(system("convert tmp/4a7l41386263900.ps tmp/4a7l41386263900.png",intern=TRUE)) character(0) > try(system("convert tmp/52agr1386263900.ps tmp/52agr1386263900.png",intern=TRUE)) character(0) > try(system("convert tmp/6vavd1386263900.ps tmp/6vavd1386263900.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.835 1.244 6.062