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(92.76,93.12,93.6,93.24,93.4,93.32,93.13,93.19,93.84,94.01,93.78,93.47,93.6,92.85,92.91,92.29,92.5,93.1,92.86,93.19,93.73,93.88,93.85,93.45,93.43,93.59,95.28,94.95,94.49,94.45,94.35,95.52,96.89,97.54,97.65,97.35,98.2,99.46,100.35,99.72,99.69,99.62,99.77,100.19,100.82,100.36,101.08,100.73,101.51,102.12,102.88,103.47,103.53,103.67,103.68,103.76,103.67,103.01,103.39,103.43,103.4,104.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] 62 > (np <- floor(n / par1)) [1] 5 > 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 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.76 93.60 93.43 98.20 101.51 103.4 [2,] 93.12 92.85 93.59 99.46 102.12 104.8 [3,] 93.60 92.91 95.28 100.35 102.88 NA [4,] 93.24 92.29 94.95 99.72 103.47 NA [5,] 93.40 92.50 94.49 99.69 103.53 NA [6,] 93.32 93.10 94.45 99.62 103.67 NA [7,] 93.13 92.86 94.35 99.77 103.68 NA [8,] 93.19 93.19 95.52 100.19 103.76 NA [9,] 93.84 93.73 96.89 100.82 103.67 NA [10,] 94.01 93.88 97.54 100.36 103.01 NA [11,] 93.78 93.85 97.65 101.08 103.39 NA [12,] 93.47 93.45 97.35 100.73 103.43 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/1awym1492957314.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/2kjuu1492957314.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/3ad2s1492957314.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/4uhnp1492957314.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,] 92.76 92.850 92.91 92.29 92.50 93.10 92.86 93.19 93.73 93.88 [2,] 93.43 93.120 93.60 93.24 93.40 93.32 93.13 93.19 93.84 94.01 [3,] 95.90 96.525 95.28 94.95 94.49 94.45 94.35 95.52 96.89 97.54 [4,] 101.51 102.120 100.35 99.72 99.69 99.62 99.77 100.19 100.82 100.36 [5,] 103.40 104.800 102.88 103.47 103.53 103.67 103.68 103.76 103.67 103.01 [,11] [,12] [1,] 93.78 93.45 [2,] 93.85 93.47 [3,] 97.65 97.35 [4,] 101.08 100.73 [5,] 103.39 103.43 $n [1] 6 6 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 90.68814 90.71971 90.51047 90.37125 90.0455 89.99844 89.65819 90.57382 [2,] 101.11186 102.33029 100.04953 99.52875 98.9345 98.90156 99.04181 100.46618 [,9] [,10] [,11] [,12] [1,] 91.95795 93.05311 92.5413 92.2201 [2,] 101.82205 102.02689 102.7587 102.4799 $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(92.76, 93.43, 95.9, 101.51, 103.4, 92.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52stb1492957314.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] [1,] 92.76 92.290 93.430 99.460 102.120 103.4 [2,] 93.16 92.855 94.400 99.655 102.945 103.4 [3,] 93.36 93.145 95.115 99.980 103.450 104.1 [4,] 93.69 93.665 97.120 100.545 103.670 104.8 [5,] 94.01 93.880 97.650 101.080 103.760 104.8 $n [1] 12 12 12 12 12 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 93.11826 92.77555 93.87439 99.57407 103.1193 102.5359 [2,] 93.60174 93.51445 96.35561 100.38593 103.7807 105.6641 $out [1] 98.20 101.51 $group [1] 4 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.76, 93.16, 93.36, 93.69, 94.01, 92.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6bzz81492957314.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.983962 9.130 6.2900 [2,] 4.383128 9.955 6.4150 [3,] 4.614753 10.570 6.8650 [4,] 4.722686 10.925 7.2200 [5,] 5.185050 11.950 8.2175 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.459878 10.12758 6.497834 [2,] 4.769628 11.01242 7.232166 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.98396159620045, 4.38312773815076, 4.61475304962691, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1awym1492957314.ps tmp/1awym1492957314.png",intern=TRUE)) character(0) > try(system("convert tmp/2kjuu1492957314.ps tmp/2kjuu1492957314.png",intern=TRUE)) character(0) > try(system("convert tmp/3ad2s1492957314.ps tmp/3ad2s1492957314.png",intern=TRUE)) character(0) > try(system("convert tmp/4uhnp1492957314.ps tmp/4uhnp1492957314.png",intern=TRUE)) character(0) > try(system("convert tmp/52stb1492957314.ps tmp/52stb1492957314.png",intern=TRUE)) character(0) > try(system("convert tmp/6bzz81492957314.ps tmp/6bzz81492957314.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 0.369 2.915