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(8899,8899,9093,9093,9093,9116,9116,9116,10073,10073,10073,9223,9223,9223,9151,9151,9151,6727,6727,6727,7232,7232,7232,6370,6370,6370,6862,6862,6862,7029,7029,7029,7031,7031,7031,7223,7223,7223,8065,8065,8065,7657,7657,7657,7328,7328,7328,7115,7115,7115,7926,7926,7926,8681,8681,8681,8670,8670,8670,8028,8028) > 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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 8899 9223 6370 7223 7115 8028 [2,] 8899 9223 6370 7223 7115 NA [3,] 9093 9151 6862 8065 7926 NA [4,] 9093 9151 6862 8065 7926 NA [5,] 9093 9151 6862 8065 7926 NA [6,] 9116 6727 7029 7657 8681 NA [7,] 9116 6727 7029 7657 8681 NA [8,] 9116 6727 7029 7657 8681 NA [9,] 10073 7232 7031 7328 8670 NA [10,] 10073 7232 7031 7328 8670 NA [11,] 10073 7232 7031 7328 8670 NA [12,] 9223 6370 7223 7115 8028 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/17lhj1493118265.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/2124v1493118265.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/3w3rl1493118265.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/4uosn1493118265.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,] 6370.0 6370 6862 6862 6862 6727 6727 6727 7031 7031 7031 6370 [2,] 7115.0 7115 7926 7926 7926 7029 7029 7029 7232 7232 7232 7115 [3,] 7625.5 7223 8065 8065 8065 7657 7657 7657 7328 7328 7328 7223 [4,] 8899.0 8899 9093 9093 9093 8681 8681 8681 8670 8670 8670 8028 [5,] 9223.0 9223 9151 9151 9151 9116 9116 9116 10073 10073 10073 9223 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6474.762 5962.43 7240.401 7240.401 7240.401 6489.701 6489.701 6489.701 [2,] 8776.238 8483.57 8889.599 8889.599 8889.599 8824.299 8824.299 8824.299 [,9] [,10] [,11] [,12] [1,] 6311.913 6311.913 6311.913 6577.876 [2,] 8344.087 8344.087 8344.087 7868.124 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(6370, 7115, 7625.5, 8899, 9223, 6370, 7115, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bxqr1493118265.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,] 8899 6370 6862 7115.0 7115.0 8028 [2,] 9093 6727 6862 7275.5 7926.0 8028 [3,] 9116 7232 7029 7492.5 8349.0 8028 [4,] 9648 9151 7031 7861.0 8675.5 8028 [5,] 10073 9223 7223 8065.0 8681.0 8028 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 8862.861 6126.397 6951.918 7225.45 8007.148 8028 [2,] 9369.139 8337.603 7106.082 7759.55 8690.852 8028 $out [1] 6370 6370 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(8899, 9093, 9116, 9648, 10073, 6370, 6727, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jhvq1493118265.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,] 946.5085 2289.0 913 [2,] 989.5763 2339.0 1167 [3,] 1058.7259 2621.0 1438 [4,] 1263.4533 2947.5 1652 [5,] 1294.6319 3042.0 1784 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 933.8088 2343.459 1216.788 [2,] 1183.6431 2898.541 1659.212 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(946.508478567414, 989.576328681401, 1058.72592880151, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17lhj1493118265.ps tmp/17lhj1493118265.png",intern=TRUE)) character(0) > try(system("convert tmp/2124v1493118265.ps tmp/2124v1493118265.png",intern=TRUE)) character(0) > try(system("convert tmp/3w3rl1493118265.ps tmp/3w3rl1493118265.png",intern=TRUE)) character(0) > try(system("convert tmp/4uosn1493118265.ps tmp/4uosn1493118265.png",intern=TRUE)) character(0) > try(system("convert tmp/5bxqr1493118265.ps tmp/5bxqr1493118265.png",intern=TRUE)) character(0) > try(system("convert tmp/6jhvq1493118265.ps tmp/6jhvq1493118265.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.565 0.239 2.850