R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(9244,7074,7044,6492,6362,8287,18177,10379,11130,9606,7294,7415,9230,7423,6927,7572,5877,8878,16706,9611,12714,10549,8421,9993,12384,9798,11738,9011,7673,10736,18316,10973,14027,10242,8547,8187,11101,8685,9790,8003,7412,9397,17774,11230,13321,9432,7653,7651,10762,8614,8748,7235,7735,8360,16202,11053,13593,9738,8226,7866,11606,9456,8471,7553,8259,9009,13968,12844,14388,12048,9167,7733) > 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,] 9244 9230 12384 11101 10762 11606 NA [2,] 7074 7423 9798 8685 8614 9456 NA [3,] 7044 6927 11738 9790 8748 8471 NA [4,] 6492 7572 9011 8003 7235 7553 NA [5,] 6362 5877 7673 7412 7735 8259 NA [6,] 8287 8878 10736 9397 8360 9009 NA [7,] 18177 16706 18316 17774 16202 13968 NA [8,] 10379 9611 10973 11230 11053 12844 NA [9,] 11130 12714 14027 13321 13593 14388 NA [10,] 9606 10549 10242 9432 9738 12048 NA [11,] 7294 8421 8547 7653 8226 9167 NA [12,] 7415 9993 8187 7651 7866 7733 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/1spqg1386099539.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/2esma1386099539.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/3e22u1386099539.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/43oyp1386099539.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,] 9230.0 7074.0 6927.0 6492.0 5877.0 8287.0 13968 9611 11130 9432 [2,] 9244.0 7423.0 7044.0 7235.0 6362.0 8360.0 16202 10379 12714 9606 [3,] 10931.5 8649.5 8609.5 7562.5 7542.5 8943.5 17240 11013 13457 9990 [4,] 11606.0 9456.0 9790.0 8003.0 7735.0 9397.0 18177 11230 14027 10549 [5,] 12384.0 9798.0 11738.0 9011.0 8259.0 10736.0 18316 11230 14388 10549 [,11] [,12] [1,] 7294.0 7415.0 [2,] 7653.0 7651.0 [3,] 8323.5 7799.5 [4,] 8547.0 8187.0 [5,] 9167.0 8187.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 9407.934 7338.149 6838.241 7067.115 6656.871 8274.602 15966.06 10464.08 [2,] 12455.066 9960.851 10380.759 8057.885 8428.129 9612.398 18513.94 11561.92 [,9] [,10] [,11] [,12] [1,] 12610.07 9381.735 7746.841 7453.763 [2,] 14303.93 10598.265 8900.159 8145.237 $out [1] 12844 12048 9993 $group [1] 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(9230, 9244, 10931.5, 11606, 12384, 7074, 7423, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55ont1386099539.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,] 6362.0 5877.0 7673 7412.0 7235.0 7553.0 NA [2,] 7059.0 7497.5 8779 7828.0 8046.0 8365.0 NA [3,] 7851.0 9054.0 10489 9414.5 8681.0 9311.5 NA [4,] 9992.5 10271.0 12061 11165.5 10907.5 12446.0 NA [5,] 11130.0 12714.0 14027 13321.0 13593.0 14388.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6513.011 7788.988 8992.058 7892.244 7375.851 7450.129 NA [2,] 9188.989 10319.012 11985.942 10936.756 9986.149 11172.871 NA $out [1] 18177 16706 18316 17774 16202 $group [1] 1 2 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(6362, 7059, 7851, 9992.5, 11130, 5877, 7497.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ynm41386099539.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,] 666.8007 1873.0 435.250 [2,] 903.1299 2484.0 688.750 [3,] 1020.1549 2670.0 943.000 [4,] 1218.8421 3245.5 1645.375 [5,] 1643.7832 4348.0 2128.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 876.1564 2322.675 506.6769 [2,] 1164.1533 3017.325 1379.3231 $out [1] 1806.291 4811.000 $group [1] 1 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(666.80071985564, 903.12991870561, 1020.15487563799, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1spqg1386099539.ps tmp/1spqg1386099539.png",intern=TRUE)) character(0) > try(system("convert tmp/2esma1386099539.ps tmp/2esma1386099539.png",intern=TRUE)) character(0) > try(system("convert tmp/3e22u1386099539.ps tmp/3e22u1386099539.png",intern=TRUE)) character(0) > try(system("convert tmp/43oyp1386099539.ps tmp/43oyp1386099539.png",intern=TRUE)) character(0) > try(system("convert tmp/55ont1386099539.ps tmp/55ont1386099539.png",intern=TRUE)) character(0) > try(system("convert tmp/6ynm41386099539.ps tmp/6ynm41386099539.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.375 1.181 6.508