R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(97.96,98.36,98.36,98.51,98.77,98.78,98.89,98.87,99.05,99.09,99.1,99.12,99.37,99.46,99.6,99.87,99.88,100.01,100.02,100.19,100.2,100.35,100.47,100.57,101.41,101.67,101.82,101.86,101.98,102.06,102.17,102.2,102.35,102.47,102.55,102.62,102.81,102.88,102.94,102.95,102.94,103.05,103.09,103.1,103.14,103.19,103.36,103.43,103.62,103.79,103.9,103.92,103.94,103.98,104.04,104.09,104.16,104.22,104.28,104.32) > 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,] 97.96 99.37 101.41 102.81 103.62 NA [2,] 98.36 99.46 101.67 102.88 103.79 NA [3,] 98.36 99.60 101.82 102.94 103.90 NA [4,] 98.51 99.87 101.86 102.95 103.92 NA [5,] 98.77 99.88 101.98 102.94 103.94 NA [6,] 98.78 100.01 102.06 103.05 103.98 NA [7,] 98.89 100.02 102.17 103.09 104.04 NA [8,] 98.87 100.19 102.20 103.10 104.09 NA [9,] 99.05 100.20 102.35 103.14 104.16 NA [10,] 99.09 100.35 102.47 103.19 104.22 NA [11,] 99.10 100.47 102.55 103.36 104.28 NA [12,] 99.12 100.57 102.62 103.43 104.32 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/1kxxu1493147416.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/2f0oj1493147416.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/3rbot1493147416.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/4f5ko1493147416.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,] 97.96 98.36 98.36 98.51 98.77 98.78 98.89 98.87 99.05 99.09 [2,] 99.37 99.46 99.60 99.87 99.88 100.01 100.02 100.19 100.20 100.35 [3,] 101.41 101.67 101.82 101.86 101.98 102.06 102.17 102.20 102.35 102.47 [4,] 102.81 102.88 102.94 102.95 102.94 103.05 103.09 103.10 103.14 103.19 [5,] 103.62 103.79 103.90 103.92 103.94 103.98 104.04 104.09 104.16 104.22 [,11] [,12] [1,] 99.10 99.12 [2,] 100.47 100.57 [3,] 102.55 102.62 [4,] 103.36 103.43 [5,] 104.28 104.32 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.9793 99.25344 99.45996 99.68368 99.81781 99.91194 100.0007 [2,] 103.8407 104.08656 104.18004 104.03632 104.14219 104.20806 104.3393 [,8] [,9] [,10] [,11] [,12] [1,] 100.1438 100.2726 100.4633 100.5079 100.5991 [2,] 104.2562 104.4274 104.4767 104.5921 104.6409 $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(97.96, 99.37, 101.41, 102.81, 103.62, 98.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k3fm1493147416.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,] 97.960 99.370 101.410 102.810 103.62 NA [2,] 98.435 99.735 101.840 102.940 103.91 NA [3,] 98.825 100.015 102.115 103.070 104.01 NA [4,] 99.070 100.275 102.410 103.165 104.19 NA [5,] 99.120 100.570 102.620 103.430 104.32 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 98.53537 99.7687 101.855 102.9674 103.8823 NA [2,] 99.11463 100.2613 102.375 103.1726 104.1377 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.96, 98.435, 98.825, 99.07, 99.12, 99.37, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62gr41493147416.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,] 2.101400 5.11 2.84 [2,] 2.128384 5.16 2.90 [3,] 2.140828 5.20 3.05 [4,] 2.249608 5.42 3.21 [5,] 2.355914 5.66 3.44 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.085537 5.081412 2.908607 [2,] 2.196119 5.318588 3.191393 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.10139953364418, 2.12838362476748, 2.14082810658987, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kxxu1493147416.ps tmp/1kxxu1493147416.png",intern=TRUE)) character(0) > try(system("convert tmp/2f0oj1493147416.ps tmp/2f0oj1493147416.png",intern=TRUE)) character(0) > try(system("convert tmp/3rbot1493147416.ps tmp/3rbot1493147416.png",intern=TRUE)) character(0) > try(system("convert tmp/4f5ko1493147416.ps tmp/4f5ko1493147416.png",intern=TRUE)) character(0) > try(system("convert tmp/5k3fm1493147416.ps tmp/5k3fm1493147416.png",intern=TRUE)) character(0) > try(system("convert tmp/62gr41493147416.ps tmp/62gr41493147416.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.668 0.445 4.641