R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(8.27,8.25,8.22,8.21,8.12,8.16,8.15,8.1,8.09,8.02,8.03,7.98,7.95,7.92,7.96,7.96,7.94,7.83,7.77,7.8,7.78,7.78,7.8,7.81,7.95,8.02,7.99,8.01,8.03,8.05,8.05,8.06,8.07,7.99,8,8.01,8,8.09,8.1,8.12,8.29,8.32,8.36,8.38,8.48,8.45,8.41,8.38,8.38,8.34,8.41,8.34,8.22,8.27,8.18,8.19,8.19,8.13,8.06,7.99,8,7.98,7.92,7.93,7.9,7.86,7.88,7.88,7.93,7.91,7.89,7.93) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8.27 7.95 7.95 8.00 8.38 8.00 NA [2,] 8.25 7.92 8.02 8.09 8.34 7.98 NA [3,] 8.22 7.96 7.99 8.10 8.41 7.92 NA [4,] 8.21 7.96 8.01 8.12 8.34 7.93 NA [5,] 8.12 7.94 8.03 8.29 8.22 7.90 NA [6,] 8.16 7.83 8.05 8.32 8.27 7.86 NA [7,] 8.15 7.77 8.05 8.36 8.18 7.88 NA [8,] 8.10 7.80 8.06 8.38 8.19 7.88 NA [9,] 8.09 7.78 8.07 8.48 8.19 7.93 NA [10,] 8.02 7.78 7.99 8.45 8.13 7.91 NA [11,] 8.03 7.80 8.00 8.41 8.06 7.89 NA [12,] 7.98 7.81 8.01 8.38 7.99 7.93 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/15gtp1367002495.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/246x61367002495.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/3tpaz1367002495.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/4hke11367002495.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,] 7.95 7.920 7.920 7.930 7.900 7.830 7.77 7.80 7.78 7.780 7.800 7.810 [2,] 7.95 7.980 7.960 7.960 7.940 7.860 7.88 7.88 7.93 7.910 7.890 7.930 [3,] 8.00 8.055 8.045 8.065 8.075 8.105 8.10 8.08 8.08 8.005 8.015 7.985 [4,] 8.27 8.250 8.220 8.210 8.220 8.270 8.18 8.19 8.19 8.130 8.060 8.010 [5,] 8.38 8.340 8.410 8.340 8.290 8.320 8.36 8.38 8.48 8.450 8.060 8.010 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.79359 7.880841 7.877292 7.903742 7.894391 7.840537 7.90649 7.88004 [2,] 8.20641 8.229159 8.212708 8.226258 8.255609 8.369463 8.29351 8.27996 [,9] [,10] [,11] [,12] [1,] 7.912292 7.863093 7.905345 7.933397 [2,] 8.247708 8.146907 8.124655 8.036603 $out [1] 8.41 8.38 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(7.95, 7.95, 8, 8.27, 8.38, 7.92, 7.98, 8.055, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50i4r1367002495.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] [1,] 7.980 7.770 7.950 8.000 7.990 7.860 NA [2,] 8.060 7.790 7.995 8.110 8.155 7.885 NA [3,] 8.135 7.820 8.015 8.340 8.205 7.915 NA [4,] 8.215 7.945 8.050 8.395 8.340 7.930 NA [5,] 8.270 7.960 8.070 8.480 8.410 7.980 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8.064303 7.749303 7.989914 8.21001 8.12062 7.894475 NA [2,] 8.205697 7.890697 8.040086 8.46999 8.28938 7.935525 NA $out [1] 8 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(7.98, 8.06, 8.135, 8.215, 8.27, 7.77, 7.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69ms31367002495.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.1547471 0.390 0.13500 [2,] 0.1743748 0.425 0.18625 [3,] 0.1989314 0.530 0.22125 [4,] 0.2119890 0.600 0.24125 [5,] 0.2384114 0.700 0.25000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1817753 0.4501813 0.1961641 [2,] 0.2160875 0.6098187 0.2463359 $out [1] 0.3350 0.0625 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.154747105519511, 0.174374796350713, 0.198931440499755, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15gtp1367002495.ps tmp/15gtp1367002495.png",intern=TRUE)) character(0) > try(system("convert tmp/246x61367002495.ps tmp/246x61367002495.png",intern=TRUE)) character(0) > try(system("convert tmp/3tpaz1367002495.ps tmp/3tpaz1367002495.png",intern=TRUE)) character(0) > try(system("convert tmp/4hke11367002495.ps tmp/4hke11367002495.png",intern=TRUE)) character(0) > try(system("convert tmp/50i4r1367002495.ps tmp/50i4r1367002495.png",intern=TRUE)) character(0) > try(system("convert tmp/69ms31367002495.ps tmp/69ms31367002495.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.822 2.044 11.982