R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(111,111,112,115,115,115,116,116,112,110,111,111,108,109,112,113,114,115,116,114,115,117,121,119,119,119,122,123,127,130,131,126,125,121,114,109,108,110,110,111,113,116,115,117,116,115,117,117,119,118,122,124,125,125,124,124,125,125,126,129,131,132,135,137,138,136,136,136,138,138,138,138) > 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,] 111 108 119 108 119 131 NA [2,] 111 109 119 110 118 132 NA [3,] 112 112 122 110 122 135 NA [4,] 115 113 123 111 124 137 NA [5,] 115 114 127 113 125 138 NA [6,] 115 115 130 116 125 136 NA [7,] 116 116 131 115 124 136 NA [8,] 116 114 126 117 124 136 NA [9,] 112 115 125 116 125 138 NA [10,] 110 117 121 115 125 138 NA [11,] 111 121 114 117 126 138 NA [12,] 111 119 109 117 129 138 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/1deyw1337811734.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/2njw11337811734.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/3uyz11337811734.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/4bof21337811734.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,] 108 109.0 110 111 113 115.0 115 114.0 112.0 110 111 109 [2,] 108 110.0 112 113 114 115.0 116 116.0 115.0 115 114 111 [3,] 115 114.5 117 119 120 120.5 120 120.5 120.5 119 119 118 [4,] 119 119.0 122 124 127 130.0 131 126.0 125.0 125 126 129 [5,] 131 132.0 135 137 138 136.0 136 136.0 138.0 138 138 138 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.9046 108.6947 110.5497 111.9046 111.6146 110.8245 110.3245 114.0497 [2,] 122.0954 120.3053 123.4503 126.0954 128.3854 130.1755 129.6755 126.9503 [,9] [,10] [,11] [,12] [1,] 114.0497 112.5497 111.2596 106.3894 [2,] 126.9503 125.4503 126.7404 129.6106 $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(108, 108, 115, 119, 131, 109, 110, 114.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/583581337811734.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,] 110 108.0 109.0 108.0 122.0 132.0 NA [2,] 111 112.5 119.0 110.5 123.0 135.5 NA [3,] 112 114.5 122.5 115.0 124.5 136.5 NA [4,] 115 116.5 126.5 116.5 125.0 138.0 NA [5,] 116 121.0 131.0 117.0 126.0 138.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 110.1756 112.6756 119.0792 112.2634 123.5878 135.3597 NA [2,] 113.8244 116.3244 125.9208 117.7366 125.4122 137.6403 NA $out [1] 119 118 129 131 $group [1] 5 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(110, 111, 112, 115, 116, 108, 112.5, 114.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/603qc1337811734.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.256311 21.0 8.500 [2,] 8.899438 22.5 9.500 [3,] 9.548072 25.0 10.125 [4,] 9.781785 26.5 12.750 [5,] 11.095044 29.0 14.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.145628 23.17557 8.642653 [2,] 9.950516 26.82443 11.607347 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.25631071766722, 8.8994381845148, 9.54807202806155, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1deyw1337811734.ps tmp/1deyw1337811734.png",intern=TRUE)) character(0) > try(system("convert tmp/2njw11337811734.ps tmp/2njw11337811734.png",intern=TRUE)) character(0) > try(system("convert tmp/3uyz11337811734.ps tmp/3uyz11337811734.png",intern=TRUE)) character(0) > try(system("convert tmp/4bof21337811734.ps tmp/4bof21337811734.png",intern=TRUE)) character(0) > try(system("convert tmp/583581337811734.ps tmp/583581337811734.png",intern=TRUE)) character(0) > try(system("convert tmp/603qc1337811734.ps tmp/603qc1337811734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.458 0.374 1.832