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(102.8,103.3,103.3,104,104.3,104.1,103.9,103.8,103.7,103.6,103.6,103.8,104.9,106.2,106.8,107.3,106.9,107.1,106.6,106.8,107.1,107.5,107.6,107.7,108.4,108.8,108.9,109.2,110.1,110.4,110.7,111,111,111.2,111.5,111.4,111.1,110.6,110.8,110.9,110.8,110.9,110.6,110.3,109.7,109.4,109,109.5,109.8,108.5,108.4,108.4,107.9,106.7,106.9,106.9,106.7,106.7,106.6,107.1) > 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,] 102.8 104.9 108.4 111.1 109.8 NA [2,] 103.3 106.2 108.8 110.6 108.5 NA [3,] 103.3 106.8 108.9 110.8 108.4 NA [4,] 104.0 107.3 109.2 110.9 108.4 NA [5,] 104.3 106.9 110.1 110.8 107.9 NA [6,] 104.1 107.1 110.4 110.9 106.7 NA [7,] 103.9 106.6 110.7 110.6 106.9 NA [8,] 103.8 106.8 111.0 110.3 106.9 NA [9,] 103.7 107.1 111.0 109.7 106.7 NA [10,] 103.6 107.5 111.2 109.4 106.7 NA [11,] 103.6 107.6 111.5 109.0 106.6 NA [12,] 103.8 107.7 111.4 109.5 107.1 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/1ulnf1493108301.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/2oi4n1493108301.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/3w41f1493108301.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/4ucrn1493108301.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,] 102.8 103.3 106.8 107.3 104.3 104.1 103.9 103.8 103.7 103.6 103.6 103.8 [2,] 104.9 106.2 106.8 107.3 106.9 106.7 106.6 106.8 106.7 106.7 106.6 107.1 [3,] 108.4 108.5 108.4 108.4 107.9 107.1 106.9 106.9 107.1 107.5 107.6 107.7 [4,] 109.8 108.8 108.9 109.2 110.1 110.4 110.6 110.3 109.7 109.4 109.0 109.5 [5,] 111.1 110.6 110.8 110.9 110.8 110.9 110.7 111.0 111.0 111.2 111.5 111.4 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.9377 106.6628 106.9161 107.0575 105.6389 104.4856 104.0736 104.4269 [2,] 111.8623 110.3372 109.8839 109.7425 110.1611 109.7144 109.7264 109.3731 [,9] [,10] [,11] [,12] [1,] 104.9802 105.5922 105.9042 106.0042 [2,] 109.2198 109.4078 109.2958 109.3958 $out [1] 103.3 104.0 $group [1] 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(102.8, 104.9, 108.4, 109.8, 111.1, 103.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5weds1493108301.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,] 102.80 106.2 108.40 109.00 106.6 NA [2,] 103.45 106.7 109.05 109.60 106.7 NA [3,] 103.75 107.0 110.55 110.60 107.0 NA [4,] 103.95 107.4 111.10 110.85 108.4 NA [5,] 104.30 107.7 111.50 111.10 109.8 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.5219 106.6807 109.615 110.0299 106.2246 NA [2,] 103.9781 107.3193 111.485 111.1701 107.7754 NA $out [1] 104.9 $group [1] 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(102.8, 103.45, 103.75, 103.95, 104.3, 106.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vmuu1493108301.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,] 2.811939 6.50 1.90 [2,] 2.813361 6.85 2.40 [3,] 2.840158 7.30 2.85 [4,] 2.912113 7.60 3.60 [5,] 2.927969 8.30 4.90 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.795116 6.95792 2.302672 [2,] 2.885200 7.64208 3.397328 $out [1] 3.459046 2.573519 2.605763 $group [1] 1 1 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.81193883290515, 2.813360620063, 2.84015805208095, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ulnf1493108301.ps tmp/1ulnf1493108301.png",intern=TRUE)) character(0) > try(system("convert tmp/2oi4n1493108301.ps tmp/2oi4n1493108301.png",intern=TRUE)) character(0) > try(system("convert tmp/3w41f1493108301.ps tmp/3w41f1493108301.png",intern=TRUE)) character(0) > try(system("convert tmp/4ucrn1493108301.ps tmp/4ucrn1493108301.png",intern=TRUE)) character(0) > try(system("convert tmp/5weds1493108301.ps tmp/5weds1493108301.png",intern=TRUE)) character(0) > try(system("convert tmp/6vmuu1493108301.ps tmp/6vmuu1493108301.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.812 0.272 3.144