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(3200944,3153170,3741498,3918719,4403449,4400407,4847473,4716136,4297440,4272253,3271834,3168388,2911748,2720999,3199918,3672623,3892013,3850845,4532467,4484739,4014972,3983758,3158459,3100569,2935404,2855719,3465611,3006985,4095110,4104793,4730788,4642726,4246919,4308032,3508154,3236641,3257275,3045631,3657692,4125747,4472507,4513455,5150896,5057815,4681742,4603682,3580181,3534002,3422762,3295209,3868093,4189245,4544332,4612845,5221595,5137505,4760439,4643697,3692267,3587603) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3200944 2911748 2935404 3257275 3422762 NA [2,] 3153170 2720999 2855719 3045631 3295209 NA [3,] 3741498 3199918 3465611 3657692 3868093 NA [4,] 3918719 3672623 3006985 4125747 4189245 NA [5,] 4403449 3892013 4095110 4472507 4544332 NA [6,] 4400407 3850845 4104793 4513455 4612845 NA [7,] 4847473 4532467 4730788 5150896 5221595 NA [8,] 4716136 4484739 4642726 5057815 5137505 NA [9,] 4297440 4014972 4246919 4681742 4760439 NA [10,] 4272253 3983758 4308032 4603682 4643697 NA [11,] 3271834 3158459 3508154 3580181 3692267 NA [12,] 3168388 3100569 3236641 3534002 3587603 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/1sc031399317034.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/2qih91399317034.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/3jxx41399317034.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/4bkxu1399317034.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,] 2911748 2720999 3199918 3006985 3892013 3850845 4532467 4484739 4014972 [2,] 2935404 2855719 3465611 3672623 4095110 4104793 4730788 4642726 4246919 [3,] 3200944 3045631 3657692 3918719 4403449 4400407 4847473 4716136 4297440 [4,] 3257275 3153170 3741498 4125747 4472507 4513455 5150896 5057815 4681742 [5,] 3422762 3295209 3868093 4189245 4544332 4612845 5221595 5137505 4760439 [,10] [,11] [,12] [1,] 3983758 3158459 3100569 [2,] 4272253 3271834 3168388 [3,] 4308032 3508154 3236641 [4,] 4603682 3580181 3534002 [5,] 4643697 3692267 3587603 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2973511 2835453 3462751 3598543 4136781 4111647 4550626 4422835 3990195 [2,] 3428377 3255809 3852633 4238895 4670117 4689167 5144320 5009437 4604685 [,10] [,11] [,12] [1,] 4073845 3290277 2978299 [2,] 4542219 3726031 3494983 $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(2911748, 2935404, 3200944, 3257275, 3422762, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dn671399317034.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] [1,] 3153170 2720999 2855719 3045631 3295209 NA [2,] 3236389 3129514 3121813 3557092 3639935 NA [3,] 4095486 3761734 3801632 4299127 4366788 NA [4,] 4401928 3999365 4277476 4642712 4702068 NA [5,] 4847473 4532467 4730788 5150896 5221595 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3563876 3364989 3274527 3803968 3882343 NA [2,] 4627096 4158479 4328737 4794286 4851234 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(3153170, 3236389, 4095486, 4401928, 4847473, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g4pa1399317034.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,] 218644.8 487034.0 275887.0 [2,] 225185.7 554009.0 315109.0 [3,] 273536.9 656352.5 371505.5 [4,] 300643.0 717297.5 417598.5 [5,] 313568.3 762000.0 453124.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 239120.3 581875.5 324759.4 [2,] 307953.5 730829.5 418251.6 $out [1] 478359.7 1182260.0 $group [1] 1 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(218644.775256122, 225185.667092389, 273536.864704972, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1sc031399317034.ps tmp/1sc031399317034.png",intern=TRUE)) character(0) > try(system("convert tmp/2qih91399317034.ps tmp/2qih91399317034.png",intern=TRUE)) character(0) > try(system("convert tmp/3jxx41399317034.ps tmp/3jxx41399317034.png",intern=TRUE)) character(0) > try(system("convert tmp/4bkxu1399317034.ps tmp/4bkxu1399317034.png",intern=TRUE)) character(0) > try(system("convert tmp/5dn671399317034.ps tmp/5dn671399317034.png",intern=TRUE)) character(0) > try(system("convert tmp/6g4pa1399317034.ps tmp/6g4pa1399317034.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.935 0.582 3.553