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(92.61,92.19,92.68,92.66,92.77,92.21,92.58,91.9,93.81,94.05,94.51,94.49,94.36,94.72,95.57,95.87,95.93,96.09,95.82,96.06,97.09,97.67,98.53,98.12,98.84,98.98,100.04,99.47,99.84,99.52,99.81,99.55,100.21,101.44,101,101.32,101.84,101.81,101.83,102.18,101.97,101.8,101.69,101.91,102.27,102.73,102.61,102.89,102.93,103.01,102.54,103.08,103.72,103.83,103.69,103.57,103.95,104.52,104.58,104.75,108.4,107.23,107.76,107.25,108.1,108.49,107.19,106.83,107.24,108.49,109.3,109.15) > 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,] 92.61 94.36 98.84 101.84 102.93 108.40 NA [2,] 92.19 94.72 98.98 101.81 103.01 107.23 NA [3,] 92.68 95.57 100.04 101.83 102.54 107.76 NA [4,] 92.66 95.87 99.47 102.18 103.08 107.25 NA [5,] 92.77 95.93 99.84 101.97 103.72 108.10 NA [6,] 92.21 96.09 99.52 101.80 103.83 108.49 NA [7,] 92.58 95.82 99.81 101.69 103.69 107.19 NA [8,] 91.90 96.06 99.55 101.91 103.57 106.83 NA [9,] 93.81 97.09 100.21 102.27 103.95 107.24 NA [10,] 94.05 97.67 101.44 102.73 104.52 108.49 NA [11,] 94.51 98.53 101.00 102.61 104.58 109.30 NA [12,] 94.49 98.12 101.32 102.89 104.75 109.15 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/1juye1492779405.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/23bod1492779405.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/3u42q1492779405.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/45d2b1492779405.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,] 92.61 92.190 92.680 92.660 92.770 92.21 92.58 91.90 93.81 94.050 [2,] 94.36 94.720 95.570 95.870 95.930 96.09 95.82 96.06 97.09 97.670 [3,] 100.34 100.395 100.935 100.825 100.905 100.66 100.75 100.73 101.24 102.085 [4,] 102.93 103.010 102.540 103.080 103.720 103.83 103.69 103.57 103.95 104.520 [5,] 108.40 107.230 107.760 107.250 108.100 108.49 107.19 106.83 107.24 108.490 [,11] [,12] [1,] 94.510 94.490 [2,] 98.530 98.120 [3,] 101.805 102.105 [4,] 104.580 104.750 [5,] 109.300 109.150 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.81207 95.04768 96.43912 96.17432 95.8802 95.66745 95.6736 [2,] 105.86793 105.74232 105.43088 105.47568 105.9298 105.65255 105.8264 [,8] [,9] [,10] [,11] [,12] [1,] 95.88581 96.81508 97.66653 97.90255 97.82844 [2,] 105.57419 105.66492 106.50347 105.70745 106.38156 $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(92.61, 94.36, 100.34, 102.93, 108.4, 92.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5osv31492779405.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,] 91.900 94.360 98.840 101.69 102.540 106.830 NA [2,] 92.395 95.695 99.495 101.82 103.045 107.235 NA [3,] 92.670 95.995 99.825 101.94 103.705 107.930 NA [4,] 93.930 97.380 100.605 102.44 104.235 108.490 NA [5,] 94.510 98.530 101.440 102.89 104.750 109.300 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.96988 95.22646 99.31872 101.6572 103.1622 107.3576 NA [2,] 93.37012 96.76354 100.33128 102.2228 104.2478 108.5024 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(91.9, 92.395, 92.67, 93.93, 94.51, 94.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6iur91492779405.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.827432 14.440 4.94000 [2,] 5.106718 14.600 5.56000 [3,] 5.327510 14.860 6.15375 [4,] 5.523580 15.205 6.37500 [5,] 5.833085 15.790 7.17750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.137376 14.58406 5.782023 [2,] 5.517644 15.13594 6.525477 $out [1] 16.28 13.43 $group [1] 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.82743168430861, 5.10671753114694, 5.32750974859457, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1juye1492779405.ps tmp/1juye1492779405.png",intern=TRUE)) character(0) > try(system("convert tmp/23bod1492779405.ps tmp/23bod1492779405.png",intern=TRUE)) character(0) > try(system("convert tmp/3u42q1492779405.ps tmp/3u42q1492779405.png",intern=TRUE)) character(0) > try(system("convert tmp/45d2b1492779405.ps tmp/45d2b1492779405.png",intern=TRUE)) character(0) > try(system("convert tmp/5osv31492779405.ps tmp/5osv31492779405.png",intern=TRUE)) character(0) > try(system("convert tmp/6iur91492779405.ps tmp/6iur91492779405.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.756 0.299 3.134