R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(169701,164182,161914,159612,151001,158114,186530,187069,174330,169362,166827,178037,186412,189226,191563,188906,186005,195309,223532,226899,214126,206903,204442,220376,214320,212588,205816,202196,195722,198563,229139,229527,211868,203555,195770,199834,203089,198480,192684,187827,182414,182510,211524,211451,200140,191568,186424,191987,203583,201920,195978,191395,188222,189422,214419,224325,216222,210506,207221,210027,215191,215177,211701,210176,205491,206996,235980,241292,236675,229127,225436,229570,239973,236168,230703,224790,217811,219576,245472,248511,242084,235572,229827,229697) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 169701 186412 214320 203089 203583 215191 239973 NA [2,] 164182 189226 212588 198480 201920 215177 236168 NA [3,] 161914 191563 205816 192684 195978 211701 230703 NA [4,] 159612 188906 202196 187827 191395 210176 224790 NA [5,] 151001 186005 195722 182414 188222 205491 217811 NA [6,] 158114 195309 198563 182510 189422 206996 219576 NA [7,] 186530 223532 229139 211524 214419 235980 245472 NA [8,] 187069 226899 229527 211451 224325 241292 248511 NA [9,] 174330 214126 211868 200140 216222 236675 242084 NA [10,] 169362 206903 203555 191568 210506 229127 235572 NA [11,] 166827 204442 195770 186424 207221 225436 229827 NA [12,] 178037 220376 199834 191987 210027 229570 229697 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/1q1r91448217425.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/24ljz1448217425.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/33qwf1448217426.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/4e27f1448217426.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] [1,] 169701.0 164182.0 191563.0 187827.0 182414.0 182510.0 186530.0 211451.0 [2,] 194750.5 193853.0 192123.5 188366.5 184209.5 185966.0 212971.5 217888.0 [3,] 203583.0 201920.0 195978.0 191395.0 188222.0 195309.0 223532.0 226899.0 [4,] 214755.5 213882.5 208758.5 206186.0 200606.5 202779.5 232559.5 235409.5 [5,] 239973.0 236168.0 230703.0 224790.0 217811.0 219576.0 245472.0 248511.0 [,9] [,10] [,11] [,12] [1,] 200140.0 169362.0 166827.0 178037.0 [2,] 206004.0 197561.5 191097.0 195910.5 [3,] 214126.0 206903.0 204442.0 210027.0 [4,] 226448.5 219816.5 216328.5 224973.0 [5,] 242084.0 235572.0 229827.0 229697.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 191636.3 189958.7 186043.8 180753.5 178430 185268.2 211834.4 216435.4 [2,] 215529.7 213881.3 205912.2 202036.5 198014 205349.8 235229.6 237362.6 [,9] [,10] [,11] [,12] [1,] 201916.9 193612.7 189374.2 192671.3 [2,] 226335.1 220193.3 219509.8 227382.7 $out [1] 161914 159612 151001 158114 187069 174330 $group [1] 3 4 5 6 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(169701, 194750.5, 203583, 214755.5, 239973, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rmu31448217426.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] [,8] [1,] 151001.0 186005.0 195722.0 182414.0 188222.0 205491.0 217811.0 NA [2,] 160763.0 189066.0 199198.5 187125.5 193686.5 210938.5 227243.5 NA [3,] 168094.5 199875.5 204685.5 192335.5 205402.0 220313.5 233137.5 NA [4,] 176183.5 217251.0 213454.0 201614.5 212462.5 232775.0 241028.5 NA [5,] 187069.0 226899.0 229527.0 211524.0 224325.0 241292.0 248511.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 161061.1 187020.1 198183.5 185727 196838.1 210353.7 226850.1 NA [2,] 175127.9 212730.9 211187.5 198944 213965.9 230273.3 239424.9 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(151001, 160763, 168094.5, 176183.5, 187069, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jd3u1448217426.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,] 19223.23 51660.0 16397.00 [2,] 19940.18 61452.0 17167.50 [3,] 21082.41 65694.0 19796.50 [4,] 22349.50 68271.5 21349.75 [5,] 22646.71 71986.0 25231.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 19983.50 62583.58 17888.95 [2,] 22181.31 68804.42 21704.05 $out [1] 29062.5 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(19223.2292180952, 19940.1825200589, 21082.4062759399, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1q1r91448217425.ps tmp/1q1r91448217425.png",intern=TRUE)) character(0) > try(system("convert tmp/24ljz1448217425.ps tmp/24ljz1448217425.png",intern=TRUE)) character(0) > try(system("convert tmp/33qwf1448217426.ps tmp/33qwf1448217426.png",intern=TRUE)) character(0) > try(system("convert tmp/4e27f1448217426.ps tmp/4e27f1448217426.png",intern=TRUE)) character(0) > try(system("convert tmp/5rmu31448217426.ps tmp/5rmu31448217426.png",intern=TRUE)) character(0) > try(system("convert tmp/6jd3u1448217426.ps tmp/6jd3u1448217426.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.072 0.395 2.467