R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(97.78,97.73,97.61,97.69,97.68,97.67,97.67,97.96,98.27,99.52,99.59,99.75,99.75,99.8,99.99,100.25,100.08,100.08,100.08,100.06,101,101.81,101.82,101.96,101.96,101.93,102.03,102.11,102.07,102.34,102.34,102.33,102.77,103.08,103.38,103.44,99.1,99.15,99.21,99.01,99.08,99.11,100.11,100.31,100.55,101.38,101.49,101.5,100.69,100.8,100.58,100.34,100.38,100.33,101.06,101.15,101.36,101.98,102.24,102.34,101.91,101.8,101.8,101.73,101.8,101.81,102.28,101.7,101.7,102.37,102.43,102.41) > 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,] 97.78 99.75 101.96 99.10 100.69 101.91 NA [2,] 97.73 99.80 101.93 99.15 100.80 101.80 NA [3,] 97.61 99.99 102.03 99.21 100.58 101.80 NA [4,] 97.69 100.25 102.11 99.01 100.34 101.73 NA [5,] 97.68 100.08 102.07 99.08 100.38 101.80 NA [6,] 97.67 100.08 102.34 99.11 100.33 101.81 NA [7,] 97.67 100.08 102.34 100.11 101.06 102.28 NA [8,] 97.96 100.06 102.33 100.31 101.15 101.70 NA [9,] 98.27 101.00 102.77 100.55 101.36 101.70 NA [10,] 99.52 101.81 103.08 101.38 101.98 102.37 NA [11,] 99.59 101.82 103.38 101.49 102.24 102.43 NA [12,] 99.75 101.96 103.44 101.50 102.34 102.41 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/1ashj1493022660.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/29vw71493022660.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/3vtyi1493022660.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/457ff1493022660.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,] 97.78 97.73 97.610 97.690 97.68 97.670 97.670 97.96 100.55 101.380 [2,] 99.10 99.15 99.210 99.010 99.08 99.110 100.080 100.06 100.55 101.380 [3,] 100.22 100.30 100.285 100.295 100.23 100.205 100.585 100.73 101.18 101.895 [4,] 101.91 101.80 101.800 101.730 101.80 101.810 102.280 101.70 101.70 102.370 [5,] 101.96 101.93 102.030 102.110 102.07 102.340 102.340 102.33 102.77 103.080 [,11] [,12] [1,] 101.49 101.50 [2,] 101.49 101.50 [3,] 102.03 102.15 [4,] 102.43 102.41 [5,] 103.38 103.44 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.40746 98.59066 98.61437 98.54051 98.47551 98.46341 99.16593 [2,] 102.03254 102.00934 101.95563 102.04949 101.98449 101.94659 102.00407 [,8] [,9] [,10] [,11] [,12] [1,] 99.67215 100.4382 101.2564 101.4237 101.563 [2,] 101.78785 101.9218 102.5336 102.6363 102.737 $out [1] 98.27 99.52 99.59 99.75 $group [1] 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(97.78, 99.1, 100.22, 101.91, 101.96, 97.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wda81493022660.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,] 97.610 99.750 101.930 99.010 100.33 101.700 NA [2,] 97.675 100.025 102.050 99.105 100.48 101.765 NA [3,] 97.755 100.080 102.335 99.660 100.93 101.805 NA [4,] 98.895 101.405 102.925 100.965 101.67 102.325 NA [5,] 99.750 101.960 103.440 101.500 102.34 102.430 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.19855 99.45057 101.9359 98.81164 100.3872 101.5496 NA [2,] 98.31145 100.70943 102.7341 100.50836 101.4728 102.0604 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(97.61, 97.675, 97.755, 98.895, 99.75, 99.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dgke1493022660.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,] 1.208139 3.560 0.77750 [2,] 1.389539 3.985 0.88125 [3,] 1.637265 4.380 1.97500 [4,] 1.658674 4.460 2.10250 [5,] 1.741057 4.670 2.34250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.514511 4.163349 1.41798 [2,] 1.760019 4.596651 2.53202 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.20813906484312, 1.38953933320222, 1.63726488646771, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ashj1493022660.ps tmp/1ashj1493022660.png",intern=TRUE)) character(0) > try(system("convert tmp/29vw71493022660.ps tmp/29vw71493022660.png",intern=TRUE)) character(0) > try(system("convert tmp/3vtyi1493022660.ps tmp/3vtyi1493022660.png",intern=TRUE)) character(0) > try(system("convert tmp/457ff1493022660.ps tmp/457ff1493022660.png",intern=TRUE)) character(0) > try(system("convert tmp/5wda81493022660.ps tmp/5wda81493022660.png",intern=TRUE)) character(0) > try(system("convert tmp/6dgke1493022660.ps tmp/6dgke1493022660.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.462 0.355 4.069