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.46,78.59,81.37,83.61,84.65,84.56,83.85,84.08,85.41,85.75,86.38,88.87,90.37,92.21,95.75,97.29,98.29,99.51,99.04,98.9,100.74,100.3,101.68,101.3,103.13,104.17,105.98,106.25,104.01,101.68,101.93,104.41,105.51,104.71,103.14,102.66,102.68,101.89,101.37,101.16,99.34,99.35,99.88,99.31,99.91,98.39,98.02,98.7,98.01,98.42,98.2,93.5,93.17,93.42,93.13,92.31,92.09,92.62,91.43,89.38) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 78.46 90.37 103.13 102.68 98.01 NA [2,] 78.59 92.21 104.17 101.89 98.42 NA [3,] 81.37 95.75 105.98 101.37 98.20 NA [4,] 83.61 97.29 106.25 101.16 93.50 NA [5,] 84.65 98.29 104.01 99.34 93.17 NA [6,] 84.56 99.51 101.68 99.35 93.42 NA [7,] 83.85 99.04 101.93 99.88 93.13 NA [8,] 84.08 98.90 104.41 99.31 92.31 NA [9,] 85.41 100.74 105.51 99.91 92.09 NA [10,] 85.75 100.30 104.71 98.39 92.62 NA [11,] 86.38 101.68 103.14 98.02 91.43 NA [12,] 88.87 101.30 102.66 98.70 89.38 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/1vzb91447946260.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/2espo1447946260.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/34gim1447946260.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/4jitu1447946260.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.46 78.59 95.75 83.61 84.65 84.56 83.85 84.08 85.41 85.75 [2,] 90.37 92.21 95.75 93.50 93.17 93.42 93.13 92.31 92.09 92.62 [3,] 98.01 98.42 98.20 97.29 98.29 99.35 99.04 98.90 99.91 98.39 [4,] 102.68 101.89 101.37 101.16 99.34 99.51 99.88 99.31 100.74 100.30 [5,] 103.13 104.17 105.98 106.25 104.01 101.68 101.93 104.41 105.51 104.71 [,11] [,12] [1,] 86.38 88.87 [2,] 91.43 89.38 [3,] 98.02 98.70 [4,] 101.68 101.30 [5,] 103.14 102.66 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.31179 91.58014 94.22892 91.87746 93.93029 95.04682 94.27047 [2,] 106.70821 105.25986 102.17108 102.70254 102.64971 103.65318 103.80953 [,8] [,9] [,10] [,11] [,12] [1,] 93.95382 93.79793 92.96333 90.77738 90.27736 [2,] 103.84618 106.02207 103.81667 105.26262 107.12264 $out [1] 81.37 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(78.46, 90.37, 98.01, 102.68, 103.13, 78.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b4mz1447946260.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] [1,] 78.46 92.21 101.680 98.020 89.380 NA [2,] 82.49 96.52 102.895 99.005 92.200 NA [3,] 84.32 98.97 104.090 99.615 93.150 NA [4,] 85.58 100.52 105.110 101.265 95.755 NA [5,] 88.87 101.68 106.250 102.680 98.420 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 82.91063 97.14557 103.0797 98.5842 91.52854 NA [2,] 85.72937 100.79443 105.1003 100.6458 94.77146 NA $out [1] 90.37 $group [1] 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(78.46, 82.49, 84.32, 85.58, 88.87, 92.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xze81447946260.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,] 6.599835 13.790 5.620 [2,] 7.201844 17.600 6.460 [3,] 7.603467 19.730 7.670 [4,] 8.925298 23.625 9.965 [5,] 10.344605 25.580 12.310 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.817388 16.98196 6.071346 [2,] 8.389545 22.47804 9.268654 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.59983484641851, 7.20184393377629, 7.60346658272277, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vzb91447946260.ps tmp/1vzb91447946260.png",intern=TRUE)) character(0) > try(system("convert tmp/2espo1447946260.ps tmp/2espo1447946260.png",intern=TRUE)) character(0) > try(system("convert tmp/34gim1447946260.ps tmp/34gim1447946260.png",intern=TRUE)) character(0) > try(system("convert tmp/4jitu1447946260.ps tmp/4jitu1447946260.png",intern=TRUE)) character(0) > try(system("convert tmp/5b4mz1447946260.ps tmp/5b4mz1447946260.png",intern=TRUE)) character(0) > try(system("convert tmp/6xze81447946260.ps tmp/6xze81447946260.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.152 0.396 2.569