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.72,95.76,96.14,97.11,97.19,97.43,97.43,97.56,97.66,97.75,97.82,97.82,97.82,98.35,98.19,98.19,98.21,98.22,98.26,98.23,98.26,98.5,98.51,98.51,98.51,98.89,99.55,99.9,100.12,100.09,100.09,100.09,100.46,100.71,100.79,100.79,100.93,101.15,101.53,101.91,102.18,102.24,102.2,102.32,102.43,102.45,102.84,102.96,102.96,103.1,103.4,103.74,103.97,104.29,104.33,104.46,104.9,105.31,105.63,105.68,105.87,106.34,106.6,107.1,107.06,107.4,107.4,107.43,107.75,107.84,107.97,108.04) > 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.72 97.82 98.51 100.93 102.96 105.87 NA [2,] 95.76 98.35 98.89 101.15 103.10 106.34 NA [3,] 96.14 98.19 99.55 101.53 103.40 106.60 NA [4,] 97.11 98.19 99.90 101.91 103.74 107.10 NA [5,] 97.19 98.21 100.12 102.18 103.97 107.06 NA [6,] 97.43 98.22 100.09 102.24 104.29 107.40 NA [7,] 97.43 98.26 100.09 102.20 104.33 107.40 NA [8,] 97.56 98.23 100.09 102.32 104.46 107.43 NA [9,] 97.66 98.26 100.46 102.43 104.90 107.75 NA [10,] 97.75 98.50 100.71 102.45 105.31 107.84 NA [11,] 97.82 98.51 100.79 102.84 105.63 107.97 NA [12,] 97.82 98.51 100.79 102.96 105.68 108.04 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/1u1nb1493152624.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/2d9vu1493152624.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/3s4xa1493152624.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/4rxnn1493152624.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,] 94.72 95.76 96.14 97.110 97.19 97.430 97.430 97.560 97.660 97.75 [2,] 97.82 98.35 98.19 98.190 98.21 98.220 98.260 98.230 98.260 98.50 [3,] 99.72 100.02 100.54 100.905 101.15 101.165 101.145 101.205 101.445 101.58 [4,] 102.96 103.10 103.40 103.740 103.97 104.290 104.330 104.460 104.900 105.31 [5,] 105.87 106.34 106.60 107.100 107.06 107.400 107.400 107.430 107.750 107.84 [,11] [,12] [1,] 97.820 97.820 [2,] 98.510 98.510 [3,] 101.815 101.875 [4,] 105.630 105.680 [5,] 107.970 108.040 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.40453 96.9561 97.17938 97.32507 97.43461 97.24965 97.22965 [2,] 103.03547 103.0839 103.90062 104.48493 104.86539 105.08035 105.06035 [,8] [,9] [,10] [,11] [,12] [1,] 97.18645 97.16199 97.18733 97.22237 97.25012 [2,] 105.22355 105.72801 105.97267 106.40763 106.49988 $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(94.72, 97.82, 99.72, 102.96, 105.87, 95.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5h8bo1493152624.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,] 95.760 98.190 98.510 100.93 102.960 105.870 NA [2,] 96.625 98.200 99.725 101.72 103.570 106.830 NA [3,] 97.430 98.245 100.090 102.22 104.310 107.400 NA [4,] 97.705 98.425 100.585 102.44 105.105 107.795 NA [5,] 97.820 98.510 100.790 102.96 105.680 108.040 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.9374 98.14238 99.69775 101.8916 103.6099 106.9599 NA [2,] 97.9226 98.34762 100.48225 102.5484 105.0101 107.8401 NA $out [1] 94.72 97.82 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(95.76, 96.625, 97.43, 97.705, 97.82, 98.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60nh41493152624.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,] 3.708621 9.87 4.1275 [2,] 3.766608 9.97 4.5625 [3,] 3.807672 10.09 5.0850 [4,] 3.949800 10.34 5.5075 [5,] 4.037876 10.58 5.9200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.724117 9.921241 4.653979 [2,] 3.891227 10.258759 5.516021 $out [1] 11.15 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.70862103752864, 3.76660805593372, 3.80767222403561, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u1nb1493152624.ps tmp/1u1nb1493152624.png",intern=TRUE)) character(0) > try(system("convert tmp/2d9vu1493152624.ps tmp/2d9vu1493152624.png",intern=TRUE)) character(0) > try(system("convert tmp/3s4xa1493152624.ps tmp/3s4xa1493152624.png",intern=TRUE)) character(0) > try(system("convert tmp/4rxnn1493152624.ps tmp/4rxnn1493152624.png",intern=TRUE)) character(0) > try(system("convert tmp/5h8bo1493152624.ps tmp/5h8bo1493152624.png",intern=TRUE)) character(0) > try(system("convert tmp/60nh41493152624.ps tmp/60nh41493152624.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.962 0.265 3.287