R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(599,599,599,599,599,599,599,599,599,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,674.3,674.3,674.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] 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,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [2,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [3,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [4,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [5,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [6,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [7,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [8,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [9,] 599.00 617.06 628.18 641.08 668.21 665.27 NA [10,] 617.06 628.18 641.08 668.21 665.27 674.30 NA [11,] 617.06 628.18 641.08 668.21 665.27 674.30 NA [12,] 617.06 628.18 641.08 668.21 665.27 674.30 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/1qmmd1366878071.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/2jn1n1366878071.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/3vfzu1366878071.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/417tp1366878071.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] [1,] 599.00 599.00 599.00 599.00 599.00 599.00 599.00 599.00 599.00 617.060 [2,] 617.06 617.06 617.06 617.06 617.06 617.06 617.06 617.06 617.06 628.180 [3,] 634.63 634.63 634.63 634.63 634.63 634.63 634.63 634.63 634.63 653.175 [4,] 665.27 665.27 665.27 665.27 665.27 665.27 665.27 665.27 665.27 668.210 [5,] 668.21 668.21 668.21 668.21 668.21 668.21 668.21 668.21 668.21 674.300 [,11] [,12] [1,] 617.060 617.060 [2,] 628.180 628.180 [3,] 653.175 653.175 [4,] 668.210 668.210 [5,] 674.300 674.300 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 603.533 603.533 603.533 603.533 603.533 603.533 603.533 603.533 603.533 [2,] 665.727 665.727 665.727 665.727 665.727 665.727 665.727 665.727 665.727 [,10] [,11] [,12] [1,] 627.3544 627.3544 627.3544 [2,] 678.9956 678.9956 678.9956 $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(599, 617.06, 634.63, 665.27, 668.21, 599, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53eb91366878071.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,] 599.00 617.06 628.18 641.080 665.27 665.270 NA [2,] 599.00 617.06 628.18 641.080 666.74 665.270 NA [3,] 599.00 617.06 628.18 641.080 668.21 665.270 NA [4,] 608.03 622.62 634.63 654.645 668.21 669.785 NA [5,] 617.06 628.18 641.08 668.210 668.21 674.300 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 594.8814 614.524 625.2381 634.8929 667.5395 663.2107 NA [2,] 603.1186 619.596 631.1219 647.2671 668.8805 667.3293 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(599, 599, 599, 608.03, 617.06, 617.06, 617.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65ubj1366878071.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,] 23.62282 57.240 36.07000 [2,] 25.42683 63.225 37.72625 [3,] 27.23084 69.210 39.38250 [4,] 27.23084 69.210 39.38250 [5,] 27.23084 69.210 39.38250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26.40802 66.4802 38.62707 [2,] 28.05366 71.9398 40.13793 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(23.6228183472393, 25.4268282515132, 27.230838155787, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qmmd1366878071.ps tmp/1qmmd1366878071.png",intern=TRUE)) character(0) > try(system("convert tmp/2jn1n1366878071.ps tmp/2jn1n1366878071.png",intern=TRUE)) character(0) > try(system("convert tmp/3vfzu1366878071.ps tmp/3vfzu1366878071.png",intern=TRUE)) character(0) > try(system("convert tmp/417tp1366878071.ps tmp/417tp1366878071.png",intern=TRUE)) character(0) > try(system("convert tmp/53eb91366878071.ps tmp/53eb91366878071.png",intern=TRUE)) character(0) > try(system("convert tmp/65ubj1366878071.ps tmp/65ubj1366878071.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.219 0.974 5.174