R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(78.25,77.24,76.68,76.29,76.1,75.77,75.6,75.57,75.89,76.04,76.89,77,79.09,80.84,81.82,82.12,81.01,82.22,81.97,82.42,82.77,82.46,83.35,84.27,87.34,91.03,93.52,94.24,94.92,95.49,96.55,98.07,102.87,104.12,103.49,103.31,103.92,103.69,103.41,102.83,103,103.42,102.57,102.72,102.22,102.32,102.48,101.56,101.02,101.41,100.74,99.76,99.76,99.17,99.11,99.69,99.4,99.79,99.72,98.74,98.26,97.31,96.73,96.18,95.92,96.13,95.64,94.52,94.31,96.05,96.17,95.14,95.37,96.5,96.79,96.23,96,95.21,94.77,96.84,99.06,100.36,100.09,100.03,100.49,101,102.11,101.59,100.81,100.86,99.57,100.21,99.68,98.38,97.93,97.37,99.08,99.15,99.44,99.48,99.62,98.95,99.42,99.84,99.27,99.16,99.04,99.62) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 78.25 79.09 87.34 103.92 101.02 98.26 95.37 100.49 99.08 NA [2,] 77.24 80.84 91.03 103.69 101.41 97.31 96.50 101.00 99.15 NA [3,] 76.68 81.82 93.52 103.41 100.74 96.73 96.79 102.11 99.44 NA [4,] 76.29 82.12 94.24 102.83 99.76 96.18 96.23 101.59 99.48 NA [5,] 76.10 81.01 94.92 103.00 99.76 95.92 96.00 100.81 99.62 NA [6,] 75.77 82.22 95.49 103.42 99.17 96.13 95.21 100.86 98.95 NA [7,] 75.60 81.97 96.55 102.57 99.11 95.64 94.77 99.57 99.42 NA [8,] 75.57 82.42 98.07 102.72 99.69 94.52 96.84 100.21 99.84 NA [9,] 75.89 82.77 102.87 102.22 99.40 94.31 99.06 99.68 99.27 NA [10,] 76.04 82.46 104.12 102.32 99.79 96.05 100.36 98.38 99.16 NA [11,] 76.89 83.35 103.49 102.48 99.72 96.17 100.09 97.93 99.04 NA [12,] 77.00 84.27 103.31 101.56 98.74 95.14 100.03 97.37 99.62 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/1vv0b1448045834.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/2zm5z1448045834.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/3oi401448045834.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/4gk3q1448045834.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,] 78.25 77.24 93.52 94.24 94.92 95.21 94.77 94.52 94.31 96.05 [2,] 87.34 91.03 93.52 94.24 94.92 95.21 94.77 94.52 94.31 96.05 [3,] 98.26 97.31 96.79 96.23 96.00 96.13 96.55 98.07 99.27 99.16 [4,] 100.49 101.00 100.74 99.76 99.76 99.17 99.42 99.84 99.68 100.36 [5,] 103.92 103.69 103.41 102.83 103.00 103.42 102.57 102.72 102.87 104.12 [,11] [,12] [1,] 96.17 95.14 [2,] 96.17 95.14 [3,] 99.04 98.74 [4,] 100.09 100.03 [5,] 103.49 103.31 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.33433 92.05913 92.98747 93.3228 93.45093 94.0444 94.101 95.26813 [2,] 105.18567 102.56087 100.59253 99.1372 98.54907 98.2156 98.999 100.87187 [,9] [,10] [,11] [,12] [1,] 96.4418 96.89007 96.97547 96.1646 [2,] 102.0982 101.42993 101.10453 101.3154 $out [1] 76.68 81.82 76.29 82.12 76.10 81.01 75.77 82.22 75.60 81.97 75.57 82.42 [13] 75.89 82.77 76.04 82.46 76.89 83.35 77.00 84.27 $group [1] 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(78.25, 87.34, 98.26, 100.49, 103.92, 77.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mrn71448045834.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] [,9] [,10] [1,] 75.570 80.840 87.34 101.560 98.740 94.310 94.770 97.370 98.950 NA [2,] 75.830 81.415 93.88 102.400 99.285 95.390 95.685 98.975 99.115 NA [3,] 76.195 82.170 96.02 102.775 99.740 96.090 96.645 100.350 99.345 NA [4,] 76.945 82.615 103.09 103.415 100.265 96.455 99.545 100.930 99.550 NA [5,] 78.250 84.270 104.12 103.920 101.410 97.310 100.360 102.110 99.840 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 75.68644 81.62267 91.81926 102.3121 99.29302 95.60425 94.88443 99.45831 [2,] 76.70356 82.71733 100.22074 103.2379 100.18698 96.57575 98.40557 101.24169 [,9] [,10] [1,] 99.14659 NA [2,] 99.54341 NA $out [1] 79.09 98.26 $group [1] 2 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(75.57, 75.83, 76.195, 76.945, 78.25, 80.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lzgp1448045834.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,] 8.782295 25.670 3.920 [2,] 9.106275 26.495 4.480 [3,] 9.245694 26.815 5.105 [4,] 9.384742 27.065 6.370 [5,] 9.677554 27.650 7.220 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.118683 26.55502 4.242958 [2,] 9.372704 27.07498 5.967042 $out [1] 28.08 13.15 9.97 $group [1] 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.78229468874736, 9.10627510554795, 9.24569386581909, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vv0b1448045834.ps tmp/1vv0b1448045834.png",intern=TRUE)) character(0) > try(system("convert tmp/2zm5z1448045834.ps tmp/2zm5z1448045834.png",intern=TRUE)) character(0) > try(system("convert tmp/3oi401448045834.ps tmp/3oi401448045834.png",intern=TRUE)) character(0) > try(system("convert tmp/4gk3q1448045834.ps tmp/4gk3q1448045834.png",intern=TRUE)) character(0) > try(system("convert tmp/5mrn71448045834.ps tmp/5mrn71448045834.png",intern=TRUE)) character(0) > try(system("convert tmp/6lzgp1448045834.ps tmp/6lzgp1448045834.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.102 0.422 2.546