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(4.69,4.69,4.69,4.69,4.69,4.69,4.69,4.73,4.78,4.79,4.79,4.8,4.8,4.81,5.16,5.26,5.29,5.29,5.29,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.35,5.44,5.47,5.47,5.48,5.48,5.48,5.48,5.48,5.48,5.48,5.5,5.55,5.57,5.58,5.58,5.58,5.59,5.59,5.59,5.55,5.61,5.61,5.61,5.63,5.69,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.71,5.74,5.77,5.79,5.79,5.8,5.8,5.8,5.8,5.8,5.81,5.81,5.83,5.94,5.98,5.99,6,6.02,6.02,6.02,6.02) > 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,] 4.69 4.80 5.30 5.48 5.61 5.70 5.80 NA [2,] 4.69 4.81 5.30 5.48 5.61 5.70 5.81 NA [3,] 4.69 5.16 5.30 5.50 5.61 5.70 5.81 NA [4,] 4.69 5.26 5.35 5.55 5.63 5.71 5.83 NA [5,] 4.69 5.29 5.44 5.57 5.69 5.74 5.94 NA [6,] 4.69 5.29 5.47 5.58 5.70 5.77 5.98 NA [7,] 4.69 5.29 5.47 5.58 5.70 5.79 5.99 NA [8,] 4.73 5.30 5.48 5.58 5.70 5.79 6.00 NA [9,] 4.78 5.30 5.48 5.59 5.70 5.80 6.02 NA [10,] 4.79 5.30 5.48 5.59 5.70 5.80 6.02 NA [11,] 4.79 5.30 5.48 5.59 5.70 5.80 6.02 NA [12,] 4.80 5.30 5.48 5.55 5.70 5.80 6.02 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/1o7jh1385576976.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/2mhma1385576976.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/35n4u1385576976.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/4qaa91385576976.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,] 4.690 4.690 4.690 5.260 5.290 5.290 5.290 5.300 5.30 5.30 5.30 5.30 [2,] 5.050 5.055 5.230 5.305 5.365 5.380 5.380 5.390 5.39 5.39 5.39 5.39 [3,] 5.480 5.480 5.500 5.550 5.570 5.580 5.580 5.580 5.59 5.59 5.59 5.55 [4,] 5.655 5.655 5.655 5.670 5.715 5.735 5.745 5.745 5.75 5.75 5.75 5.75 [5,] 5.800 5.810 5.810 5.830 5.940 5.980 5.990 6.000 6.02 6.02 6.02 6.02 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5.118704 5.12169 5.246197 5.332028 5.360986 5.368 5.362028 5.368 5.375014 [2,] 5.841296 5.83831 5.753803 5.767972 5.779014 5.792 5.797972 5.792 5.804986 [,10] [,11] [,12] [1,] 5.375014 5.375014 5.335014 [2,] 5.804986 5.804986 5.764986 $out [1] 4.69 4.69 4.69 4.69 4.73 4.78 4.79 4.79 4.80 $group [1] 4 5 6 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(4.69, 5.05, 5.48, 5.655, 5.8, 4.69, 5.055, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dy4x1385576976.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,] 4.690 5.16 5.300 5.480 5.61 5.700 5.800 NA [2,] 4.690 5.21 5.325 5.525 5.62 5.705 5.820 NA [3,] 4.690 5.29 5.470 5.575 5.70 5.780 5.985 NA [4,] 4.785 5.30 5.480 5.585 5.70 5.800 6.020 NA [5,] 4.800 5.30 5.480 5.590 5.70 5.800 6.020 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4.64667 5.24895 5.399303 5.547634 5.663511 5.73667 5.893779 NA [2,] 4.73333 5.33105 5.540697 5.602366 5.736489 5.82333 6.076221 NA $out [1] 4.80 4.81 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(4.69, 4.69, 4.69, 4.785, 4.8, 5.16, 5.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6b4ta1385576976.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.3820309 1.11 0.3500 [2,] 0.3956443 1.13 0.3575 [3,] 0.4037590 1.23 0.3600 [4,] 0.4205529 1.26 0.3950 [5,] 0.4376833 1.30 0.4250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.392398 1.170706 0.342896 [2,] 0.415120 1.289294 0.377104 $out [1] 0.605 0.600 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.382030913732932, 0.395644267992091, 0.403759024025002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o7jh1385576976.ps tmp/1o7jh1385576976.png",intern=TRUE)) character(0) > try(system("convert tmp/2mhma1385576976.ps tmp/2mhma1385576976.png",intern=TRUE)) character(0) > try(system("convert tmp/35n4u1385576976.ps tmp/35n4u1385576976.png",intern=TRUE)) character(0) > try(system("convert tmp/4qaa91385576976.ps tmp/4qaa91385576976.png",intern=TRUE)) character(0) > try(system("convert tmp/5dy4x1385576976.ps tmp/5dy4x1385576976.png",intern=TRUE)) character(0) > try(system("convert tmp/6b4ta1385576976.ps tmp/6b4ta1385576976.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.077 0.895 4.947