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(10,11,11,12,13,13,15,15,16,16,17,18,18,18,19,19,20,20,21,22,24,24,24,24,25,25,25,26,26,28,29,29,30,30,30,31,31,32,32,33,36,36,38,38,39,40,41,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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 10 18 25 31 NA [2,] 11 18 25 32 NA [3,] 11 19 25 32 NA [4,] 12 19 26 33 NA [5,] 13 20 26 36 NA [6,] 13 20 28 36 NA [7,] 15 21 29 38 NA [8,] 15 22 29 38 NA [9,] 16 24 30 39 NA [10,] 16 24 30 40 NA [11,] 17 24 30 41 NA [12,] 18 24 31 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/1c6qw1493151943.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/2jwe11493151943.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/3wggi1493151943.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/4i2xa1493151943.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,] 10.0 11.0 11.0 12.0 13.0 13.0 15.0 15.0 16.0 16 17.0 18.0 [2,] 14.0 14.5 15.0 15.5 16.5 16.5 18.0 18.5 20.0 20 20.5 21.0 [3,] 21.5 21.5 22.0 22.5 23.0 24.0 25.0 25.5 27.0 27 27.0 27.5 [4,] 28.0 28.5 28.5 29.5 31.0 32.0 33.5 33.5 34.5 35 35.5 36.0 [5,] 31.0 32.0 32.0 33.0 36.0 36.0 38.0 38.0 39.0 40 41.0 41.0 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 10.44 10.44 11.335 11.44 11.545 11.755 12.755 13.65 15.545 15.15 15.15 [2,] 32.56 32.56 32.665 33.56 34.455 36.245 37.245 37.35 38.455 38.85 38.85 [,12] [1,] 15.65 [2,] 39.35 $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(10, 14, 21.5, 28, 31, 11, 14.5, 21.5, 28.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kksf1493151943.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] [1,] 10.0 18.0 25.0 31.0 NA [2,] 11.5 19.0 25.5 32.5 NA [3,] 14.0 20.5 28.5 37.0 NA [4,] 16.0 24.0 30.0 39.5 NA [5,] 18.0 24.0 31.0 41.0 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 11.94752 18.21947 26.44752 33.80725 NA [2,] 16.05248 22.78053 30.55248 40.19275 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(10, 11.5, 14, 16, 18, 18, 19, 20.5, 24, 24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6i4j41493151943.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.920949 21 9.750 [2,] 9.046173 21 10.375 [3,] 9.787220 23 10.500 [4,] 9.962415 23 11.000 [5,] 10.165300 24 11.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.369315 22.08779 10.21493 [2,] 10.205124 23.91221 10.78507 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.92094912738176, 9.04617313964403, 9.78721964980937, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1c6qw1493151943.ps tmp/1c6qw1493151943.png",intern=TRUE)) character(0) > try(system("convert tmp/2jwe11493151943.ps tmp/2jwe11493151943.png",intern=TRUE)) character(0) > try(system("convert tmp/3wggi1493151943.ps tmp/3wggi1493151943.png",intern=TRUE)) character(0) > try(system("convert tmp/4i2xa1493151943.ps tmp/4i2xa1493151943.png",intern=TRUE)) character(0) > try(system("convert tmp/5kksf1493151943.ps tmp/5kksf1493151943.png",intern=TRUE)) character(0) > try(system("convert tmp/6i4j41493151943.ps tmp/6i4j41493151943.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.112 0.318 3.549