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(100.18,99.73,99.69,99.45,99.47,99.56,99.54,99.87,99.73,99.86,99.91,99.91,99.91,99.87,99.77,100.14,100.04,100.11,100.13,100.22,100.59,100.25,99.94,99.85,99.85,99.85,100.15,100.34,100.72,100.61,100.61,100.52,100.64,100.57,100.16,100.2,100.2,99.99,99.69,99.85,99.54,99.67,99.72,99.74,99.97,100.29,100.57,100.77,100.3,100.32,100.32,100.37,100.47,100.68,100.7,100.62,100.52,100.62,100.52,100.57,100.59,100.59,100.56,100.44,100.39,100.51,100.4,100.45,100.42,100.38,100.25,100.34) > 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,] 100.18 99.91 99.85 100.20 100.30 100.59 NA [2,] 99.73 99.87 99.85 99.99 100.32 100.59 NA [3,] 99.69 99.77 100.15 99.69 100.32 100.56 NA [4,] 99.45 100.14 100.34 99.85 100.37 100.44 NA [5,] 99.47 100.04 100.72 99.54 100.47 100.39 NA [6,] 99.56 100.11 100.61 99.67 100.68 100.51 NA [7,] 99.54 100.13 100.61 99.72 100.70 100.40 NA [8,] 99.87 100.22 100.52 99.74 100.62 100.45 NA [9,] 99.73 100.59 100.64 99.97 100.52 100.42 NA [10,] 99.86 100.25 100.57 100.29 100.62 100.38 NA [11,] 99.91 99.94 100.16 100.57 100.52 100.25 NA [12,] 99.91 99.85 100.20 100.77 100.57 100.34 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/1z1yv1492783702.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/2moqb1492783702.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/39a9a1492783702.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/4bksb1492783702.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,] 99.85 99.73 99.69 99.45 99.470 99.56 99.540 99.740 99.73 99.860 [2,] 99.91 99.85 99.69 99.85 99.540 99.67 99.720 99.870 99.97 100.250 [3,] 100.19 99.93 99.96 100.24 100.215 100.31 100.265 100.335 100.47 100.335 [4,] 100.30 100.32 100.32 100.37 100.470 100.61 100.610 100.520 100.59 100.570 [5,] 100.59 100.59 100.56 100.44 100.720 100.68 100.700 100.620 100.64 100.620 [,11] [,12] [1,] 99.910 99.85 [2,] 99.940 99.91 [3,] 100.205 100.27 [4,] 100.520 100.57 [5,] 100.570 100.77 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.93844 99.62683 99.55363 99.90458 99.61512 99.70367 99.69092 [2,] 100.44156 100.23317 100.36637 100.57542 100.81488 100.91633 100.83908 [,8] [,9] [,10] [,11] [,12] [1,] 99.91573 100.0701 100.1286 99.83088 99.84428 [2,] 100.75427 100.8699 100.5414 100.57912 100.69572 $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(99.85, 99.91, 100.19, 100.3, 100.59, 99.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5j5mm1492783702.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,] 99.45 99.770 99.850 99.540 100.300 100.250 NA [2,] 99.55 99.890 100.155 99.705 100.345 100.385 NA [3,] 99.73 100.075 100.430 99.910 100.520 100.430 NA [4,] 99.89 100.180 100.610 100.245 100.620 100.535 NA [5,] 100.18 100.590 100.720 100.770 100.700 100.590 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.57492 99.94273 100.2225 99.6637 100.3946 100.3616 NA [2,] 99.88508 100.20727 100.6375 100.1563 100.6454 100.4984 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(99.45, 99.55, 99.73, 99.89, 100.18, 99.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e4i81492783702.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.2699197 0.660 0.26250 [2,] 0.3045780 0.810 0.41125 [3,] 0.3652176 0.895 0.51000 [4,] 0.4288172 1.055 0.65125 [5,] 0.5136828 1.250 0.80500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.3085513 0.7832539 0.4005344 [2,] 0.4218839 1.0067461 0.6194656 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.269919741157753, 0.304578041412638, 0.365217569177561, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1z1yv1492783702.ps tmp/1z1yv1492783702.png",intern=TRUE)) character(0) > try(system("convert tmp/2moqb1492783702.ps tmp/2moqb1492783702.png",intern=TRUE)) character(0) > try(system("convert tmp/39a9a1492783702.ps tmp/39a9a1492783702.png",intern=TRUE)) character(0) > try(system("convert tmp/4bksb1492783702.ps tmp/4bksb1492783702.png",intern=TRUE)) character(0) > try(system("convert tmp/5j5mm1492783702.ps tmp/5j5mm1492783702.png",intern=TRUE)) character(0) > try(system("convert tmp/6e4i81492783702.ps tmp/6e4i81492783702.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.299 0.269 3.661