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(79.58,80.08,80.41,80.34,80.32,80.39,81.01,81.54,82.48,84.68,88.26,90.6,92.46,93.31,93.58,93.92,93.92,93.67,93.76,93.95,93.89,94.07,93.93,93.35,93.58,93.55,93.44,93.38,93.17,92.95,93.37,94.13,94.07,94,94.47,94.81,94.18,94.14,93.96,93.23,93.13,92.51,92.49,92.73,92.75,92.83,92.85,93.27,93.98,94.34,94.57,94.62,94.82,95.07,95.72,96.06,96.54,96.38,96.8,97.02,97.29,97.45,97.95,97.69,97.63,97.35,97.38,98.06,98.34,98.53,98.79,98.77,99.2,99.76,99.84,99.83,99.88,99.48,99.66,99.58,99.89,100.7,101.19,100.99,101.52,101.75,101.56,102.57,102.66,102.62,102.76,102.73,102.26,101.72,101.48,100.93) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 79.58 92.46 93.58 94.18 93.98 97.29 99.20 101.52 NA [2,] 80.08 93.31 93.55 94.14 94.34 97.45 99.76 101.75 NA [3,] 80.41 93.58 93.44 93.96 94.57 97.95 99.84 101.56 NA [4,] 80.34 93.92 93.38 93.23 94.62 97.69 99.83 102.57 NA [5,] 80.32 93.92 93.17 93.13 94.82 97.63 99.88 102.66 NA [6,] 80.39 93.67 92.95 92.51 95.07 97.35 99.48 102.62 NA [7,] 81.01 93.76 93.37 92.49 95.72 97.38 99.66 102.76 NA [8,] 81.54 93.95 94.13 92.73 96.06 98.06 99.58 102.73 NA [9,] 82.48 93.89 94.07 92.75 96.54 98.34 99.89 102.26 NA [10,] 84.68 94.07 94.00 92.83 96.38 98.53 100.70 101.72 NA [11,] 88.26 93.93 94.47 92.85 96.80 98.79 101.19 101.48 NA [12,] 90.60 93.35 94.81 93.27 97.02 98.77 100.99 100.93 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/1a2zv1447712809.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/24qaq1447712809.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/3wwhm1447712809.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/4mv8y1447712809.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] [1,] 92.460 93.310 93.440 93.230 93.130 92.510 92.49 92.730 92.750 [2,] 93.020 93.430 93.510 93.305 93.150 92.730 92.93 93.340 93.320 [3,] 94.080 94.240 94.265 94.270 94.370 94.370 94.74 95.095 95.305 [4,] 98.245 98.605 98.895 98.760 98.755 98.415 98.52 98.820 99.115 [5,] 101.520 101.750 101.560 102.570 102.660 102.620 102.76 102.730 102.260 [,10] [,11] [,12] [1,] 84.680 88.260 90.600 [2,] 93.415 93.390 93.310 [3,] 95.225 95.635 95.915 [4,] 99.615 99.990 99.850 [5,] 101.720 101.480 100.990 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.16124 91.34917 91.25686 91.22276 91.23897 91.19428 91.61735 92.03379 [2,] 96.99876 97.13083 97.27314 97.31724 97.50103 97.54572 97.86265 98.15621 [,9] [,10] [,11] [,12] [1,] 92.06783 91.76159 91.94815 92.26166 [2,] 98.54217 98.68841 99.32185 99.56834 $out [1] 79.58 80.08 80.41 80.34 80.32 80.39 81.01 81.54 82.48 $group [1] 1 2 3 4 5 6 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(92.46, 93.02, 94.08, 98.245, 101.52, 93.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rhtp1447712809.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,] 79.58 93.310 92.950 92.490 93.980 97.290 99.200 100.930 NA [2,] 80.33 93.465 93.375 92.740 94.595 97.415 99.620 101.540 NA [3,] 80.71 93.825 93.565 92.990 95.395 97.820 99.835 102.005 NA [4,] 83.58 93.925 94.100 93.615 96.460 98.435 100.295 102.640 NA [5,] 88.26 94.070 94.810 94.180 97.020 98.790 101.190 102.760 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.22765 93.61519 93.23432 92.59091 94.54436 97.35477 99.52713 101.5033 [2,] 82.19235 94.03481 93.89568 93.38909 96.24564 98.28523 100.14287 102.5067 [,9] [1,] NA [2,] NA $out [1] 90.60 92.46 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(79.58, 80.33, 80.71, 83.58, 88.26, 93.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w7a61447712809.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,] 4.501427 13.220 4.46750 [2,] 5.711596 18.410 4.79750 [3,] 6.455749 21.430 4.95750 [4,] 6.599631 22.085 5.24375 [5,] 6.659647 22.340 5.73000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.050710 19.75381 4.753962 [2,] 6.860788 23.10619 5.161038 $out [1] 3.828303 10.390000 5.980000 $group [1] 1 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.50142655959514, 5.71159598613866, 6.45574901644939, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1a2zv1447712809.ps tmp/1a2zv1447712809.png",intern=TRUE)) character(0) > try(system("convert tmp/24qaq1447712809.ps tmp/24qaq1447712809.png",intern=TRUE)) character(0) > try(system("convert tmp/3wwhm1447712809.ps tmp/3wwhm1447712809.png",intern=TRUE)) character(0) > try(system("convert tmp/4mv8y1447712809.ps tmp/4mv8y1447712809.png",intern=TRUE)) character(0) > try(system("convert tmp/5rhtp1447712809.ps tmp/5rhtp1447712809.png",intern=TRUE)) character(0) > try(system("convert tmp/6w7a61447712809.ps tmp/6w7a61447712809.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.182 0.409 2.607