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(101.16,99.09,99.14,99.36,99.57,99.6,99.65,99.8,100.15,100.45,100.81,100.89,100.92,100.94,101.1,101.1,101.11,101.13,101.13,101.15,101.17,101.17,101.2,101.21,101.22,101.25,101.29,101.34,101.35,101.39,101.4,101.43,101.43,101.6,101.63,101.7,101.72,101.73,101.92,101.95,102.05,102.05,102.07,102.1,102.16,102.18,102.22,102.37,102.4,102.42,102.47,102.48,102.51,102.53,102.59,102.61,102.61,102.62,102.66,102.67,102.69,102.72,102.73,102.78,102.93,103,103.02,103.06,103.17,103.52,103.69,103.73) > 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,] 101.16 100.92 101.22 101.72 102.40 102.69 NA [2,] 99.09 100.94 101.25 101.73 102.42 102.72 NA [3,] 99.14 101.10 101.29 101.92 102.47 102.73 NA [4,] 99.36 101.10 101.34 101.95 102.48 102.78 NA [5,] 99.57 101.11 101.35 102.05 102.51 102.93 NA [6,] 99.60 101.13 101.39 102.05 102.53 103.00 NA [7,] 99.65 101.13 101.40 102.07 102.59 103.02 NA [8,] 99.80 101.15 101.43 102.10 102.61 103.06 NA [9,] 100.15 101.17 101.43 102.16 102.61 103.17 NA [10,] 100.45 101.17 101.60 102.18 102.62 103.52 NA [11,] 100.81 101.20 101.63 102.22 102.66 103.69 NA [12,] 100.89 101.21 101.70 102.37 102.67 103.73 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/17he61493064757.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/2md7p1493064757.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/3oz5x1493064757.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/48bfs1493064757.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,] 100.92 99.09 99.140 99.360 99.57 99.60 99.650 99.800 100.150 100.45 [2,] 101.16 100.94 101.100 101.100 101.11 101.13 101.130 101.150 101.170 101.17 [3,] 101.47 101.49 101.605 101.645 101.70 101.72 101.735 101.765 101.795 101.89 [4,] 102.40 102.42 102.470 102.480 102.51 102.53 102.590 102.610 102.610 102.62 [5,] 102.69 102.72 102.730 102.780 102.93 103.00 103.020 103.060 103.170 103.52 [,11] [,12] [1,] 100.810 100.890 [2,] 101.200 101.210 [3,] 101.925 102.035 [4,] 102.660 102.670 [5,] 103.690 103.730 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.6702 100.5354 100.7213 100.7549 100.797 100.817 100.7933 100.8233 [2,] 102.2698 102.4446 102.4887 102.5351 102.603 102.623 102.6767 102.7067 [,9] [,10] [,11] [,12] [1,] 100.8662 100.9547 100.9833 101.0933 [2,] 102.7238 102.8253 102.8667 102.9767 $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(100.92, 101.16, 101.47, 102.4, 102.69, 99.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mi8y1493064757.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,] 99.090 101.10 101.220 101.720 102.400 102.690 NA [2,] 99.465 101.10 101.315 101.935 102.475 102.755 NA [3,] 99.725 101.13 101.395 102.060 102.560 103.010 NA [4,] 100.630 101.17 101.515 102.170 102.615 103.345 NA [5,] 101.160 101.21 101.700 102.370 102.670 103.730 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.19364 101.0981 101.3038 101.9528 102.4961 102.7409 NA [2,] 100.25636 101.1619 101.4862 102.1672 102.6239 103.2791 NA $out [1] 100.92 100.94 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(99.09, 99.465, 99.725, 100.63, 101.16, 101.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67to01493064757.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,] 1.046016 2.84 1.18500 [2,] 1.069546 2.95 1.20125 [3,] 1.184980 3.31 1.23125 [4,] 1.218849 3.41 1.26250 [5,] 1.300114 3.63 1.26250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.116882 3.100191 1.203313 [2,] 1.253078 3.519809 1.259187 $out [1] 0.7210478 1.7700000 1.0550000 $group [1] 1 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.0460162522638, 1.06954616150585, 1.18498011363476, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17he61493064757.ps tmp/17he61493064757.png",intern=TRUE)) character(0) > try(system("convert tmp/2md7p1493064757.ps tmp/2md7p1493064757.png",intern=TRUE)) character(0) > try(system("convert tmp/3oz5x1493064757.ps tmp/3oz5x1493064757.png",intern=TRUE)) character(0) > try(system("convert tmp/48bfs1493064757.ps tmp/48bfs1493064757.png",intern=TRUE)) character(0) > try(system("convert tmp/5mi8y1493064757.ps tmp/5mi8y1493064757.png",intern=TRUE)) character(0) > try(system("convert tmp/67to01493064757.ps tmp/67to01493064757.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.612 0.325 2.998