R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(83.5,83.6,83.9,83.9,84.2,84.4,84.6,84.8,84.8,84.9,85,85.1,85.3,85.5,86.1,86.2,86.3,86.5,86.5,86.6,86.8,87.3,87.7,87.8,88.1,88.8,89.3,89.2,89.3,89.6,89.6,89.9,90.2,90.2,90.4,90.5,91.5,91.5,91.8,92.2,92.4,92.7,93.1,93.1,93.5,93.9,94.3,94.7,95.3,95.9,96.2,96.7,96.7,96.9,97.3,97.4,97.9,98.4,98.4,98.8,98.9,98.9,99.3,99.4,99.7,99.8,99.7,99.9,100.4,101.1,101.3,101.4,101.8,102.2,102.4,102.5,102.8,103,103.2,103.2,103.6,103.7,103.7,103.8,104.2,104.5,104.5,104.8,105.2,105.3,105.5,105.4,105.7,106.8,106.8,107) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 83.5 85.3 88.1 91.5 95.3 98.9 101.8 104.2 NA [2,] 83.6 85.5 88.8 91.5 95.9 98.9 102.2 104.5 NA [3,] 83.9 86.1 89.3 91.8 96.2 99.3 102.4 104.5 NA [4,] 83.9 86.2 89.2 92.2 96.7 99.4 102.5 104.8 NA [5,] 84.2 86.3 89.3 92.4 96.7 99.7 102.8 105.2 NA [6,] 84.4 86.5 89.6 92.7 96.9 99.8 103.0 105.3 NA [7,] 84.6 86.5 89.6 93.1 97.3 99.7 103.2 105.5 NA [8,] 84.8 86.6 89.9 93.1 97.4 99.9 103.2 105.4 NA [9,] 84.8 86.8 90.2 93.5 97.9 100.4 103.6 105.7 NA [10,] 84.9 87.3 90.2 93.9 98.4 101.1 103.7 106.8 NA [11,] 85.0 87.7 90.4 94.3 98.4 101.3 103.7 106.8 NA [12,] 85.1 87.8 90.5 94.7 98.8 101.4 103.8 107.0 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/1xwk61398676179.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/2x9b71398676179.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/31gim1398676179.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/4w4rf1398676179.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,] 83.50 83.60 83.90 83.90 84.20 84.40 84.60 84.80 84.8 84.90 [2,] 86.70 87.15 87.70 87.70 87.80 88.05 88.05 88.25 88.5 88.75 [3,] 93.40 93.70 94.00 94.45 94.55 94.80 95.20 95.25 95.7 96.15 [4,] 100.35 100.55 100.85 100.95 101.25 101.40 101.45 101.55 102.0 102.40 [5,] 104.20 104.50 104.50 104.80 105.20 105.30 105.50 105.40 105.7 106.80 [,11] [,12] [1,] 85.00 85.10 [2,] 89.05 89.15 [3,] 96.35 96.75 [4,] 102.50 102.60 [5,] 106.80 107.00 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85.77491 86.21457 86.65422 87.04836 87.03664 87.3425 87.71457 [2,] 101.02509 101.18543 101.34578 101.85164 102.06336 102.2575 102.68543 [,8] [,9] [,10] [,11] [,12] [1,] 87.82043 88.15871 88.52491 88.83664 89.23664 [2,] 102.67957 103.24129 103.77509 103.86336 104.26336 $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(83.5, 86.7, 93.4, 100.35, 104.2, 83.6, 87.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54ct21398676179.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] [1,] 83.50 85.30 88.10 91.5 95.30 98.90 101.80 104.20 NA [2,] 83.90 86.15 89.25 92.0 96.45 99.35 102.45 104.65 NA [3,] 84.50 86.50 89.60 92.9 97.10 99.75 103.10 105.35 NA [4,] 84.85 87.05 90.20 93.7 98.15 100.75 103.65 106.25 NA [5,] 85.10 87.80 90.50 94.7 98.80 101.40 103.80 107.00 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 84.0667 86.0895 89.1667 92.12462 96.32462 99.11145 102.5527 104.6202 NA [2,] 84.9333 86.9105 90.0333 93.67538 97.87538 100.38855 103.6473 106.0798 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(83.5, 83.9, 84.5, 84.85, 85.1, 85.3, 86.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hmcz1398676179.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,] 7.604592 20.6 11.5750 [2,] 7.694212 20.8 11.7375 [3,] 7.730632 20.9 11.8125 [4,] 7.816622 21.4 12.1750 [5,] 7.966795 21.9 12.2750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.674800 20.62634 11.61295 [2,] 7.786464 21.17366 12.01205 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.60459212769307, 7.69421198016455, 7.73063191656196, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xwk61398676179.ps tmp/1xwk61398676179.png",intern=TRUE)) character(0) > try(system("convert tmp/2x9b71398676179.ps tmp/2x9b71398676179.png",intern=TRUE)) character(0) > try(system("convert tmp/31gim1398676179.ps tmp/31gim1398676179.png",intern=TRUE)) character(0) > try(system("convert tmp/4w4rf1398676179.ps tmp/4w4rf1398676179.png",intern=TRUE)) character(0) > try(system("convert tmp/54ct21398676179.ps tmp/54ct21398676179.png",intern=TRUE)) character(0) > try(system("convert tmp/6hmcz1398676179.ps tmp/6hmcz1398676179.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.009 0.719 4.759