R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(8584,5522,6423,5173,5583,5716,4752,4977,4999,5285,5747,1713,9923,6737,7433,6388,6855,7658,6585,6847,6353,7361,6929,1714,11798,8378,8131,7676,7505,8168,6455,6141,6554,6888,5339,1624,9187,5047,5289,4169,3862,4253,3768,3066,4108,3890,3420,1221,5984,4064,5151,4027,3530,4819,3855,3584,4322,4154,4656,1464,7780,5060,6084,4778,4989,4903,4142,4101,4595,5034,5407,1782,8395,5291,6116,4210,4621,5299,4293,4542,3831,4360,4088,1508) > 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,] 8584 9923 11798 9187 5984 7780 8395 NA [2,] 5522 6737 8378 5047 4064 5060 5291 NA [3,] 6423 7433 8131 5289 5151 6084 6116 NA [4,] 5173 6388 7676 4169 4027 4778 4210 NA [5,] 5583 6855 7505 3862 3530 4989 4621 NA [6,] 5716 7658 8168 4253 4819 4903 5299 NA [7,] 4752 6585 6455 3768 3855 4142 4293 NA [8,] 4977 6847 6141 3066 3584 4101 4542 NA [9,] 4999 6353 6554 4108 4322 4595 3831 NA [10,] 5285 7361 6888 3890 4154 5034 4360 NA [11,] 5747 6929 5339 3420 4656 5407 4088 NA [12,] 1713 1714 1624 1221 1464 1782 1508 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/1y8qc1398519128.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/2kcg21398519128.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/34emp1398519128.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/4guqy1398519128.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] [1,] 5984.0 4064.0 5151.0 4027.0 3530.0 4253 3768.0 3066.0 3831 3890.0 3420 [2,] 8087.5 5053.5 5686.5 4189.5 4241.5 4861 3998.5 3842.5 4215 4257.0 4372 [3,] 8584.0 5291.0 6116.0 4778.0 4989.0 5299 4293.0 4542.0 4595 5034.0 5339 [4,] 9555.0 6129.5 6928.0 5780.5 6219.0 6687 5603.5 5559.0 5676 6086.5 5577 [5,] 9923.0 6737.0 8131.0 7676.0 7505.0 8168 6585.0 6847.0 6554 7361.0 6929 [,12] [1,] 1221.0 [2,] 1486.0 [3,] 1624.0 [4,] 1713.5 [5,] 1782.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,] 7707.633 4648.43 5374.596 3827.88 3808.069 4208.542 3334.52 3516.934 [2,] 9460.367 5933.57 6857.404 5728.12 6169.931 6389.458 5251.48 5567.066 [,9] [,10] [,11] [,12] [1,] 3722.514 3941.452 4619.393 1488.141 [2,] 5467.486 6126.548 6058.607 1759.859 $out [1] 11798 8378 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5984, 8087.5, 8584, 9555, 9923, 4064, 5053.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ew4u1398519128.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,] 4752.0 6353.0 5339.0 3066 3530.0 4101.0 3831 NA [2,] 4988.0 6486.5 6298.0 3594 3719.5 4368.5 4149 NA [3,] 5403.5 6851.0 7196.5 3999 4109.0 4946.0 4451 NA [4,] 5731.5 7397.0 8149.5 4650 4737.5 5233.5 5295 NA [5,] 6423.0 7658.0 8378.0 5289 5984.0 6084.0 6116 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5064.385 6435.715 6352.018 3517.351 3644.683 4551.468 3928.302 NA [2,] 5742.615 7266.285 8040.982 4480.649 4573.317 5340.532 4973.698 NA $out [1] 8584 1713 9923 1714 11798 1624 9187 1221 1464 7780 1782 8395 [13] 1508 $group [1] 1 1 2 2 3 3 4 4 5 6 6 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(4752, 4988, 5403.5, 5731.5, 6423, 6353, 6486.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/687gy1398519128.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,] 1081.925 2723.0 1076.00 [2,] 1117.191 2898.5 1223.25 [3,] 1356.061 3579.0 1529.25 [4,] 1444.951 3945.0 1771.25 [5,] 1806.445 4314.0 1977.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1206.567 3101.684 1279.304 [2,] 1505.554 4056.316 1779.196 $out [1] 193.9677 5814.0000 561.0000 227.5000 $group [1] 1 2 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1081.9248279494, 1117.19051680108, 1356.06057799063, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y8qc1398519128.ps tmp/1y8qc1398519128.png",intern=TRUE)) character(0) > try(system("convert tmp/2kcg21398519128.ps tmp/2kcg21398519128.png",intern=TRUE)) character(0) > try(system("convert tmp/34emp1398519128.ps tmp/34emp1398519128.png",intern=TRUE)) character(0) > try(system("convert tmp/4guqy1398519128.ps tmp/4guqy1398519128.png",intern=TRUE)) character(0) > try(system("convert tmp/5ew4u1398519128.ps tmp/5ew4u1398519128.png",intern=TRUE)) character(0) > try(system("convert tmp/687gy1398519128.ps tmp/687gy1398519128.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.945 0.755 4.727