R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(5119676,4737614,5425255,5195396,5779583,6298652,6175944,6217653,6086619,5060250,3950207,3096398,3287215,2970037,3436547,3339099,3661160,3675026,3917675,3942501,3848079,3993974,3977059,4406890,4827736,4507189,5249062,5009908,5195771,5079423,5531062,5109363,4773753,5347125,5379543,6114549,6346091,5900935,7265533,6115096,7062343,7027841,6644644,7359822,7192534,7065705,7788175,6934803,7492202,8478866,8748316,8382956,8414863,7501787,8031203,9198243,8500998,9260617,9494903,8791918,8568871,8570003,8066695,7800532,8136832,7713840,7986953,7479868,7917564,8055845,7490221,7648110) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 5119676 3287215 4827736 6346091 7492202 8568871 NA [2,] 4737614 2970037 4507189 5900935 8478866 8570003 NA [3,] 5425255 3436547 5249062 7265533 8748316 8066695 NA [4,] 5195396 3339099 5009908 6115096 8382956 7800532 NA [5,] 5779583 3661160 5195771 7062343 8414863 8136832 NA [6,] 6298652 3675026 5079423 7027841 7501787 7713840 NA [7,] 6175944 3917675 5531062 6644644 8031203 7986953 NA [8,] 6217653 3942501 5109363 7359822 9198243 7479868 NA [9,] 6086619 3848079 4773753 7192534 8500998 7917564 NA [10,] 5060250 3993974 5347125 7065705 9260617 8055845 NA [11,] 3950207 3977059 5379543 7788175 9494903 7490221 NA [12,] 3096398 4406890 6114549 6934803 8791918 7648110 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/12ed41432120384.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/212ht1432120384.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/3ed4e1432120384.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/4nw7j1432120384.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,] 3287215 2970037 3436547 3339099 3661160 3675026 3917675 3942501 3848079 [2,] 4827736 4507189 5249062 5009908 5195771 5079423 5531062 5109363 4773753 [3,] 5732884 5319274 6345394 5655246 6420963 6663246 6410294 6788738 6639576 [4,] 7492202 8478866 8066695 7800532 8136832 7501787 7986953 7479868 7917564 [5,] 8568871 8570003 8748316 8382956 8414863 7713840 8031203 9198243 8500998 [,10] [,11] [,12] [1,] 3993974 3950207 3096398 [2,] 5060250 3977059 4406890 [3,] 6206415 6434882 6524676 [4,] 8055845 7788175 7648110 [5,] 9260617 9494903 8791918 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 4014217 2757415 4527930 3855203 4523884 5100743 4826165 5259685 4611717 [2,] 7451550 7881134 8162858 7455289 8318042 8225750 7994423 8317790 8667436 [,10] [,11] [,12] [1,] 4274159 3976589 4433984 [2,] 8138671 8893175 8615368 $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(3287215, 4827736, 5732883.5, 7492202, 8568871, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51gz91432120384.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] [1,] 3096398 2970037 4507189 5900935 7492202 7479868 NA [2,] 4898932 3387823 4918822 6495368 8207080 7680975 NA [3,] 5310326 3761552 5152567 7045092 8489932 7952258 NA [4,] 6131282 3959780 5363334 7229034 8995080 8101764 NA [5,] 6298652 4406890 5531062 7788175 9494903 8570003 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4748243 3500679 4949822 6710462 8130519 7760334 NA [2,] 5872408 4022426 5355312 7379722 8849345 8144183 NA $out [1] 6114549 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(3096398, 4898932, 5310325.5, 6131281.5, 6298652, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zezh1432120384.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,] 1562317 4038814 1959093 [2,] 1828839 4703311 2184187 [3,] 1899098 5261192 2549890 [4,] 2055907 5428232 2656160 [5,] 2264773 5695520 3269588 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1795531 4930551 2334620 [2,] 2002666 5591834 2765160 $out [1] 3386006 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1562317.21460136, 1828838.84759828, 1899098.48686023, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12ed41432120384.ps tmp/12ed41432120384.png",intern=TRUE)) character(0) > try(system("convert tmp/212ht1432120384.ps tmp/212ht1432120384.png",intern=TRUE)) character(0) > try(system("convert tmp/3ed4e1432120384.ps tmp/3ed4e1432120384.png",intern=TRUE)) character(0) > try(system("convert tmp/4nw7j1432120384.ps tmp/4nw7j1432120384.png",intern=TRUE)) character(0) > try(system("convert tmp/51gz91432120384.ps tmp/51gz91432120384.png",intern=TRUE)) character(0) > try(system("convert tmp/6zezh1432120384.ps tmp/6zezh1432120384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.109 0.462 2.565