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(20709.9,21227.3,23009.8,20416.2,20929.6,20763.9,19607.4,19419,19584.9,21878,21745.5,19206.8,21041.3,20407.1,22437,21050.3,20415.7,20220.6,20217.8,18286.4,20781.3,21619.6,20417.6,19988.6,21026.9,20128.3,21671.5,21053.2,19978.6,20572.6,20220.4,19107.6,21989.5,21701.2,19758.3,19843.9,18906.2,19071.2,22385.6,20208.5,19261.4,21470.1,19539.9,17665.1,19917.2,20399.5,19263,19026,18375.4,20165,21138.7,21414.3,20799.2,22773.6,19747.2,19910.7,22051.7,21705,22328.8,20910.3) > 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,] 20709.9 21041.3 21026.9 18906.2 18375.4 NA [2,] 21227.3 20407.1 20128.3 19071.2 20165.0 NA [3,] 23009.8 22437.0 21671.5 22385.6 21138.7 NA [4,] 20416.2 21050.3 21053.2 20208.5 21414.3 NA [5,] 20929.6 20415.7 19978.6 19261.4 20799.2 NA [6,] 20763.9 20220.6 20572.6 21470.1 22773.6 NA [7,] 19607.4 20217.8 20220.4 19539.9 19747.2 NA [8,] 19419.0 18286.4 19107.6 17665.1 19910.7 NA [9,] 19584.9 20781.3 21989.5 19917.2 22051.7 NA [10,] 21878.0 21619.6 21701.2 20399.5 21705.0 NA [11,] 21745.5 20417.6 19758.3 19263.0 22328.8 NA [12,] 19206.8 19988.6 19843.9 19026.0 20910.3 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/13p551495108182.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/2hwzx1495108182.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/3mng61495108182.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/4nkf81495108182.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] [1,] 18375.4 20128.3 21138.7 20208.5 19261.4 20220.6 19539.9 17665.1 19584.9 [2,] 18906.2 20128.3 21671.5 20416.2 19978.6 20572.6 19607.4 18286.4 19917.2 [3,] 20709.9 20165.0 22385.6 21050.3 20415.7 20763.9 19747.2 19107.6 20781.3 [4,] 21026.9 20407.1 22437.0 21053.2 20799.2 21470.1 20217.8 19419.0 21989.5 [5,] 21041.3 20407.1 23009.8 21414.3 20929.6 22773.6 20220.4 19910.7 22051.7 [,10] [,11] [,12] [1,] 21619.6 19263.0 19026.0 [2,] 21619.6 19758.3 19206.8 [3,] 21701.2 20417.6 19843.9 [4,] 21705.0 21745.5 19988.6 [5,] 21705.0 22328.8 20910.3 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 19211.42 19968 21844.7 20600.2 19835.87 20129.73 19315.89 18307.31 [2,] 22208.38 20362 22926.5 21500.4 20995.53 21398.07 20178.51 19907.89 [,9] [,10] [,11] [,12] [1,] 19317.02 21640.86 19013.45 19291.48 [2,] 22245.58 21761.54 21821.75 20396.32 $out [1] 21227.3 19071.2 21878.0 20399.5 $group [1] 2 2 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(18375.4, 18906.2, 20709.9, 21026.9, 21041.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/591k81495108182.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,] 19206.80 19988.60 19107.60 17665.10 18375.40 NA [2,] 19596.15 20219.20 19911.25 19048.60 20037.85 NA [3,] 20736.90 20416.65 20396.50 19401.45 21024.50 NA [4,] 21486.40 21045.80 21362.35 20304.00 21878.35 NA [5,] 23009.80 21619.60 21989.50 21470.10 22773.60 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 19874.74 20039.63 19734.64 18828.85 20185.04 NA [2,] 21599.06 20793.67 21058.36 19974.05 21863.96 NA $out [1] 22437.0 18286.4 22385.6 $group [1] 2 2 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(19206.8, 19596.15, 20736.9, 21486.4, 23009.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rapk1495108182.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,] 330.4125 680.50 85.4 [2,] 639.2783 1573.35 623.7 [3,] 758.1676 2020.20 801.2 [4,] 1076.2444 2509.90 1559.9 [5,] 1301.6857 3065.80 2120.7 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 558.8645 1593.033 374.1929 [2,] 957.4708 2447.367 1228.2071 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(330.41252700223, 639.27833175372, 758.167648412991, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13p551495108182.ps tmp/13p551495108182.png",intern=TRUE)) character(0) > try(system("convert tmp/2hwzx1495108182.ps tmp/2hwzx1495108182.png",intern=TRUE)) character(0) > try(system("convert tmp/3mng61495108182.ps tmp/3mng61495108182.png",intern=TRUE)) character(0) > try(system("convert tmp/4nkf81495108182.ps tmp/4nkf81495108182.png",intern=TRUE)) character(0) > try(system("convert tmp/591k81495108182.ps tmp/591k81495108182.png",intern=TRUE)) character(0) > try(system("convert tmp/6rapk1495108182.ps tmp/6rapk1495108182.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.849 0.409 3.311