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(8.7,8.7,8.6,8.5,8.3,8,8.2,8.1,8.1,8,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.4,6.1,6.5,7.7,7.9,7.5,6.9,6.6,6.9,7.7,8,8,7.7,7.3,7.4,8.1,8.3,8.1,7.9,7.9,8.3,8.6,8.7,8.5,8.3,8,8,8.8,8.7,8.5,8.1,7.8,7.7,7.5,7.2,6.9,6.6,6.5,6.6,7.7,8,7.7,7.3,7,7,7.3,7.3,7.1,7.1,7,7,7.5,7.8,7.9,8.1,8.3,8.4) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 8.7 8.0 7.3 7.7 8.6 7.5 7.3 NA [2,] 8.7 8.0 7.1 8.0 8.7 7.2 7.3 NA [3,] 8.6 7.9 6.8 8.0 8.5 6.9 7.1 NA [4,] 8.5 8.0 6.4 7.7 8.3 6.6 7.1 NA [5,] 8.3 7.7 6.1 7.3 8.0 6.5 7.0 NA [6,] 8.0 7.2 6.5 7.4 8.0 6.6 7.0 NA [7,] 8.2 7.5 7.7 8.1 8.8 7.7 7.5 NA [8,] 8.1 7.3 7.9 8.3 8.7 8.0 7.8 NA [9,] 8.1 7.0 7.5 8.1 8.5 7.7 7.9 NA [10,] 8.0 7.0 6.9 7.9 8.1 7.3 8.1 NA [11,] 7.9 7.0 6.6 7.9 7.8 7.0 8.3 NA [12,] 7.9 7.2 6.9 8.3 7.7 7.0 8.4 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/1376j1400763266.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/2t5ch1400763266.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/334301400763266.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/4yejm1400763266.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] [,12] [1,] 7.3 7.10 6.80 6.40 6.10 6.5 7.50 7.80 7.0 6.90 6.6 6.9 [2,] 7.4 7.25 7.00 6.85 6.75 6.8 7.60 7.85 7.6 7.15 7.0 7.1 [3,] 7.7 8.00 7.90 7.70 7.30 7.2 7.70 8.00 7.9 7.90 7.8 7.7 [4,] 8.3 8.35 8.25 8.15 7.85 7.7 8.15 8.20 8.1 8.05 7.9 8.1 [5,] 8.7 8.70 8.60 8.50 8.30 8.0 8.80 8.70 8.5 8.10 8.3 8.4 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.162535 7.343098 7.15352 6.923661 6.643098 6.662535 7.371549 7.790986 [2,] 8.237465 8.656902 8.64648 8.476339 7.956902 7.737465 8.028451 8.209014 [,9] [,10] [,11] [,12] [1,] 7.601408 7.362535 7.262535 7.102816 [2,] 8.198592 8.437465 8.337465 8.297184 $out [1] 7.3 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(7.3, 7.4, 7.7, 8.3, 8.7, 7.1, 7.25, 8, 8.35, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bnhx1400763266.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] [1,] 7.90 7.00 6.10 7.30 7.70 6.50 7.0 NA [2,] 8.00 7.10 6.55 7.70 8.00 6.75 7.1 NA [3,] 8.15 7.40 6.90 7.95 8.40 7.10 7.4 NA [4,] 8.55 7.95 7.40 8.10 8.65 7.60 8.0 NA [5,] 8.70 8.00 7.90 8.30 8.80 8.00 8.4 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.899141 7.012309 6.512309 7.767557 8.103531 6.712309 6.989504 NA [2,] 8.400859 7.787691 7.287691 8.132443 8.696469 7.487691 7.810496 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(7.9, 8, 8.15, 8.55, 8.7, 7, 7.1, 7.4, 7.95, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6wd001400763266.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,] 0.4336995 1.20 0.350 [2,] 0.5080013 1.40 0.725 [3,] 0.6076835 1.50 0.900 [4,] 0.7159212 1.75 1.100 [5,] 0.8275034 2.20 1.300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5128498 1.340363 0.72896 [2,] 0.7025172 1.659637 1.07104 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.433699479011951, 0.508001287079908, 0.607683493556345, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1376j1400763266.ps tmp/1376j1400763266.png",intern=TRUE)) character(0) > try(system("convert tmp/2t5ch1400763266.ps tmp/2t5ch1400763266.png",intern=TRUE)) character(0) > try(system("convert tmp/334301400763266.ps tmp/334301400763266.png",intern=TRUE)) character(0) > try(system("convert tmp/4yejm1400763266.ps tmp/4yejm1400763266.png",intern=TRUE)) character(0) > try(system("convert tmp/5bnhx1400763266.ps tmp/5bnhx1400763266.png",intern=TRUE)) character(0) > try(system("convert tmp/6wd001400763266.ps tmp/6wd001400763266.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.848 0.519 3.403