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(173019,173690,172439,171914,171968,169500,173898,172308,171568,164939,161275,160770,162466,160185,154836,154103,150495,142707,149962,149967,144572,143819,141070,144119,145330,143279,139063,139202,133632,134476,141859,140693,138047,138346,140167,146796,152228,155410,159032,160312,157687,160141,167421,167628,164403,163405,163229,171154,173323,172381,168983,165380,161641,161933,172018,168455,164332,161193,157645,161694,163411,161834,159511,156359,154223,151497,160607,159672,155601,154668,153960,157307,165218,165616,162212,159787,157454,156485,165887,166836,163541,163973,164805,167521,174347,173374,172198,171055,168385,167281,177670,177280,174846,174476,174595,178392,185345,183293,181081,177795,173552,170734,179293,178659,175894,174815,173506,175376) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 173019 162466 145330 152228 173323 163411 165218 174347 185345 NA [2,] 173690 160185 143279 155410 172381 161834 165616 173374 183293 NA [3,] 172439 154836 139063 159032 168983 159511 162212 172198 181081 NA [4,] 171914 154103 139202 160312 165380 156359 159787 171055 177795 NA [5,] 171968 150495 133632 157687 161641 154223 157454 168385 173552 NA [6,] 169500 142707 134476 160141 161933 151497 156485 167281 170734 NA [7,] 173898 149962 141859 167421 172018 160607 165887 177670 179293 NA [8,] 172308 149967 140693 167628 168455 159672 166836 177280 178659 NA [9,] 171568 144572 138047 164403 164332 155601 163541 174846 175894 NA [10,] 164939 143819 138346 163405 161193 154668 163973 174476 174815 NA [11,] 161275 141070 140167 163229 157645 153960 164805 174595 173506 NA [12,] 160770 144119 146796 171154 161694 157307 167521 178392 175376 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/1e7al1448231827.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/2j9my1448231827.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/38p2j1448231827.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/4rxdd1448231827.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,] 152228 143279 154836 139202 133632 134476 141859 149967 138047 143819 [2,] 162466 160185 159032 156359 154223 151497 160607 159672 155601 154668 [3,] 165218 165616 162212 160312 157687 160141 167421 167628 164332 163405 [4,] 173323 173374 172198 171055 168385 167281 173898 172308 171568 164939 [5,] 185345 183293 181081 177795 173552 170734 179293 178659 175894 174815 [,11] [,12] [1,] 140167 144119 [2,] 153960 157307 [3,] 161275 161694 [4,] 164805 171154 [5,] 174595 178392 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 159500 158669.8 155277.9 152572.1 150228.3 151828.1 160421.1 160973 [2,] 170936 172562.2 169146.1 168051.9 165145.7 168453.9 174420.9 174283 [,9] [,10] [,11] [,12] [1,] 155922.7 157995.6 155563.3 154401.2 [2,] 172741.3 168814.4 166986.7 168986.8 $out [1] 145330 139063 140693 138346 $group [1] 1 3 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(152228, 162466, 165218, 173323, 185345, 143279, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kxrn1448231827.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,] 160770.0 141070.0 133632.0 152228.0 157645.0 151497.0 156485.0 167281.0 [2,] 167219.5 143969.0 138196.5 158359.5 161667.5 154445.5 160999.5 171626.5 [3,] 171941.0 149964.5 139684.5 161770.5 164856.0 156833.0 164389.0 174411.5 [4,] 172729.0 154469.5 142569.0 165912.0 170500.5 160139.5 165751.5 176063.0 [5,] 173898.0 162466.0 146796.0 171154.0 173323.0 163411.0 167521.0 178392.0 [,9] [,10] [1,] 170734.0 NA [2,] 174183.5 NA [3,] 176844.5 NA [4,] 180187.0 NA [5,] 185345.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 169428.1 145175.2 137690.2 158325.8 160827.2 154235.9 162221.6 172388 [2,] 174453.9 154753.8 141678.8 165215.2 168884.8 159430.1 166556.4 176435 [,9] [,10] [1,] 174106.3 NA [2,] 179582.7 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(160770, 167219.5, 171941, 172729, 173898, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67tuq1448231827.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,] 11523.77 34273.0 10271.0 [2,] 12032.99 36363.5 11746.5 [3,] 12326.51 37906.5 13240.0 [4,] 12495.45 39967.0 14429.0 [5,] 13127.38 42018.0 15967.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 12115.58 36262.92 12016.49 [2,] 12537.44 39550.08 14463.51 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(11523.7749577896, 12032.9872238102, 12326.5110339654, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e7al1448231827.ps tmp/1e7al1448231827.png",intern=TRUE)) character(0) > try(system("convert tmp/2j9my1448231827.ps tmp/2j9my1448231827.png",intern=TRUE)) character(0) > try(system("convert tmp/38p2j1448231827.ps tmp/38p2j1448231827.png",intern=TRUE)) character(0) > try(system("convert tmp/4rxdd1448231827.ps tmp/4rxdd1448231827.png",intern=TRUE)) character(0) > try(system("convert tmp/5kxrn1448231827.ps tmp/5kxrn1448231827.png",intern=TRUE)) character(0) > try(system("convert tmp/67tuq1448231827.ps tmp/67tuq1448231827.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.152 0.352 2.520