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(98.41,98.94,99.09,100.45,101.99,102.35,102.69,102.6,102.62,102.73,102.74,103.45,103.9,103.45,103.5,103.33,103.56,103.58,103.86,103.77,103.73,104.21,104.55,104.5,104.66,104.99,104.99,105.62,106.52,106.1,106.73,106.63,106.72,106.5,107.12,106.84,107.25,108.19,108.21,107.98,109.12,109.79,109.69,109.69,109.24,108.55,106.47,107.27,105.95,108.55,110.81,111.54,110.38,106.67,106.45,105.44,105.37,103.72,106.57,108.54,110.36,106.64,103.45,101.36,101.9,100.86,100.37,100.16,99.5,99.52,99.2,99.35,99.37,99.85,99.76,100.07,99.77,99.93,99.16,99.4,99.81,99.67,99.37,99.49,99.28,99.33,99.19,98.11,99.12,99.06,97.41,98.45,100.33,103.18,103.06,103.48,102.8,103.92,103.9,103.96,103.62,103.83,104.09,104.07,103.22,104.01,104.01,104.24) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 98.41 103.90 104.66 107.25 105.95 110.36 99.37 99.28 102.80 NA [2,] 98.94 103.45 104.99 108.19 108.55 106.64 99.85 99.33 103.92 NA [3,] 99.09 103.50 104.99 108.21 110.81 103.45 99.76 99.19 103.90 NA [4,] 100.45 103.33 105.62 107.98 111.54 101.36 100.07 98.11 103.96 NA [5,] 101.99 103.56 106.52 109.12 110.38 101.90 99.77 99.12 103.62 NA [6,] 102.35 103.58 106.10 109.79 106.67 100.86 99.93 99.06 103.83 NA [7,] 102.69 103.86 106.73 109.69 106.45 100.37 99.16 97.41 104.09 NA [8,] 102.60 103.77 106.63 109.69 105.44 100.16 99.40 98.45 104.07 NA [9,] 102.62 103.73 106.72 109.24 105.37 99.50 99.81 100.33 103.22 NA [10,] 102.73 104.21 106.50 108.55 103.72 99.52 99.67 103.18 104.01 NA [11,] 102.74 104.55 107.12 106.47 106.57 99.20 99.37 103.06 104.01 NA [12,] 103.45 104.50 106.84 107.27 108.54 99.35 99.49 103.48 104.24 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/1wf0z1447780167.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/2xf561447780167.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/3uh061447780167.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/4owuz1447780167.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,] 98.41 98.94 99.09 98.11 99.12 99.06 97.41 98.45 99.50 102.73 [2,] 99.37 99.85 99.76 100.45 101.90 100.86 100.37 100.16 100.33 102.73 [3,] 103.90 103.92 103.50 103.33 103.56 103.58 103.86 103.77 103.22 103.72 [4,] 105.95 106.64 104.99 105.62 106.52 106.10 106.45 105.44 105.37 104.21 [5,] 110.36 108.55 110.81 111.54 110.38 109.79 109.69 109.69 109.24 104.21 [,11] [,12] [1,] 99.20 99.35 [2,] 102.74 103.45 [3,] 104.01 104.24 [4,] 106.47 106.84 [5,] 107.12 108.54 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.4345 100.3439 100.7455 100.6071 101.1268 100.8203 100.6579 100.9892 [2,] 107.3655 107.4961 106.2545 106.0529 105.9932 106.3397 107.0621 106.5508 [,9] [,10] [,11] [,12] [1,] 100.5656 102.9405 102.0455 102.4546 [2,] 105.8744 104.4995 105.9745 106.0254 $out [1] 106.50 108.55 99.52 99.67 $group [1] 10 10 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.41, 99.37, 103.9, 105.95, 110.36, 98.94, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o3r61447780167.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] [,9] [1,] 98.410 103.330 104.660 106.470 103.720 99.200 99.160 97.410 103.620 [2,] 99.770 103.530 105.305 107.625 105.695 99.510 99.385 98.755 103.725 [3,] 102.475 103.750 106.510 108.380 106.620 100.615 99.715 99.235 103.940 [4,] 102.710 104.055 106.725 109.465 109.465 102.675 99.830 101.695 104.040 [5,] 103.450 104.550 107.120 109.790 111.540 106.640 100.070 103.480 104.240 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.134 103.5105 105.8623 107.5408 104.9005 99.17142 99.51203 97.89405 [2,] 103.816 103.9895 107.1577 109.2192 108.3395 102.05858 99.91797 100.57595 [,9] [,10] [1,] 103.7963 NA [2,] 104.0837 NA $out [1] 110.36 102.80 103.22 $group [1] 6 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(98.41, 99.77, 102.475, 102.71, 103.45, 103.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e7n91447780167.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.882729 7.920 3.390 [2,] 3.252928 9.400 4.175 [3,] 3.682644 10.985 5.200 [4,] 3.983946 11.835 5.680 [5,] 4.243406 13.430 6.790 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.349222 9.87438 4.513559 [2,] 4.016066 12.09562 5.886441 $out [1] 1.48 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.88272922380472, 3.25292840669918, 3.6826441949355, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wf0z1447780167.ps tmp/1wf0z1447780167.png",intern=TRUE)) character(0) > try(system("convert tmp/2xf561447780167.ps tmp/2xf561447780167.png",intern=TRUE)) character(0) > try(system("convert tmp/3uh061447780167.ps tmp/3uh061447780167.png",intern=TRUE)) character(0) > try(system("convert tmp/4owuz1447780167.ps tmp/4owuz1447780167.png",intern=TRUE)) character(0) > try(system("convert tmp/5o3r61447780167.ps tmp/5o3r61447780167.png",intern=TRUE)) character(0) > try(system("convert tmp/6e7n91447780167.ps tmp/6e7n91447780167.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.126 0.386 2.524