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(1.4718,1.4748,1.5527,1.5751,1.5557,1.5553,1.577,1.4975,1.4369,1.3322,1.2732,1.3449,1.3239,1.2785,1.305,1.319,1.365,1.4016,1.4088,1.4268,1.4562,1.4816,1.4914,1.4614,1.4272,1.3686,1.3569,1.3406,1.2565,1.2209,1.277,1.2894,1.3067,1.3898,1.3661,1.322,1.336,1.3649,1.3999,1.4442,1.4349,1.4388,1.4264,1.4343,1.377,1.3706,1.3556,1.3179,1.2905,1.3224,1.3201,1.3162,1.2789,1.2526,1.2288,1.24,1.2856,1.2974,1.2828,1.3119,1.3288,1.3359,1.2964,1.3026,1.2982,1.3189,1.308,1.331,1.3348,1.3635,1.3493,1.3704,1.361,1.3658,1.3823,1.3812,1.3732,1.3592,1.3539,1.3316,1.2901,1.2673,1.2472,1.2331) > 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,] 1.4718 1.3239 1.4272 1.3360 1.2905 1.3288 1.3610 NA [2,] 1.4748 1.2785 1.3686 1.3649 1.3224 1.3359 1.3658 NA [3,] 1.5527 1.3050 1.3569 1.3999 1.3201 1.2964 1.3823 NA [4,] 1.5751 1.3190 1.3406 1.4442 1.3162 1.3026 1.3812 NA [5,] 1.5557 1.3650 1.2565 1.4349 1.2789 1.2982 1.3732 NA [6,] 1.5553 1.4016 1.2209 1.4388 1.2526 1.3189 1.3592 NA [7,] 1.5770 1.4088 1.2770 1.4264 1.2288 1.3080 1.3539 NA [8,] 1.4975 1.4268 1.2894 1.4343 1.2400 1.3310 1.3316 NA [9,] 1.4369 1.4562 1.3067 1.3770 1.2856 1.3348 1.2901 NA [10,] 1.3322 1.4816 1.3898 1.3706 1.2974 1.3635 1.2673 NA [11,] 1.2732 1.4914 1.3661 1.3556 1.2828 1.3493 1.2472 NA [12,] 1.3449 1.4614 1.3220 1.3179 1.3119 1.3704 1.2331 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/1pta21447779654.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/24d2a1447779654.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/30n7s1447779654.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/4bs8c1447779654.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,] 1.29050 1.27850 1.29640 1.3026 1.25650 1.22090 1.2288 1.24000 1.28560 [2,] 1.32635 1.32915 1.31255 1.3176 1.28855 1.28575 1.2925 1.31020 1.29840 [3,] 1.33600 1.36490 1.35690 1.3406 1.36500 1.35920 1.3539 1.33160 1.33480 [4,] 1.39410 1.36720 1.39110 1.4127 1.40405 1.42020 1.4176 1.43055 1.40695 [5,] 1.47180 1.36860 1.39990 1.4442 1.55570 1.55530 1.5770 1.49750 1.45620 [,10] [,11] [,12] [1,] 1.2673 1.24720 1.31190 [2,] 1.3148 1.27800 1.31490 [3,] 1.3635 1.34930 1.32200 [4,] 1.3802 1.36085 1.35765 [5,] 1.3898 1.36610 1.37040 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.295541 1.342177 1.309991 1.283808 1.296025 1.278909 1.279192 1.259729 [2,] 1.376459 1.387623 1.403809 1.397392 1.433975 1.439491 1.428608 1.403471 [,9] [,10] [,11] [,12] [1,] 1.269976 1.324444 1.299823 1.29647 [2,] 1.399624 1.402556 1.398777 1.34753 $out [1] 1.4748 1.5527 1.5751 1.4816 1.4914 1.4614 1.2331 $group [1] 2 3 4 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.2905, 1.32635, 1.336, 1.3941, 1.4718, 1.2785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54ep11447779654.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,] 1.27320 1.27850 1.22090 1.31790 1.22880 1.2964 1.23310 NA [2,] 1.39090 1.32145 1.28320 1.36025 1.26575 1.3053 1.27870 NA [3,] 1.48615 1.40520 1.33130 1.38845 1.28805 1.3299 1.35655 NA [4,] 1.55550 1.45880 1.36735 1.43460 1.31405 1.3426 1.36950 NA [5,] 1.57700 1.49140 1.42720 1.44420 1.32240 1.3704 1.38230 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.411075 1.342554 1.292919 1.354538 1.26602 1.312887 1.315136 NA [2,] 1.561225 1.467846 1.369681 1.422362 1.31008 1.346913 1.397964 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.2732, 1.3909, 1.48615, 1.5555, 1.577, 1.2785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67c0p1447779654.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,] 0.06046437 0.17060 0.038050 [2,] 0.06934614 0.20530 0.066575 [3,] 0.08504013 0.25025 0.088975 [4,] 0.10096023 0.28585 0.117925 [5,] 0.11562185 0.34820 0.134450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.07062073 0.2135106 0.06555392 [2,] 0.09945953 0.2869894 0.11239608 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.060464369673387, 0.0693461377661309, 0.0850401310259984, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pta21447779654.ps tmp/1pta21447779654.png",intern=TRUE)) character(0) > try(system("convert tmp/24d2a1447779654.ps tmp/24d2a1447779654.png",intern=TRUE)) character(0) > try(system("convert tmp/30n7s1447779654.ps tmp/30n7s1447779654.png",intern=TRUE)) character(0) > try(system("convert tmp/4bs8c1447779654.ps tmp/4bs8c1447779654.png",intern=TRUE)) character(0) > try(system("convert tmp/54ep11447779654.ps tmp/54ep11447779654.png",intern=TRUE)) character(0) > try(system("convert tmp/67c0p1447779654.ps tmp/67c0p1447779654.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.096 0.412 2.531