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(64076,63136,60198,59057,57388,56708,70019,72263,74152,67057,61941,58331,59252,56568,53031,51840,48290,45817,59421,61621,60976,57497,53037,53088,53119,51644,47866,47691,42401,43069,55797,57170,58335,55439,54399,56316,58381,58468,59025,58298,54255,55670,67816,70485,71361,66953,64505,66770,66418,65277,62008,59096,55106,54954,67943,69411,69951,63966,60410,59440,59445,57614,55396,53030,50090,48764,61658,63943,64878,60634,57905,57224,60953,60621,57258,54903,53278,53042,63753,69210,71446,68408,65427,64630,66086,65058,62689,60841,57346,56222,68202,70745,73690,68992,65925,65546,67221,65315,62038,58774,55320,53900,65544,67906,70911,66544,63657,61720) > 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,] 64076 59252 53119 58381 66418 59445 60953 66086 67221 NA [2,] 63136 56568 51644 58468 65277 57614 60621 65058 65315 NA [3,] 60198 53031 47866 59025 62008 55396 57258 62689 62038 NA [4,] 59057 51840 47691 58298 59096 53030 54903 60841 58774 NA [5,] 57388 48290 42401 54255 55106 50090 53278 57346 55320 NA [6,] 56708 45817 43069 55670 54954 48764 53042 56222 53900 NA [7,] 70019 59421 55797 67816 67943 61658 63753 68202 65544 NA [8,] 72263 61621 57170 70485 69411 63943 69210 70745 67906 NA [9,] 74152 60976 58335 71361 69951 64878 71446 73690 70911 NA [10,] 67057 57497 55439 66953 63966 60634 68408 68992 66544 NA [11,] 61941 53037 54399 64505 60410 57905 65427 65925 63657 NA [12,] 58331 53088 56316 66770 59440 57224 64630 65546 61720 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/199hh1448196980.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/22wgr1448196980.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/3f0na1448196980.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/4aw3a1448196980.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] [,11] [,12] [1,] 53119 51644 47866 47691 42401 43069 55797 57170 58335 55439 53037 53088 [2,] 59252 57614 55396 53030 50090 48764 61658 63943 64878 60634 57905 57224 [3,] 60953 60621 59025 58298 54255 53900 65544 69210 70911 66544 61941 59440 [4,] 66086 65058 62008 59057 55320 55670 67943 70485 71446 67057 64505 64630 [5,] 67221 65315 62689 60841 57388 56708 70019 72263 74152 68992 65925 66770 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 57353.76 56700.49 55542.68 55123.78 51500.53 50262.84 62233.9 65764.55 [2,] 64552.24 64541.51 62507.32 61472.22 57009.47 57537.16 68854.1 72655.45 [,9] [,10] [,11] [,12] [1,] 67451.85 63161.22 58465 55539.51 [2,] 74370.15 69926.78 65417 63340.49 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(53119, 59252, 60953, 66086, 67221, 51644, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5q8rj1448196980.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] [,9] [1,] 56708.0 45817.0 42401.0 54255.0 54954.0 48764.0 53042.0 56222.0 53900.0 [2,] 58694.0 52435.5 47778.5 58339.5 59268.0 54213.0 56080.5 61765.0 60247.0 [3,] 62538.5 54828.0 53759.0 61765.0 62987.0 57759.5 62353.0 65735.5 64486.0 [4,] 68538.0 59336.5 56056.5 67384.5 67180.5 61146.0 66917.5 68597.0 66882.5 [5,] 74152.0 61621.0 58335.0 71361.0 69951.0 64878.0 71446.0 73690.0 70911.0 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 58048.59 51680.41 49983.35 57639.51 59378.06 54597.31 57410.17 62619.38 [2,] 67028.41 57975.59 57534.65 65890.49 66595.94 60921.69 67295.83 68851.62 [,9] [,10] [1,] 61459.5 NA [2,] 67512.5 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(56708, 58694, 62538.5, 68538, 74152, 45817, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m4p11448196980.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,] 4354.401 12888 6027 [2,] 4691.385 13596 6354 [3,] 4820.417 13892 6584 [4,] 4944.142 14905 6870 [5,] 5003.603 15817 7444 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4705.133 13294.96 6348.649 [2,] 4935.701 14489.04 6819.351 $out [1] 5664.024 5230.000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4354.40110054694, 4691.38545667934, 4820.41652657116, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/199hh1448196980.ps tmp/199hh1448196980.png",intern=TRUE)) character(0) > try(system("convert tmp/22wgr1448196980.ps tmp/22wgr1448196980.png",intern=TRUE)) character(0) > try(system("convert tmp/3f0na1448196980.ps tmp/3f0na1448196980.png",intern=TRUE)) character(0) > try(system("convert tmp/4aw3a1448196980.ps tmp/4aw3a1448196980.png",intern=TRUE)) character(0) > try(system("convert tmp/5q8rj1448196980.ps tmp/5q8rj1448196980.png",intern=TRUE)) character(0) > try(system("convert tmp/6m4p11448196980.ps tmp/6m4p11448196980.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.145 0.378 2.552