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(99.49,99.84,100.9,101.31,100.09,99.28,99.57,101.04,101.87,101.39,100.3,99.95,99.87,100.51,100.27,100.04,99.23,99.32,99.95,100.23,101.02,99.83,99.61,100.12,99.83,100.03,100.07,100.46,100.43,100.68,101.8,101.21,100.63,100.55,99.76,98.8,96.59,97.59,98.79,98.79,99.65,99.78,100.05,99.22,97.72,97.55,98.14,97.95,97.24,97.02,97.57,98.07,98.86,99.57,100.14,99.88,99.79,100.59,100.55,101.42) > 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,] 99.49 99.87 99.83 96.59 97.24 NA [2,] 99.84 100.51 100.03 97.59 97.02 NA [3,] 100.90 100.27 100.07 98.79 97.57 NA [4,] 101.31 100.04 100.46 98.79 98.07 NA [5,] 100.09 99.23 100.43 99.65 98.86 NA [6,] 99.28 99.32 100.68 99.78 99.57 NA [7,] 99.57 99.95 101.80 100.05 100.14 NA [8,] 101.04 100.23 101.21 99.22 99.88 NA [9,] 101.87 101.02 100.63 97.72 99.79 NA [10,] 101.39 99.83 100.55 97.55 100.59 NA [11,] 100.30 99.61 99.76 98.14 100.55 NA [12,] 99.95 100.12 98.80 97.95 101.42 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/12ct01493124698.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/2wxyz1493124698.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/3mmq31493124698.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/4cjho1493124698.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,] 96.59 97.02 97.57 98.07 98.86 99.28 99.95 99.22 99.79 99.83 99.61 [2,] 97.24 97.59 98.79 98.79 99.23 99.32 99.95 99.88 99.79 99.83 99.61 [3,] 99.49 99.84 100.07 100.04 99.65 99.57 100.05 100.23 100.63 100.55 99.76 [4,] 99.83 100.03 100.27 100.46 100.09 99.78 100.14 101.04 101.02 100.59 100.30 [5,] 99.87 100.51 100.90 101.31 100.43 99.78 100.14 101.21 101.87 101.39 100.55 [,12] [1,] 97.95 [2,] 98.80 [3,] 99.95 [4,] 100.12 [5,] 101.42 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.65991 98.1159 99.02424 98.85998 99.04233 99.24497 99.91575 [2,] 101.32009 101.5641 101.11576 101.22002 100.25767 99.89503 100.18425 [,8] [,9] [,10] [,11] [,12] [1,] 99.41035 99.76089 100.013 99.27245 99.01729 [2,] 101.04965 101.49911 101.087 100.24755 100.88271 $out [1] 100.68 99.57 101.80 97.72 97.55 98.14 $group [1] 6 7 7 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(96.59, 97.24, 99.49, 99.83, 99.87, 97.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58ulu1493124698.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,] 99.280 99.230 99.760 96.590 97.020 NA [2,] 99.705 99.720 99.930 97.655 97.820 NA [3,] 100.195 99.995 100.445 98.465 99.680 NA [4,] 101.175 100.250 100.655 99.435 100.345 NA [5,] 101.870 101.020 101.210 100.050 101.420 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 99.52452 99.75326 100.1143 97.65313 98.52833 NA [2,] 100.86548 100.23674 100.7757 99.27687 100.83167 NA $out [1] 101.8 98.8 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(99.28, 99.705, 100.195, 101.175, 101.87, 99.23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6trjj1493124698.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,] 0.5703332 1.40 0.190 [2,] 0.8450131 2.11 0.725 [3,] 1.3143088 3.26 1.195 [4,] 1.5165997 3.48 1.575 [5,] 1.5783314 4.15 2.590 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.007994 2.635134 0.8073093 [2,] 1.620624 3.884866 1.5826907 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.570333235924407, 0.845013116600919, 1.31430875604091, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12ct01493124698.ps tmp/12ct01493124698.png",intern=TRUE)) character(0) > try(system("convert tmp/2wxyz1493124698.ps tmp/2wxyz1493124698.png",intern=TRUE)) character(0) > try(system("convert tmp/3mmq31493124698.ps tmp/3mmq31493124698.png",intern=TRUE)) character(0) > try(system("convert tmp/4cjho1493124698.ps tmp/4cjho1493124698.png",intern=TRUE)) character(0) > try(system("convert tmp/58ulu1493124698.ps tmp/58ulu1493124698.png",intern=TRUE)) character(0) > try(system("convert tmp/6trjj1493124698.ps tmp/6trjj1493124698.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.036 0.338 3.480