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(79.57,77.45,75.79,74.88,74.5,74.59,74.59,73.57,73.3,73.23,73,72.31,72.31,71.24,70.82,70.66,69.94,69.87,69.87,68.88,68.09,68.38,66.78,67.2,67.2,66.67,65.86,66.05,66.31,66.39,66.39,65.72,65.52,64.93,65.27,65.04,65.02,64.72,64.68,64.41,64.79,64.71,64.71,64.83,64.77,64.19,64.27,64.23,64.23,63.03,62.85,62.15,61.69,62.1,62.1,61.81,61.28,61.05,61.08,60.98,60.98,61.11,60.58,60.37,59.44,59.29,59.29,59.33,59.06,58.75,58.92,58.73,58.73,58.46,58.18,58.02,56.97,57.22,57.19,57.06,57.08,56.59,56.91,56.54) > 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,] 79.57 72.31 67.20 65.02 64.23 60.98 58.73 NA [2,] 77.45 71.24 66.67 64.72 63.03 61.11 58.46 NA [3,] 75.79 70.82 65.86 64.68 62.85 60.58 58.18 NA [4,] 74.88 70.66 66.05 64.41 62.15 60.37 58.02 NA [5,] 74.50 69.94 66.31 64.79 61.69 59.44 56.97 NA [6,] 74.59 69.87 66.39 64.71 62.10 59.29 57.22 NA [7,] 74.59 69.87 66.39 64.71 62.10 59.29 57.19 NA [8,] 73.57 68.88 65.72 64.83 61.81 59.33 57.06 NA [9,] 73.30 68.09 65.52 64.77 61.28 59.06 57.08 NA [10,] 73.23 68.38 64.93 64.19 61.05 58.75 56.59 NA [11,] 73.00 66.78 65.27 64.27 61.08 58.92 56.91 NA [12,] 72.31 67.20 65.04 64.23 60.98 58.73 56.54 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/1lsyp1386235587.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/2at5a1386235587.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/39iu51386235588.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/4mt961386235588.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] [1,] 58.730 58.460 58.180 58.020 56.970 57.220 57.190 57.06 57.080 56.590 [2,] 62.605 62.070 61.715 61.260 60.565 60.695 60.695 60.57 60.170 59.900 [3,] 65.020 64.720 64.680 64.410 64.790 64.710 64.710 64.83 64.770 64.190 [4,] 69.755 68.955 68.340 68.355 68.125 68.130 68.130 67.30 66.805 66.655 [5,] 79.570 77.450 75.790 74.880 74.500 74.590 74.590 73.57 73.300 73.230 [,11] [,12] [1,] 56.910 56.540 [2,] 60.000 59.855 [3,] 64.270 64.230 [4,] 66.025 66.120 [5,] 73.000 72.310 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 60.75014 60.60839 60.72366 60.17298 60.27529 60.26994 60.26994 60.81095 [2,] 69.28986 68.83161 68.63634 68.64702 69.30471 69.15006 69.15006 68.84905 [,9] [,10] [,11] [,12] [1,] 60.80769 60.15602 60.67197 60.48864 [2,] 68.73231 68.22398 67.86803 67.97136 $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(58.73, 62.605, 65.02, 69.755, 79.57, 58.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b7vo1386235588.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,] 72.310 66.780 64.930 64.19 60.980 58.730 56.540 NA [2,] 73.265 68.235 65.395 64.34 61.180 58.990 56.940 NA [3,] 74.545 69.870 65.955 64.71 61.955 59.310 57.135 NA [4,] 75.335 70.740 66.390 64.78 62.500 60.475 58.100 NA [5,] 77.450 72.310 67.200 65.02 64.230 61.110 58.730 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.60086 68.72745 65.50117 64.50931 61.35294 58.63268 56.60592 NA [2,] 75.48914 71.01255 66.40883 64.91069 62.55706 59.98732 57.66408 NA $out [1] 79.57 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(72.31, 73.265, 74.545, 75.335, 77.45, 66.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62ye11386235588.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,] 5.349694 15.770 6.0250 [2,] 5.612185 16.365 6.6300 [3,] 5.973046 17.115 6.8200 [4,] 6.071011 17.570 7.2925 [5,] 6.457114 18.990 7.5600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.763772 16.56539 6.517829 [2,] 6.182319 17.66461 7.122171 $out [1] 7.098544 20.840000 $group [1] 1 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.3496942502753, 5.61218508190834, 5.97304552876625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lsyp1386235587.ps tmp/1lsyp1386235587.png",intern=TRUE)) character(0) > try(system("convert tmp/2at5a1386235587.ps tmp/2at5a1386235587.png",intern=TRUE)) character(0) > try(system("convert tmp/39iu51386235588.ps tmp/39iu51386235588.png",intern=TRUE)) character(0) > try(system("convert tmp/4mt961386235588.ps tmp/4mt961386235588.png",intern=TRUE)) character(0) > try(system("convert tmp/5b7vo1386235588.ps tmp/5b7vo1386235588.png",intern=TRUE)) character(0) > try(system("convert tmp/62ye11386235588.ps tmp/62ye11386235588.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.191 1.342 7.535