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(79.55,80.08,80.15,80.69,81.56,81.23,81.39,81.61,82.25,82.06,82.82,82.3,83.09,83.21,83.13,84.31,83.62,83.75,84.1,83.71,84.2,85.13,86.16,86.65,87.44,87.62,88.03,89.1,89.68,89.47,90.13,89.49,89.52,89.86,89.77,89.8,90.89,90.82,90.68,90.92,90.82,90.09,89.71,89.34,89.2,89.48,89.72,89.58,90.65,90.93,91.42,91.52,91.76,91.47,91.37,91.35,91.74,91.78,91.88,91.99,92.55,92.94,92.81,93.35,93.72,93.94,94.03,93.66,93.78,94.1,94.85,94.83,95.06,95.87,95.97,95.96,96.3,96.17,96.18,96.55,96.76,97.63,97.86,97.82,98.62,99.24,99.63,100.27,100.84,101.05,100.38,100.02,99.97,99.95,100,100.04,100.51,100.29,100.22,101.29,100.29,100.26,100.39,99.3,98.9,98.76,99.12,99.28) > 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,] 79.55 83.09 87.44 90.89 90.65 92.55 95.06 98.62 100.51 NA [2,] 80.08 83.21 87.62 90.82 90.93 92.94 95.87 99.24 100.29 NA [3,] 80.15 83.13 88.03 90.68 91.42 92.81 95.97 99.63 100.22 NA [4,] 80.69 84.31 89.10 90.92 91.52 93.35 95.96 100.27 101.29 NA [5,] 81.56 83.62 89.68 90.82 91.76 93.72 96.30 100.84 100.29 NA [6,] 81.23 83.75 89.47 90.09 91.47 93.94 96.17 101.05 100.26 NA [7,] 81.39 84.10 90.13 89.71 91.37 94.03 96.18 100.38 100.39 NA [8,] 81.61 83.71 89.49 89.34 91.35 93.66 96.55 100.02 99.30 NA [9,] 82.25 84.20 89.52 89.20 91.74 93.78 96.76 99.97 98.90 NA [10,] 82.06 85.13 89.86 89.48 91.78 94.10 97.63 99.95 98.76 NA [11,] 82.82 86.16 89.77 89.72 91.88 94.85 97.86 100.00 99.12 NA [12,] 82.30 86.65 89.80 89.58 91.99 94.83 97.82 100.04 99.28 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/1fnja1447799386.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/2v8nv1447799386.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/34ld51447799386.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/41cdj1447799386.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] [,11] [1,] 79.55 80.08 80.15 80.69 81.56 81.23 81.39 81.61 82.25 82.06 82.82 [2,] 87.44 87.62 88.03 89.10 89.68 89.47 89.71 89.34 89.20 89.48 89.72 [3,] 90.89 90.93 91.42 91.52 91.76 91.47 91.37 91.35 91.74 91.78 91.88 [4,] 95.06 95.87 95.97 95.96 96.30 96.17 96.18 96.55 96.76 97.63 97.86 [5,] 100.51 100.29 100.22 101.29 100.84 101.05 100.39 100.02 99.97 99.95 100.00 [,12] [1,] 82.30 [2,] 89.58 [3,] 91.99 [4,] 97.82 [5,] 100.04 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.8768 86.585 87.23827 87.90707 88.27347 87.94133 87.96247 87.55273 [2,] 94.9032 95.275 95.60173 95.13293 95.24653 94.99867 94.77753 95.14727 [,9] [,10] [,11] [,12] [1,] 87.7584 87.48767 87.59293 87.65027 [2,] 95.7216 96.07233 96.16707 96.32973 $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(79.55, 87.44, 90.89, 95.06, 100.51, 80.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54jeo1447799386.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,] 79.550 83.090 87.440 89.200 90.930 92.550 95.060 99.240 98.76 NA [2,] 80.420 83.415 88.565 89.530 91.360 93.145 95.965 99.790 99.20 NA [3,] 81.475 83.925 89.505 89.905 91.495 93.750 96.240 100.010 100.24 NA [4,] 82.155 84.720 89.785 90.820 91.770 94.065 97.195 100.325 100.34 NA [5,] 82.820 86.650 90.130 90.920 91.990 94.850 97.860 101.050 101.29 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 80.68365 83.32978 88.94855 89.31662 91.308 93.33038 95.67899 99.76598 [2,] 82.26635 84.52022 90.06145 90.49338 91.682 94.16962 96.80101 100.25402 [,9] [,10] [1,] 99.72004 NA [2,] 100.75996 NA $out [1] 90.65 98.62 $group [1] 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(79.55, 80.42, 81.475, 82.155, 82.82, 83.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6y9wo1447799386.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.955867 17.180 6.470 [2,] 6.167040 17.815 6.780 [3,] 6.617332 19.140 7.590 [4,] 6.808299 20.140 8.145 [5,] 6.848308 20.960 8.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.324850 18.07955 6.967414 [2,] 6.909814 20.20045 8.212586 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.95586708865954, 6.16704041766569, 6.61733208405975, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fnja1447799386.ps tmp/1fnja1447799386.png",intern=TRUE)) character(0) > try(system("convert tmp/2v8nv1447799386.ps tmp/2v8nv1447799386.png",intern=TRUE)) character(0) > try(system("convert tmp/34ld51447799386.ps tmp/34ld51447799386.png",intern=TRUE)) character(0) > try(system("convert tmp/41cdj1447799386.ps tmp/41cdj1447799386.png",intern=TRUE)) character(0) > try(system("convert tmp/54jeo1447799386.ps tmp/54jeo1447799386.png",intern=TRUE)) character(0) > try(system("convert tmp/6y9wo1447799386.ps tmp/6y9wo1447799386.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.186 0.355 2.563