R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes" Copyright (C) 2016 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(8.9,9.2,12.8,11.1,11.2,13.1,12.6,10,12.3,12.5,11.4,11.5,10.4,11,15,12.7,11.6,13.9,12.6,11.2,15.8,15.3,14,14.6,11.5,12.8,16.2,12.8,13.5,12.5,13.2,12,14.2,17.5,13.8,13.9,11.3,12.1,16.2,11.6,12.5,15.6,12.3,12,12.1,13.9,12.3,10.5,14.2,13.2,13.7,14.2,15.3,16.3,15.1,13.4,14,15.5,12.5,12.9,12.9,13.4,15,14.4,14,15.2,15,12.4,18.7,20.6,17.3,11.4) > 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,] 8.9 10.4 11.5 11.3 14.2 12.9 NA [2,] 9.2 11.0 12.8 12.1 13.2 13.4 NA [3,] 12.8 15.0 16.2 16.2 13.7 15.0 NA [4,] 11.1 12.7 12.8 11.6 14.2 14.4 NA [5,] 11.2 11.6 13.5 12.5 15.3 14.0 NA [6,] 13.1 13.9 12.5 15.6 16.3 15.2 NA [7,] 12.6 12.6 13.2 12.3 15.1 15.0 NA [8,] 10.0 11.2 12.0 12.0 13.4 12.4 NA [9,] 12.3 15.8 14.2 12.1 14.0 18.7 NA [10,] 12.5 15.3 17.5 13.9 15.5 20.6 NA [11,] 11.4 14.0 13.8 12.3 12.5 17.3 NA [12,] 11.5 14.6 13.9 10.5 12.9 11.4 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/18p9y1461428703.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/21w2b1461428703.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/3vbzy1461428703.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/41ymp1461428703.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,] 8.9 9.20 12.8 11.10 11.2 12.50 12.3 10.0 12.1 12.5 11.40 10.5 [2,] 10.4 11.00 13.7 11.60 11.6 13.10 12.6 11.2 12.3 13.9 12.30 11.4 [3,] 11.4 12.45 15.0 12.75 13.0 14.55 12.9 12.0 14.1 15.4 13.15 12.2 [4,] 12.9 13.20 16.2 14.20 14.0 15.60 15.0 12.4 15.8 17.5 14.00 13.9 [5,] 14.2 13.40 16.2 14.40 15.3 16.30 15.1 13.4 18.7 20.6 14.00 14.6 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 9.787419 11.03093 13.38742 11.07292 11.45192 12.93742 11.35192 11.22596 [2,] 13.012581 13.86907 16.61258 14.42708 14.54808 16.16258 14.44808 12.77404 [,9] [,10] [,11] [,12] [1,] 11.84239 13.07788 12.05345 10.58742 [2,] 16.35761 17.72212 14.24655 13.81258 $out [1] 17.3 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(8.9, 10.4, 11.4, 12.9, 14.2, 9.2, 11, 12.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58owk1461428703.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,] 8.90 10.4 11.50 10.5 12.5 11.40 NA [2,] 10.55 11.4 12.65 11.8 13.3 13.15 NA [3,] 11.45 13.3 13.35 12.2 14.1 14.70 NA [4,] 12.55 14.8 14.05 13.2 15.2 16.25 NA [5,] 13.10 15.8 14.20 13.9 16.3 20.60 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 10.53779 11.74924 12.71145 11.56145 13.2334 13.28607 NA [2,] 12.36221 14.85076 13.98855 12.83855 14.9666 16.11393 NA $out [1] 16.2 17.5 16.2 15.6 $group [1] 3 3 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(8.9, 10.55, 11.45, 12.55, 13.1, 10.4, 11.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/642wc1461428703.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.148332 2.8 1.6000 [2,] 1.344123 3.4 1.8500 [3,] 1.572134 4.1 1.9625 [4,] 1.968390 5.6 2.2125 [5,] 2.854061 8.1 2.7500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.287402 3.096565 1.797161 [2,] 1.856866 5.103435 2.127839 $out [1] 0.9 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.14833212385035, 1.34412255121916, 1.57213398453499, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18p9y1461428703.ps tmp/18p9y1461428703.png",intern=TRUE)) character(0) > try(system("convert tmp/21w2b1461428703.ps tmp/21w2b1461428703.png",intern=TRUE)) character(0) > try(system("convert tmp/3vbzy1461428703.ps tmp/3vbzy1461428703.png",intern=TRUE)) character(0) > try(system("convert tmp/41ymp1461428703.ps tmp/41ymp1461428703.png",intern=TRUE)) character(0) > try(system("convert tmp/58owk1461428703.ps tmp/58owk1461428703.png",intern=TRUE)) character(0) > try(system("convert tmp/642wc1461428703.ps tmp/642wc1461428703.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.142 0.462 2.620