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(28100,27900,28078,28479,28156,29219,28782,27078,30031,29579,26532,23995,22067,21818,23787,21551,21309,22395,22906,21430,23492,24144,24438,24689,24569,23754,28473,27051,27081,29635,27715,26373,28009,29472,30005,29777,28886,28549,33348,29017,30924,30435,29431,30290,31286,30622,31742,30391,30740,32086,33947,31312,33239,32362,32170,32665,31412,34891,33919,30706,32846,31368,33130,31665,33139,32201,32230,30287,31918,33853,32232,31484,31902,30260,32823,32018,32100,31952,33274,29491,32751,33643,31226,30976) > 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,] 28100 22067 24569 28886 30740 32846 31902 NA [2,] 27900 21818 23754 28549 32086 31368 30260 NA [3,] 28078 23787 28473 33348 33947 33130 32823 NA [4,] 28479 21551 27051 29017 31312 31665 32018 NA [5,] 28156 21309 27081 30924 33239 33139 32100 NA [6,] 29219 22395 29635 30435 32362 32201 31952 NA [7,] 28782 22906 27715 29431 32170 32230 33274 NA [8,] 27078 21430 26373 30290 32665 30287 29491 NA [9,] 30031 23492 28009 31286 31412 31918 32751 NA [10,] 29579 24144 29472 30622 34891 33853 33643 NA [11,] 26532 24438 30005 31742 33919 32232 31226 NA [12,] 23995 24689 29777 30391 30706 31484 30976 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/19rcj1448232456.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/28rbq1448232456.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/3gc4z1448232456.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/4imbi1448232456.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,] 22067.0 21818 23787.0 27051.0 21309.0 29219.0 22906.0 21430.0 28009 [2,] 26334.5 25827 28275.5 27765.0 27618.5 29427.0 28248.5 26725.5 29020 [3,] 28886.0 28549 32823.0 29017.0 30924.0 30435.0 29431.0 29491.0 31286 [4,] 31321.0 30814 33239.0 31488.5 32619.5 32076.5 32200.0 30288.5 31665 [5,] 32846.0 32086 33947.0 32018.0 33239.0 32362.0 33274.0 32665.0 32751 [,10] [,11] [,12] [1,] 24144.0 24438.0 23995 [2,] 29525.5 28268.5 27233 [3,] 30622.0 31226.0 30391 [4,] 33748.0 31987.0 30841 [5,] 34891.0 33919.0 31484 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 25908.14 25570.84 29858.88 26793.39 27937.48 28852.76 27071.23 27363.23 [2,] 31863.86 31527.16 35787.12 31240.61 33910.52 32017.24 31790.77 31618.77 [,9] [,10] [,11] [,12] [1,] 29706.45 28100.39 29005.37 28236.36 [2,] 32865.55 33143.61 33446.63 32545.64 $out [1] 21551 22395 23492 $group [1] 4 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(22067, 26334.5, 28886, 31321, 32846, 21818, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rjyl1448232456.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,] 26532.0 21309.0 23754.0 28549 30706 30287.0 29491 NA [2,] 27489.0 21684.5 26712.0 29224 31362 31574.5 31101 NA [3,] 28128.0 22650.5 27862.0 30413 32266 32215.5 31985 NA [4,] 29000.5 23965.5 29553.5 31105 33579 32988.0 32787 NA [5,] 30031.0 24689.0 30005.0 33348 34891 33853.0 33643 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 27438.59 21610.12 26565.97 29555.06 31254.81 31570.79 31216 NA [2,] 28817.41 23690.88 29158.03 31270.94 33277.19 32860.21 32754 NA $out [1] 23995 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(26532, 27489, 28128, 29000.5, 30031, 21309, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/694ja1448232456.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,] 3136.369 9259 2645.0 [2,] 3419.785 9724 3585.5 [3,] 3666.788 10318 3837.5 [4,] 3840.897 10763 4975.0 [5,] 4295.677 11930 5001.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3474.716 9844.105 3203.74 [2,] 3858.860 10791.895 4471.26 $out [1] 7489 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3136.3690107238, 3419.78474152318, 3666.78801302539, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19rcj1448232456.ps tmp/19rcj1448232456.png",intern=TRUE)) character(0) > try(system("convert tmp/28rbq1448232456.ps tmp/28rbq1448232456.png",intern=TRUE)) character(0) > try(system("convert tmp/3gc4z1448232456.ps tmp/3gc4z1448232456.png",intern=TRUE)) character(0) > try(system("convert tmp/4imbi1448232456.ps tmp/4imbi1448232456.png",intern=TRUE)) character(0) > try(system("convert tmp/5rjyl1448232456.ps tmp/5rjyl1448232456.png",intern=TRUE)) character(0) > try(system("convert tmp/694ja1448232456.ps tmp/694ja1448232456.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.129 0.355 2.508