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(78.46,78.59,81.37,83.61,83.85,84.08,84.56,84.65,85.41,85.75,86.21,86.38,86.65,87.30,87.87,88.23,88.33,88.62,88.67,88.85,88.87,89.20,89.38,89.65,90.37,90.38,91.43,92.09,92.21,92.31,92.62,93.13,93.17,93.42,93.50,95.75,97.29,98.01,98.02,98.20,98.29,98.39,98.42,98.70,98.90,99.04,99.31,99.34,99.35,99.51,99.88,99.91,100.30,100.74,101.16,101.30,101.37,101.68,101.68,101.89,101.93,102.66,102.68,103.13,103.14,104.01,104.17,104.41,104.71,105.51,105.98,106.25) > 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,] 78.46 86.65 90.37 97.29 99.35 101.93 NA [2,] 78.59 87.30 90.38 98.01 99.51 102.66 NA [3,] 81.37 87.87 91.43 98.02 99.88 102.68 NA [4,] 83.61 88.23 92.09 98.20 99.91 103.13 NA [5,] 83.85 88.33 92.21 98.29 100.30 103.14 NA [6,] 84.08 88.62 92.31 98.39 100.74 104.01 NA [7,] 84.56 88.67 92.62 98.42 101.16 104.17 NA [8,] 84.65 88.85 93.13 98.70 101.30 104.41 NA [9,] 85.41 88.87 93.17 98.90 101.37 104.71 NA [10,] 85.75 89.20 93.42 99.04 101.68 105.51 NA [11,] 86.21 89.38 93.50 99.31 101.68 105.98 NA [12,] 86.38 89.65 95.75 99.34 101.89 106.25 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/1fe671492783663.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/2qzwc1492783663.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/3gx8t1492783663.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/4z5ce1492783663.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,] 78.46 78.590 81.370 83.610 83.85 84.08 84.56 84.650 85.410 85.75 [2,] 86.65 87.300 87.870 88.230 88.33 88.62 88.67 88.850 88.870 89.20 [3,] 93.83 94.195 94.725 95.145 95.25 95.35 95.52 95.915 96.035 96.23 [4,] 99.35 99.510 99.880 99.910 100.30 100.74 101.16 101.300 101.370 101.68 [5,] 101.93 102.660 102.680 103.130 103.14 104.01 104.17 104.410 104.710 105.51 [,11] [,12] [1,] 86.210 86.380 [2,] 89.380 89.650 [3,] 96.405 97.545 [4,] 101.680 101.890 [5,] 105.980 106.250 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85.63809 86.31916 86.97816 87.61102 87.52896 87.53221 87.46355 [2,] 102.02191 102.07084 102.47184 102.67898 102.97104 103.16779 103.57645 [,8] [,9] [,10] [,11] [,12] [1,] 87.88435 87.9721 88.18 88.4711 89.6498 [2,] 103.94565 104.0979 104.28 104.3389 105.4402 $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(78.46, 86.65, 93.83, 99.35, 101.93, 78.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ayz31492783663.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,] 78.46 86.650 90.370 97.290 99.350 101.930 NA [2,] 82.49 88.050 91.760 98.110 99.895 102.905 NA [3,] 84.32 88.645 92.465 98.405 100.950 104.090 NA [4,] 85.58 89.035 93.295 98.970 101.525 105.110 NA [5,] 86.38 89.650 93.500 99.340 101.890 106.250 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 82.91063 88.19573 91.76488 98.01275 100.2065 103.0843 NA [2,] 85.72937 89.09427 93.16512 98.79725 101.6935 105.0957 NA $out [1] 95.75 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(78.46, 82.49, 84.32, 85.58, 86.38, 86.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60d6i1492783663.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,] 7.473421 19.290 10.28750 [2,] 7.510320 19.565 10.55375 [3,] 7.604688 19.765 10.70375 [4,] 7.875413 20.620 10.81250 [5,] 8.105745 21.310 11.06500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.438167 19.28381 10.58573 [2,] 7.771209 20.24619 10.82177 $out [1] 8.882816 9.026604 23.470000 24.070000 11.255000 10.077500 $group [1] 1 1 2 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.47342134946684, 7.51032009925965, 7.60468821613965, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fe671492783663.ps tmp/1fe671492783663.png",intern=TRUE)) character(0) > try(system("convert tmp/2qzwc1492783663.ps tmp/2qzwc1492783663.png",intern=TRUE)) character(0) > try(system("convert tmp/3gx8t1492783663.ps tmp/3gx8t1492783663.png",intern=TRUE)) character(0) > try(system("convert tmp/4z5ce1492783663.ps tmp/4z5ce1492783663.png",intern=TRUE)) character(0) > try(system("convert tmp/5ayz31492783663.ps tmp/5ayz31492783663.png",intern=TRUE)) character(0) > try(system("convert tmp/60d6i1492783663.ps tmp/60d6i1492783663.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.148 0.352 3.639