R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(8378669,7557530,8656721,7729873,7067002,7222189,6758161,6745665,8203660,8799755,7995151,6844694,7400186,6146183,6793027,5815146,5993505,5838016,5926815,5642890,7120621,7781743,7638921,5886070,7358890,6981189,8423532,6819313,6727221,6923349,7578240,7228898,8988846,8404694,9601659,8213138,8434646,8466539,9106270,8438555,7723821,7538413,7199881,8168314,9045790,8544483,9020709,7932021,8435986,7920357,8333659,7415547,7770392,8188878,8092465,7188528,8152373,9025069,9233973,6916290,8171721,7012501,8779456,7308709,8084547,8255978,7658071,7371877,8780827,10116778,9567175,7455902) > par1 = '24' > par1 <- '24' > #'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] 3 > 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] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 > arr [,1] [,2] [,3] [,4] [1,] 8378669 7358890 8435986 NA [2,] 7557530 6981189 7920357 NA [3,] 8656721 8423532 8333659 NA [4,] 7729873 6819313 7415547 NA [5,] 7067002 6727221 7770392 NA [6,] 7222189 6923349 8188878 NA [7,] 6758161 7578240 8092465 NA [8,] 6745665 7228898 7188528 NA [9,] 8203660 8988846 8152373 NA [10,] 8799755 8404694 9025069 NA [11,] 7995151 9601659 9233973 NA [12,] 6844694 8213138 6916290 NA [13,] 7400186 8434646 8171721 NA [14,] 6146183 8466539 7012501 NA [15,] 6793027 9106270 8779456 NA [16,] 5815146 8438555 7308709 NA [17,] 5993505 7723821 8084547 NA [18,] 5838016 7538413 8255978 NA [19,] 5926815 7199881 7658071 NA [20,] 5642890 8168314 7371877 NA [21,] 7120621 9045790 8780827 NA [22,] 7781743 8544483 10116778 NA [23,] 7638921 9020709 9567175 NA [24,] 5886070 7932021 7455902 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/1ti431417033470.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/251y21417033470.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/3s1w91417033470.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/4z54t1417033470.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] [1,] 7358890 6981189 8333659 6819313 6727221 6923349 6758161 6745665 8152373 [2,] 7868780 7269360 8378596 7117430 6897112 7072769 7168200 6967096 8178016 [3,] 8378669 7557530 8423532 7415547 7067002 7222189 7578240 7188528 8203660 [4,] 8407328 7738944 8540126 7572710 7418697 7705534 7835352 7208713 8596253 [5,] 8435986 7920357 8656721 7729873 7770392 8188878 8092465 7228898 8988846 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 8404694 7995151 6844694 7400186 6146183 6793027 5815146 5993505 5838016 [2,] 8602224 8614562 6880492 7785954 6579342 7786242 6561928 6858663 6688214 [3,] 8799755 9233973 6916290 8171721 7012501 8779456 7308709 7723821 7538413 [4,] 8912412 9417816 7564714 8303184 7739520 8942863 7873632 7904184 7897196 [5,] 9025069 9601659 8213138 8434646 8466539 9106270 8438555 8084547 8255978 [,19] [,20] [,21] [,22] [,23] [,24] [1,] 5926815 5642890 7120621 7781743 7638921 5886070 [2,] 6563348 6507384 7950724 8163113 8329815 6670986 [3,] 7199881 7371877 8780827 8544483 9020709 7455902 [4,] 7428976 7770096 8913308 9330630 9293942 7693962 [5,] 7658071 8168314 9045790 10116778 9567175 7932021 $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 7887398 7129169 8276181 7000234 6591205 6644973 6969655 6968122 7822139 [2,] 8869940 7985891 8570883 7830860 7542799 7799405 8186825 7408934 8585181 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 8516798 8501234 6292134 7699897 5954171 7724370 6112155 6770083 6435564 [2,] 9082712 9966712 7540446 8643545 8070831 9834542 8505263 8677559 8641262 [,19] [,20] [,21] [,22] [,23] [,24] [1,] 6410244 6220014 7902744 7479458 8141219 6522730 [2,] 7989518 8523740 9658910 9609508 9900199 8389074 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" Warning message: In bxp(list(stats = c(7358890, 7868779.5, 8378669, 8407327.5, 8435986, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51s7h1417033470.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] [1,] 5642890 6727221 6916290 NA [2,] 6069844 7293894 7435724 NA [3,] 7093812 8190726 8122419 NA [4,] 7755808 8505511 8607721 NA [5,] 8799755 9601659 10116778 NA $n [1] 24 24 24 0 $conf [,1] [,2] [,3] [,4] [1,] 6550061 7799960 7744431 NA [2,] 7637562 8581492 8500407 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" NA Warning message: In bxp(list(stats = c(5642890, 6069844, 7093811.5, 7755808, 8799755, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6s7z41417033470.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,] 166745.0 323062 161531 [2,] 502827.1 986814 493407 [3,] 805967.3 1487476 743738 [4,] 1145148.1 2202142 1101071 [5,] 1315900.0 2623409 1311704 $n [1] 24 24 24 $conf [,1] [,2] [,3] [1,] 598808.4 1095513 547756.5 [2,] 1013126.2 1879439 939719.5 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" > dev.off() null device 1 > > try(system("convert tmp/1ti431417033470.ps tmp/1ti431417033470.png",intern=TRUE)) character(0) > try(system("convert tmp/251y21417033470.ps tmp/251y21417033470.png",intern=TRUE)) character(0) > try(system("convert tmp/3s1w91417033470.ps tmp/3s1w91417033470.png",intern=TRUE)) character(0) > try(system("convert tmp/4z54t1417033470.ps tmp/4z54t1417033470.png",intern=TRUE)) character(0) > try(system("convert tmp/51s7h1417033470.ps tmp/51s7h1417033470.png",intern=TRUE)) character(0) > try(system("convert tmp/6s7z41417033470.ps tmp/6s7z41417033470.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.225 0.368 2.623