R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(86.48,86.48,86.7,87.86,88.24,88.23,88.73,88.82,87.16,86.29,86.37,86.59,85.46,85.85,86.93,87.66,87.84,88.09,88.58,88.06,88.26,89,90.78,90,89.84,89.82,91.12,91.5,93.03,94.23,94.76,92.83,92.49,90.85,88.19,86.31,85.74,86.62,86.66,87.39,87.59,88.8,88.64,89.55,89.04,88.49,89.5,89.46,90.33,90.27,91.5,92.53,93.14,93.01,92.84,92.88,93.05,93.17,93.67,94.9,95.72,96.08,97.52,98.26,98.48,98.09,98.03,98.14,98.71,98.69,98.72,98.47,99.49,99.84,100.9,101.31,100.09,99.28,99.57,101.04,101.87,101.39,100.3,99.95,99.87,100.51,100.27,100.04,99.23,99.32,99.95,100.23,101.02,99.83,99.61,100.12,99.83,100.03,100.07,100.46,100.43,100.68,101.8,101.21,100.63,100.55,99.76,98.8) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 86.48 85.46 89.84 85.74 90.33 95.72 99.49 99.87 99.83 NA [2,] 86.48 85.85 89.82 86.62 90.27 96.08 99.84 100.51 100.03 NA [3,] 86.70 86.93 91.12 86.66 91.50 97.52 100.90 100.27 100.07 NA [4,] 87.86 87.66 91.50 87.39 92.53 98.26 101.31 100.04 100.46 NA [5,] 88.24 87.84 93.03 87.59 93.14 98.48 100.09 99.23 100.43 NA [6,] 88.23 88.09 94.23 88.80 93.01 98.09 99.28 99.32 100.68 NA [7,] 88.73 88.58 94.76 88.64 92.84 98.03 99.57 99.95 101.80 NA [8,] 88.82 88.06 92.83 89.55 92.88 98.14 101.04 100.23 101.21 NA [9,] 87.16 88.26 92.49 89.04 93.05 98.71 101.87 101.02 100.63 NA [10,] 86.29 89.00 90.85 88.49 93.17 98.69 101.39 99.83 100.55 NA [11,] 86.37 90.78 88.19 89.50 93.67 98.72 100.30 99.61 99.76 NA [12,] 86.59 90.00 86.31 89.46 94.90 98.47 99.95 100.12 98.80 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/1h12w1447945145.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/2pg7h1447945145.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/3ookb1447945145.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/4kl6m1447945145.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,] 85.46 85.85 86.66 87.39 87.59 88.09 88.58 88.06 87.16 86.29 [2,] 86.48 86.62 86.93 87.86 88.24 88.80 88.73 89.55 89.04 89.00 [3,] 90.33 90.27 91.50 92.53 93.14 94.23 94.76 92.88 93.05 93.17 [4,] 99.49 99.84 100.07 100.04 99.23 99.28 99.57 100.23 100.63 99.83 [5,] 99.87 100.51 100.90 101.31 100.43 100.68 101.80 101.21 101.87 101.39 [,11] [,12] [1,] 86.37 86.31 [2,] 89.50 89.46 [3,] 93.67 94.90 [4,] 99.61 98.80 [5,] 100.30 100.12 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 83.47807 83.30747 84.5796 86.1152 87.35193 88.71053 89.05093 87.2552 [2,] 97.18193 97.23253 98.4204 98.9448 98.92807 99.74947 100.46907 98.5048 [,9] [,10] [,11] [,12] [1,] 86.94593 87.4662 88.3454 89.98093 [2,] 99.15407 98.8738 98.9946 99.81907 $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(85.46, 86.48, 90.33, 99.49, 99.87, 85.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ahcv1447945145.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] [,8] [,9] [,10] [1,] 86.290 85.460 86.31 85.740 90.330 97.520 99.280 99.230 99.760 NA [2,] 86.480 87.295 89.83 87.025 92.015 97.775 99.705 99.720 99.930 NA [3,] 86.930 88.075 91.31 88.565 92.945 98.200 100.195 99.995 100.445 NA [4,] 88.235 88.790 92.93 89.250 93.155 98.585 101.175 100.250 100.655 NA [5,] 88.820 90.780 94.76 89.550 93.670 98.720 101.870 101.020 101.210 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.12953 87.39312 89.89607 87.55016 92.42504 97.83055 99.52452 99.75326 [2,] 87.73047 88.75688 92.72393 89.57984 93.46496 98.56945 100.86548 100.23674 [,9] [,10] [1,] 100.1143 NA [2,] 100.7757 NA $out [1] 90.27 94.90 95.72 96.08 101.80 98.80 $group [1] 5 5 6 6 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(86.29, 86.48, 86.93, 88.235, 88.82, 85.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/636jp1447945145.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,] 5.151206 12.590 9.340 [2,] 5.455683 13.185 10.580 [3,] 5.838535 13.925 10.915 [4,] 6.052179 14.535 12.595 [5,] 6.262444 15.100 13.220 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.566469 13.30926 9.995945 [2,] 6.110601 14.54074 11.834055 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.15120643905656, 5.45568332603944, 5.83853464577951, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h12w1447945145.ps tmp/1h12w1447945145.png",intern=TRUE)) character(0) > try(system("convert tmp/2pg7h1447945145.ps tmp/2pg7h1447945145.png",intern=TRUE)) character(0) > try(system("convert tmp/3ookb1447945145.ps tmp/3ookb1447945145.png",intern=TRUE)) character(0) > try(system("convert tmp/4kl6m1447945145.ps tmp/4kl6m1447945145.png",intern=TRUE)) character(0) > try(system("convert tmp/5ahcv1447945145.ps tmp/5ahcv1447945145.png",intern=TRUE)) character(0) > try(system("convert tmp/636jp1447945145.ps tmp/636jp1447945145.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.342 0.399 2.762