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,84.65,84.56,83.85,84.08,85.41,85.75,86.38,88.87,90.37,92.21,95.75,97.29,98.29,99.51,99.04,98.9,100.74,100.3,101.68,101.3,103.13,104.17,105.98,106.25,104.01,101.68,101.93,104.41,105.51,104.71,103.14,102.66,102.68,101.89,101.37,101.16,99.34,99.35,99.88,99.31,99.91,98.39,98.02,98.7,98.01,98.42,98.2,93.5,93.17,93.42,93.13,92.31,92.09,92.62,91.43,89.38,86.21,86.65,88.62,87.3,88.33,88.67,88.23,88.85,90.38,89.65,89.2,87.87) > 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 90.37 103.13 102.68 98.01 86.21 NA [2,] 78.59 92.21 104.17 101.89 98.42 86.65 NA [3,] 81.37 95.75 105.98 101.37 98.20 88.62 NA [4,] 83.61 97.29 106.25 101.16 93.50 87.30 NA [5,] 84.65 98.29 104.01 99.34 93.17 88.33 NA [6,] 84.56 99.51 101.68 99.35 93.42 88.67 NA [7,] 83.85 99.04 101.93 99.88 93.13 88.23 NA [8,] 84.08 98.90 104.41 99.31 92.31 88.85 NA [9,] 85.41 100.74 105.51 99.91 92.09 90.38 NA [10,] 85.75 100.30 104.71 98.39 92.62 89.65 NA [11,] 86.38 101.68 103.14 98.02 91.43 89.20 NA [12,] 88.87 101.30 102.66 98.70 89.38 87.87 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/13dij1493144442.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/2jzuk1493144442.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/34zdx1493144442.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/4x0841493144442.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,] 78.46 78.590 81.370 83.610 84.65 84.560 83.850 84.080 85.41 [2,] 86.21 86.650 88.620 87.300 88.33 88.670 88.230 88.850 90.38 [3,] 94.19 95.315 96.975 95.395 95.73 96.385 96.085 95.605 96.00 [4,] 102.68 101.890 101.370 101.160 99.34 99.510 99.880 99.310 100.74 [5,] 103.13 104.170 105.980 106.250 104.01 101.680 101.930 104.410 105.51 [,10] [,11] [,12] [1,] 85.750 86.380 87.87 [2,] 89.650 89.200 88.87 [3,] 95.505 94.725 94.04 [4,] 100.300 101.680 101.30 [5,] 104.710 103.140 102.66 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 83.56632 85.48471 88.75084 86.45485 88.62819 89.39285 88.57037 [2,] 104.81368 105.14529 105.19916 104.33515 102.83181 103.37715 103.59963 [,8] [,9] [,10] [,11] [,12] [1,] 88.85796 89.31747 88.63541 86.675 86.02225 [2,] 102.35204 102.68253 102.37459 102.775 102.05775 $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.21, 94.19, 102.68, 103.13, 78.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56ljf1493144442.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 92.21 101.680 98.020 89.380 86.210 NA [2,] 82.49 96.52 102.895 99.005 92.200 87.585 NA [3,] 84.32 98.97 104.090 99.615 93.150 88.475 NA [4,] 85.58 100.52 105.110 101.265 95.755 89.025 NA [5,] 88.87 101.68 106.250 102.680 98.420 90.380 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 82.91063 97.14557 103.0797 98.5842 91.52854 87.81821 NA [2,] 85.72937 100.79443 105.1003 100.6458 94.77146 89.13179 NA $out [1] 90.37 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(78.46, 82.49, 84.32, 85.58, 88.87, 92.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zr8a1493144442.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,] 6.808902 14.790 9.4300 [2,] 7.028414 17.600 9.5750 [3,] 7.420673 19.730 10.1950 [4,] 8.709642 23.625 11.4975 [5,] 9.856254 25.580 14.2625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.653853 16.98196 9.318135 [2,] 8.187493 22.47804 11.071865 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.80890201623335, 7.02841351001368, 7.42067314073217, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13dij1493144442.ps tmp/13dij1493144442.png",intern=TRUE)) character(0) > try(system("convert tmp/2jzuk1493144442.ps tmp/2jzuk1493144442.png",intern=TRUE)) character(0) > try(system("convert tmp/34zdx1493144442.ps tmp/34zdx1493144442.png",intern=TRUE)) character(0) > try(system("convert tmp/4x0841493144442.ps tmp/4x0841493144442.png",intern=TRUE)) character(0) > try(system("convert tmp/56ljf1493144442.ps tmp/56ljf1493144442.png",intern=TRUE)) character(0) > try(system("convert tmp/6zr8a1493144442.ps tmp/6zr8a1493144442.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.172 0.542 12.819