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(94.47,94.19,94.34,94.3,94.4,94.54,94.09,95.87,98.46,98.7,98.75,98.72,98.72,98.67,98.82,99.39,99.33,99.22,99.05,98.83,98.84,98.89,98.8,99.4,98.89,98.85,98.69,98.48,98.39,98.35,98.26,98.06,98.14,98.17,98.41,98.64,99.25,99.61,100.28,100.31,100.55,100.45,100.78,100.68,101.69,98.09,99.13,99.18,96.22,96.11,96,95.96,97.95,98.43,98.32,97.45,96.42,95.36,95.1,95.54,94.07,93.48,92.86,90.98,91.45,91.16,90.71,90.31,89.78,91.02,90.77,90.69) > 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,] 94.47 98.72 98.89 99.25 96.22 94.07 NA [2,] 94.19 98.67 98.85 99.61 96.11 93.48 NA [3,] 94.34 98.82 98.69 100.28 96.00 92.86 NA [4,] 94.30 99.39 98.48 100.31 95.96 90.98 NA [5,] 94.40 99.33 98.39 100.55 97.95 91.45 NA [6,] 94.54 99.22 98.35 100.45 98.43 91.16 NA [7,] 94.09 99.05 98.26 100.78 98.32 90.71 NA [8,] 95.87 98.83 98.06 100.68 97.45 90.31 NA [9,] 98.46 98.84 98.14 101.69 96.42 89.78 NA [10,] 98.70 98.89 98.17 98.09 95.36 91.02 NA [11,] 98.75 98.80 98.41 99.13 95.10 90.77 NA [12,] 98.72 99.40 98.64 99.18 95.54 90.69 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/1unok1492783968.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/2d2a51492783968.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/3dvou1492783968.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/412li1492783968.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] [,11] [1,] 94.07 93.48 92.860 90.98 91.45 91.16 90.71 95.870 96.42 91.02 90.77 [2,] 94.47 94.19 94.340 94.30 94.40 94.54 94.09 95.870 96.42 95.36 95.10 [3,] 97.47 97.39 97.345 97.22 98.17 98.39 98.29 97.755 98.30 98.13 98.58 [4,] 98.89 98.85 98.820 99.39 99.33 99.22 99.05 98.830 98.84 98.70 98.80 [5,] 99.25 99.61 100.280 100.31 100.55 100.45 100.78 100.680 101.69 98.89 99.13 [,12] [1,] 90.69 [2,] 95.54 [3,] 98.68 [4,] 99.18 [5,] 99.40 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.61896 94.38415 94.45526 93.93679 94.98999 95.37125 95.09064 [2,] 100.32104 100.39585 100.23474 100.50321 101.35001 101.40875 101.48936 [,8] [,9] [,10] [,11] [,12] [1,] 95.8457 96.73902 95.97559 96.19338 96.33208 [2,] 99.6643 99.86098 100.28441 100.96662 101.02792 $out [1] 90.31 89.78 $group [1] 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.07, 94.47, 97.47, 98.89, 99.25, 93.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5me8f1492783968.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.090 98.670 98.060 98.090 95.100 89.780 NA [2,] 94.320 98.810 98.215 99.215 95.750 90.700 NA [3,] 94.505 98.865 98.400 100.295 96.165 91.000 NA [4,] 98.580 99.275 98.665 100.615 97.700 92.155 NA [5,] 98.750 99.400 98.890 101.690 98.430 94.070 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.56199 98.65291 98.19475 99.65645 95.27559 90.33636 NA [2,] 96.44801 99.07709 98.60525 100.93355 97.05441 91.66364 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(94.09, 94.32, 94.505, 98.58, 98.75, 98.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6njpw1492783968.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.330800 5.180 1.89500 [2,] 2.980762 7.645 2.63750 [3,] 3.413660 8.905 3.63250 [4,] 3.556665 9.700 3.98625 [5,] 4.024497 11.910 4.44750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.150987 7.967701 3.017326 [2,] 3.676333 9.842299 4.247674 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.33079957668322, 2.98076156361026, 3.41365992593415, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1unok1492783968.ps tmp/1unok1492783968.png",intern=TRUE)) character(0) > try(system("convert tmp/2d2a51492783968.ps tmp/2d2a51492783968.png",intern=TRUE)) character(0) > try(system("convert tmp/3dvou1492783968.ps tmp/3dvou1492783968.png",intern=TRUE)) character(0) > try(system("convert tmp/412li1492783968.ps tmp/412li1492783968.png",intern=TRUE)) character(0) > try(system("convert tmp/5me8f1492783968.ps tmp/5me8f1492783968.png",intern=TRUE)) character(0) > try(system("convert tmp/6njpw1492783968.ps tmp/6njpw1492783968.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.855 0.252 3.145