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(90.33,90.62,91.22,91.39,91.72,91.32,91.1,91.05,91.45,91.53,91.63,91.78,92.32,92.8,92.65,93.35,93.63,93.76,93.83,93.37,93.41,93.84,94.66,94.65,94.91,95.81,95.87,95.84,96.31,96.17,96.16,96.48,96.61,97.68,97.83,97.88,98.63,99.25,99.64,100.47,101.12,101.33,100.5,99.93,99.81,99.74,99.72,99.87,100.39,100.09,100.03,101.2,99.96,99.94,100.01,98.69,98.19,98.08,98.46,98.75,99.25,99.68,99.64,101.46,100.99,101.12,100.6,100.24,100.16,101.25,100.74,100.61) > 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,] 90.33 92.32 94.91 98.63 100.39 99.25 NA [2,] 90.62 92.80 95.81 99.25 100.09 99.68 NA [3,] 91.22 92.65 95.87 99.64 100.03 99.64 NA [4,] 91.39 93.35 95.84 100.47 101.20 101.46 NA [5,] 91.72 93.63 96.31 101.12 99.96 100.99 NA [6,] 91.32 93.76 96.17 101.33 99.94 101.12 NA [7,] 91.10 93.83 96.16 100.50 100.01 100.60 NA [8,] 91.05 93.37 96.48 99.93 98.69 100.24 NA [9,] 91.45 93.41 96.61 99.81 98.19 100.16 NA [10,] 91.53 93.84 97.68 99.74 98.08 101.25 NA [11,] 91.63 94.66 97.83 99.72 98.46 100.74 NA [12,] 91.78 94.65 97.88 99.87 98.75 100.61 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/1aplf1492783648.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/2b6sy1492783648.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/3bedg1492783648.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/4t6nz1492783648.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] [1,] 90.33 90.62 91.220 91.390 91.720 91.320 91.100 91.050 91.45 [2,] 92.32 92.80 92.650 93.350 93.630 93.760 93.830 93.370 93.41 [3,] 96.77 97.53 97.755 98.155 98.135 98.055 98.085 97.585 97.40 [4,] 99.25 99.68 99.640 101.200 100.990 101.120 100.500 99.930 99.81 [5,] 100.39 100.09 100.030 101.460 101.120 101.330 100.600 100.240 100.16 [,10] [,11] [,12] [1,] 91.53 91.630 91.780 [2,] 93.84 94.660 94.650 [3,] 97.88 98.145 98.315 [4,] 99.74 99.720 99.870 [5,] 101.25 100.740 100.610 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.29993 93.09218 93.24622 93.0915 93.38756 93.30756 93.78263 [2,] 101.24007 101.96782 102.26378 103.2185 102.88244 102.80244 102.38737 [,8] [,9] [,10] [,11] [,12] [1,] 93.35359 93.27179 94.07431 94.88114 94.94793 [2,] 101.81641 101.52821 101.68569 101.40886 101.68207 $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(90.33, 92.32, 96.77, 99.25, 100.39, 90.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kti11492783648.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,] 90.330 92.320 94.910 98.630 98.080 99.250 NA [2,] 91.075 93.075 95.855 99.680 98.575 99.920 NA [3,] 91.355 93.520 96.240 99.840 99.950 100.605 NA [4,] 91.580 93.835 97.145 100.485 100.060 101.055 NA [5,] 91.780 94.660 97.880 101.330 101.200 101.460 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.12467 93.17336 95.65162 99.47283 99.27268 100.0873 NA [2,] 91.58533 93.86664 96.82838 100.20717 100.62732 101.1227 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(90.33, 91.075, 91.355, 91.58, 91.78, 92.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6o9kb1492783648.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.390620 8.710 3.95250 [2,] 3.595288 8.970 4.86000 [3,] 3.930168 9.435 5.99250 [4,] 4.055653 9.865 6.30875 [5,] 4.364066 10.070 7.04500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.720192 9.026784 5.331715 [2,] 4.140144 9.843216 6.653285 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.39062039554219, 3.59528772851976, 3.93016801965263, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1aplf1492783648.ps tmp/1aplf1492783648.png",intern=TRUE)) character(0) > try(system("convert tmp/2b6sy1492783648.ps tmp/2b6sy1492783648.png",intern=TRUE)) character(0) > try(system("convert tmp/3bedg1492783648.ps tmp/3bedg1492783648.png",intern=TRUE)) character(0) > try(system("convert tmp/4t6nz1492783648.ps tmp/4t6nz1492783648.png",intern=TRUE)) character(0) > try(system("convert tmp/5kti11492783648.ps tmp/5kti11492783648.png",intern=TRUE)) character(0) > try(system("convert tmp/6o9kb1492783648.ps tmp/6o9kb1492783648.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.242 0.402 3.755