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(96.16,96.4,96.87,97,97.26,97.42,97.64,97.93,98.1,98.29,98.42,98.49,98.67,99.1,99.37,99.54,99.58,99.77,100.06,100.26,100.57,100.94,101.03,101.12,101.26,101.94,102.26,102.51,102.61,102.76,103.04,103.22,103.47,103.64,103.76,103.85,103.98,104.68,105.07,105.19,105.39,105.66,105.76,105.89,106.04,106.37,106.57,106.67,107.08,107.64,108.47,108.7,108.82,108.99,109.18,109.31,109.5,109.7,109.9,110.09,110.47) > 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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 96.16 98.67 101.26 103.98 107.08 110.47 [2,] 96.40 99.10 101.94 104.68 107.64 NA [3,] 96.87 99.37 102.26 105.07 108.47 NA [4,] 97.00 99.54 102.51 105.19 108.70 NA [5,] 97.26 99.58 102.61 105.39 108.82 NA [6,] 97.42 99.77 102.76 105.66 108.99 NA [7,] 97.64 100.06 103.04 105.76 109.18 NA [8,] 97.93 100.26 103.22 105.89 109.31 NA [9,] 98.10 100.57 103.47 106.04 109.50 NA [10,] 98.29 100.94 103.64 106.37 109.70 NA [11,] 98.42 101.03 103.76 106.57 109.90 NA [12,] 98.49 101.12 103.85 106.67 110.09 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/1oofm1493038999.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/2v03z1493038999.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/3flxt1493038999.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/4lwu41493038999.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,] 96.16 96.40 96.87 97.00 97.26 97.42 97.64 97.93 98.10 98.29 [2,] 98.67 99.10 99.37 99.54 99.58 99.77 100.06 100.26 100.57 100.94 [3,] 102.62 101.94 102.26 102.51 102.61 102.76 103.04 103.22 103.47 103.64 [4,] 107.08 104.68 105.07 105.19 105.39 105.66 105.76 105.89 106.04 106.37 [5,] 110.47 107.64 108.47 108.70 108.82 108.99 109.18 109.31 109.50 109.70 [,11] [,12] [1,] 98.42 98.49 [2,] 101.03 101.12 [3,] 103.76 103.85 [4,] 106.57 106.67 [5,] 109.90 110.09 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.19528 97.99719 98.23239 98.51772 98.50467 98.59814 99.01239 [2,] 108.04472 105.88281 106.28761 106.50228 106.71533 106.92186 107.06761 [,8] [,9] [,10] [,11] [,12] [1,] 99.24186 99.60491 99.80318 99.84545 99.92838 [2,] 107.19814 107.33509 107.47682 107.67455 107.77162 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(96.16, 98.67, 102.62, 107.08, 110.47, 96.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o63a1493038999.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,] 96.160 98.670 101.260 103.980 107.080 110.47 [2,] 96.935 99.455 102.385 105.130 108.585 110.47 [3,] 97.530 99.915 102.900 105.710 109.085 110.47 [4,] 98.195 100.755 103.555 106.205 109.600 110.47 [5,] 98.490 101.120 103.850 106.670 110.090 110.47 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 96.95531 99.32206 102.3664 105.2197 108.6221 110.47 [2,] 98.10469 100.50794 103.4336 106.2003 109.5479 110.47 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(96.16, 96.935, 97.53, 98.195, 98.49, 98.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j3kj1493038999.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.437175 11.240 5.430 [2,] 4.487494 11.405 5.545 [3,] 4.554895 11.550 5.640 [4,] 4.590366 11.600 5.755 [5,] 4.600247 11.700 5.890 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.507975 11.46106 5.544218 [2,] 4.601816 11.63894 5.735782 $out [1] 5.328147 14.310000 6.987500 $group [1] 1 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.43717477681463, 4.48749367786355, 4.55489537248357, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1oofm1493038999.ps tmp/1oofm1493038999.png",intern=TRUE)) character(0) > try(system("convert tmp/2v03z1493038999.ps tmp/2v03z1493038999.png",intern=TRUE)) character(0) > try(system("convert tmp/3flxt1493038999.ps tmp/3flxt1493038999.png",intern=TRUE)) character(0) > try(system("convert tmp/4lwu41493038999.ps tmp/4lwu41493038999.png",intern=TRUE)) character(0) > try(system("convert tmp/5o63a1493038999.ps tmp/5o63a1493038999.png",intern=TRUE)) character(0) > try(system("convert tmp/6j3kj1493038999.ps tmp/6j3kj1493038999.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.005 0.368 3.529