R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(14724,14404,14058,13427,19946,19631,14724,11462,11778,11778,12093,12760,13742,13427,11462,11778,20929,22893,17666,14724,15387,15707,17351,18964,19315,16022,16369,12093,24222,27800,19631,17004,18649,20613,23555,27164,27164,24853,23871,17982,27800,32391,28462,24222,24853,27164,30426,34355,31724,30111,30111,24853,32391,37297,33373,29129,30426,35653,37964,41222,38595,34355,33373,25520,30742,36315,30111,26502,30111,33689,35653,40906,38280,31724,32391,26186,31409,36000,30742,27164,30426,34355,33689,41542,40244,35017,35333,28462,32706,39262,34355,31409,36315,39262,36982,47431,44835,38946,37297,29764,34035,37964,33053,33053,38595,41542,39924,51355,48413,42871,40560,32391,35333,40560,36631,35653,40244,44168,39924,50057) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 14724 13742 19315 27164 31724 38595 38280 40244 44835 48413 NA [2,] 14404 13427 16022 24853 30111 34355 31724 35017 38946 42871 NA [3,] 14058 11462 16369 23871 30111 33373 32391 35333 37297 40560 NA [4,] 13427 11778 12093 17982 24853 25520 26186 28462 29764 32391 NA [5,] 19946 20929 24222 27800 32391 30742 31409 32706 34035 35333 NA [6,] 19631 22893 27800 32391 37297 36315 36000 39262 37964 40560 NA [7,] 14724 17666 19631 28462 33373 30111 30742 34355 33053 36631 NA [8,] 11462 14724 17004 24222 29129 26502 27164 31409 33053 35653 NA [9,] 11778 15387 18649 24853 30426 30111 30426 36315 38595 40244 NA [10,] 11778 15707 20613 27164 35653 33689 34355 39262 41542 44168 NA [11,] 12093 17351 23555 30426 37964 35653 33689 36982 39924 39924 NA [12,] 12760 18964 27164 34355 41222 40906 41542 47431 51355 50057 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/1lfh21469179611.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/2wuot1469179611.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/33qjc1469179611.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/4a8pc1469179611.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,] 13742 13427.0 11462 11778.0 19946.0 19631.0 14724.0 11462 11778.0 11778 [2,] 19315 16022.0 16369 13427.0 24222.0 27800.0 19631.0 17004 18649.0 20613 [3,] 35002 30917.5 31251 25186.5 31075.5 36157.5 30426.5 26833 30268.5 34022 [4,] 40244 35017.0 35333 28462.0 32706.0 37964.0 33373.0 31409 36315.0 39262 [5,] 48413 42871.0 40560 32391.0 35333.0 40560.0 36631.0 35653 40244.0 44168 [,11] [,12] [1,] 12093 12760 [2,] 23555 27164 [3,] 34671 41064 [4,] 37964 47431 [5,] 39924 51355 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24545.04 21426.84 21775.83 17674.41 26836.56 31079.16 23560.45 19635.69 [2,] 45458.96 40408.16 40726.17 32698.59 35314.44 41235.84 37292.55 34030.31 [,9] [,10] [,11] [,12] [1,] 21441.86 24704.22 27471.69 30937.8 [2,] 39095.14 43339.78 41870.31 51190.2 $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(13742, 19315, 35002, 40244, 48413, 13427, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rdcz1469179611.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,] 11462.0 11462.0 12093.0 17982.0 24853.0 25520 26186.0 28462.0 29764.0 [2,] 11935.5 13584.5 16686.5 24537.5 30111.0 30111 30584.0 33530.5 33544.0 [3,] 13742.5 15547.0 19473.0 27164.0 32057.5 33531 32057.5 35824.0 38279.5 [4,] 14724.0 18315.0 23888.5 29444.0 36475.0 35984 35177.5 39262.0 40733.0 [5,] 14724.0 22893.0 27800.0 34355.0 41222.0 40906 41542.0 47431.0 51355.0 [,10] [,11] [1,] 32391.0 NA [2,] 36142.0 NA [3,] 40402.0 NA [4,] 43519.5 NA [5,] 50057.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12470.65 13389.39 16188.12 24926.11 29154.84 30852.29 29962.37 33209.82 [2,] 15014.35 17704.61 22757.88 29401.89 34960.16 36209.71 34152.63 38438.18 [,9] [,10] [,11] [1,] 35000.55 37037.07 NA [2,] 41558.45 43766.93 NA $out [1] 19946 19631 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(11462, 11935.5, 13742.5, 14724, 14724, 11462, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68bz91469179611.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,] 5486.254 15387.0 7510.75 [2,] 7724.884 21418.0 11742.38 [3,] 9824.726 28148.5 13985.00 [4,] 10834.177 30917.0 16610.12 [5,] 13139.785 38595.0 18554.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8406.557 23815.94 11764.79 [2,] 11242.895 32481.06 16205.21 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5486.25352940318, 7724.88394747964, 9824.72623640426, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lfh21469179611.ps tmp/1lfh21469179611.png",intern=TRUE)) character(0) > try(system("convert tmp/2wuot1469179611.ps tmp/2wuot1469179611.png",intern=TRUE)) character(0) > try(system("convert tmp/33qjc1469179611.ps tmp/33qjc1469179611.png",intern=TRUE)) character(0) > try(system("convert tmp/4a8pc1469179611.ps tmp/4a8pc1469179611.png",intern=TRUE)) character(0) > try(system("convert tmp/5rdcz1469179611.ps tmp/5rdcz1469179611.png",intern=TRUE)) character(0) > try(system("convert tmp/68bz91469179611.ps tmp/68bz91469179611.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.155 0.212 2.401