R version 3.2.4 (2016-03-10) -- "Very Secure Dishes" Copyright (C) 2016 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.78,97.73,97.61,97.69,97.68,97.67,97.67,97.96,98.27,99.52,99.59,99.75,99.75,99.8,99.99,100.25,100.08,100.08,100.08,100.06,101,101.81,101.82,101.96,101.96,101.93,102.03,102.11,102.07,102.34,102.34,102.33,102.77,103.08,103.38,103.44,99.1,99.15,99.21,99.01,99.08,99.11,100.11,100.31,100.55,101.38,101.49,101.5,100.69,100.8,100.58,100.34,100.38,100.33,101.06,101.15,101.36,101.98,102.24,102.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] 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.78 99.75 101.96 99.10 100.69 NA [2,] 97.73 99.80 101.93 99.15 100.80 NA [3,] 97.61 99.99 102.03 99.21 100.58 NA [4,] 97.69 100.25 102.11 99.01 100.34 NA [5,] 97.68 100.08 102.07 99.08 100.38 NA [6,] 97.67 100.08 102.34 99.11 100.33 NA [7,] 97.67 100.08 102.34 100.11 101.06 NA [8,] 97.96 100.06 102.33 100.31 101.15 NA [9,] 98.27 101.00 102.77 100.55 101.36 NA [10,] 99.52 101.81 103.08 101.38 101.98 NA [11,] 99.59 101.82 103.38 101.49 102.24 NA [12,] 99.75 101.96 103.44 101.50 102.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/1d3mq1458310213.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/2hcuo1458310213.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/379eh1458310213.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/49w1f1458310213.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.78 97.73 97.61 97.69 97.68 97.67 100.08 100.06 100.55 101.38 [2,] 99.10 99.15 99.21 99.01 99.08 99.11 100.08 100.06 100.55 101.38 [3,] 99.75 99.80 99.99 100.25 100.08 100.08 100.11 100.31 101.00 101.81 [4,] 100.69 100.80 100.58 100.34 100.38 100.33 101.06 101.15 101.36 101.98 [5,] 101.96 101.93 102.03 102.11 102.07 100.33 102.34 102.33 101.36 101.98 [,11] [,12] [1,] 101.49 101.50 [2,] 101.49 101.50 [3,] 101.82 101.96 [4,] 102.24 102.34 [5,] 102.24 103.44 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.62651 98.63411 99.02196 99.31023 99.16142 99.21795 99.41753 [2,] 100.87349 100.96589 100.95804 101.18977 100.99858 100.94205 100.80247 [,8] [,9] [,10] [,11] [,12] [1,] 99.53981 100.4277 101.386 101.2901 101.3665 [2,] 101.08019 101.5723 102.234 102.3499 102.5535 $out [1] 102.34 97.67 97.96 98.27 102.77 99.52 103.08 99.59 103.38 99.75 $group [1] 6 7 8 9 9 10 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(97.78, 99.1, 99.75, 100.69, 101.96, 97.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tvtn1458310213.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.610 99.750 101.930 99.010 100.33 NA [2,] 97.675 100.025 102.050 99.105 100.48 NA [3,] 97.755 100.080 102.335 99.660 100.93 NA [4,] 98.895 101.405 102.925 100.965 101.67 NA [5,] 99.750 101.960 103.440 101.500 102.34 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 97.19855 99.45057 101.9359 98.81164 100.3872 NA [2,] 98.31145 100.70943 102.7341 100.50836 101.4728 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.61, 97.675, 97.755, 98.895, 99.75, 99.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zn0t1458310213.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,] 1.298376 3.560 0.600 [2,] 1.481472 3.985 0.825 [3,] 1.617121 4.380 1.155 [4,] 1.643185 4.460 1.350 [5,] 1.715206 4.670 1.650 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.543363 4.163349 0.915544 [2,] 1.690880 4.596651 1.394456 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.29837590858734, 1.48147229466059, 1.6171213586293, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d3mq1458310213.ps tmp/1d3mq1458310213.png",intern=TRUE)) character(0) > try(system("convert tmp/2hcuo1458310213.ps tmp/2hcuo1458310213.png",intern=TRUE)) character(0) > try(system("convert tmp/379eh1458310213.ps tmp/379eh1458310213.png",intern=TRUE)) character(0) > try(system("convert tmp/49w1f1458310213.ps tmp/49w1f1458310213.png",intern=TRUE)) character(0) > try(system("convert tmp/5tvtn1458310213.ps tmp/5tvtn1458310213.png",intern=TRUE)) character(0) > try(system("convert tmp/6zn0t1458310213.ps tmp/6zn0t1458310213.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.372 0.432 2.823