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(93.55,94.11,94.47,94.38,94.42,94.39,94.42,94.34,94.59,94.63,94.84,94.98,95.19,95.76,96.08,96.04,96.2,96.31,96.3,96.29,96.46,96.66,96.83,97,97.1,97.33,97.31,97.16,97.4,97.4,97.52,97.77,98,98.2,98.48,98.53,98.71,99.03,99.52,99.65,99.98,99.94,100.12,100.17,100.38,100.75,100.84,100.91,100.9,101.15,101.4,101.39,101.55,101.73,101.7,101.65,101.73,101.53,101.58,101.58,101.71,101.71,101.98,101.99,101.95,102.11,102.28,102.32,102.18,102.14,102.29,102.33) > 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,] 93.55 95.19 97.10 98.71 100.90 101.71 NA [2,] 94.11 95.76 97.33 99.03 101.15 101.71 NA [3,] 94.47 96.08 97.31 99.52 101.40 101.98 NA [4,] 94.38 96.04 97.16 99.65 101.39 101.99 NA [5,] 94.42 96.20 97.40 99.98 101.55 101.95 NA [6,] 94.39 96.31 97.40 99.94 101.73 102.11 NA [7,] 94.42 96.30 97.52 100.12 101.70 102.28 NA [8,] 94.34 96.29 97.77 100.17 101.65 102.32 NA [9,] 94.59 96.46 98.00 100.38 101.73 102.18 NA [10,] 94.63 96.66 98.20 100.75 101.53 102.14 NA [11,] 94.84 96.83 98.48 100.84 101.58 102.29 NA [12,] 94.98 97.00 98.53 100.91 101.58 102.33 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/1qt6p1492783739.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/282hl1492783739.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/3kseb1492783739.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/43sre1492783739.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,] 93.550 94.11 94.470 94.380 94.42 94.39 94.42 94.34 94.59 94.630 [2,] 95.190 95.76 96.080 96.040 96.20 96.31 96.30 96.29 96.46 96.660 [3,] 97.905 98.18 98.415 98.405 98.69 98.67 98.82 98.97 99.19 99.475 [4,] 100.900 101.15 101.400 101.390 101.55 101.73 101.70 101.65 101.73 101.530 [5,] 101.710 101.71 101.980 101.990 101.95 102.11 102.28 102.32 102.18 102.140 [,11] [,12] [1,] 94.84 94.98 [2,] 96.83 97.00 [3,] 99.66 99.72 [4,] 101.58 101.58 [5,] 102.29 102.33 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.22187 94.70328 94.98343 94.95408 95.23908 95.17392 95.33683 [2,] 101.58813 101.65672 101.84657 101.85592 102.14092 102.16608 102.30317 [,8] [,9] [,10] [,11] [,12] [1,] 95.51263 95.79068 96.33369 96.5961 96.76575 [2,] 102.42737 102.58932 102.61631 102.7239 102.67425 $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(93.55, 95.19, 97.905, 100.9, 101.71, 94.11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5viuv1492783739.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,] 94.11 95.760 97.10 98.710 101.150 101.710 NA [2,] 94.36 96.060 97.32 99.585 101.395 101.965 NA [3,] 94.42 96.295 97.46 100.050 101.565 102.125 NA [4,] 94.61 96.560 98.10 100.565 101.675 102.285 NA [5,] 94.98 97.000 98.53 100.910 101.730 102.330 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.30597 96.06695 97.10424 99.60302 101.4373 101.979 NA [2,] 94.53403 96.52305 97.81576 100.49698 101.6927 102.271 NA $out [1] 93.55 95.19 100.90 $group [1] 1 2 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(94.11, 94.36, 94.42, 94.61, 94.98, 95.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6imbu1492783739.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.880274 7.350 4.03000 [2,] 2.993292 7.510 4.37875 [3,] 3.046257 7.595 4.58375 [4,] 3.124189 7.790 4.67125 [5,] 3.195910 8.160 4.70000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.986554 7.46729 4.450339 [2,] 3.105960 7.72271 4.717161 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.88027371384503, 2.99329191509159, 3.04625707958162, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qt6p1492783739.ps tmp/1qt6p1492783739.png",intern=TRUE)) character(0) > try(system("convert tmp/282hl1492783739.ps tmp/282hl1492783739.png",intern=TRUE)) character(0) > try(system("convert tmp/3kseb1492783739.ps tmp/3kseb1492783739.png",intern=TRUE)) character(0) > try(system("convert tmp/43sre1492783739.ps tmp/43sre1492783739.png",intern=TRUE)) character(0) > try(system("convert tmp/5viuv1492783739.ps tmp/5viuv1492783739.png",intern=TRUE)) character(0) > try(system("convert tmp/6imbu1492783739.ps tmp/6imbu1492783739.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.018 0.389 5.433