R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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.2,7,7,7.3,7.3,7.1,6.9,6.7,6.8,7.5) > 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] 79 > (np <- floor(n / par1)) [1] 6 > 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 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8.7 8.0 7.3 7.7 8.6 7.5 7.3 [2,] 8.7 8.0 7.1 8.0 8.7 7.2 7.3 [3,] 8.6 7.9 6.8 8.0 8.5 6.9 7.1 [4,] 8.5 8.0 6.4 7.7 8.3 6.6 6.9 [5,] 8.3 7.7 6.1 7.3 8.0 6.5 6.7 [6,] 8.0 7.2 6.5 7.4 8.0 6.6 6.8 [7,] 8.2 7.5 7.7 8.1 8.8 7.7 7.5 [8,] 8.1 7.3 7.9 8.3 8.7 8.0 NA [9,] 8.1 7.0 7.5 8.1 8.5 7.7 NA [10,] 8.0 7.0 6.9 7.9 8.1 7.2 NA [11,] 7.9 7.0 6.6 7.9 7.8 7.0 NA [12,] 7.9 7.2 6.9 8.3 7.7 7.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/fisher/rcomp/tmp/10uoh1355418139.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/fisher/rcomp/tmp/206h61355418139.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/fisher/rcomp/tmp/37rdi1355418139.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/fisher/rcomp/tmp/4l0fc1355418139.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.30 7.0 6.90 6.6 6.90 [2,] 7.4 7.25 7.00 6.75 6.60 6.7 7.60 7.90 7.5 7.00 7.0 7.00 [3,] 7.7 8.00 7.90 7.70 7.30 7.2 7.70 8.05 7.9 7.55 7.4 7.45 [4,] 8.3 8.35 8.25 8.15 7.85 7.7 8.15 8.30 8.1 8.00 7.9 7.90 [5,] 8.7 8.70 8.60 8.50 8.30 8.0 8.80 8.70 8.5 8.10 7.9 8.30 $n [1] 7 7 7 7 7 7 7 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.162535 7.343098 7.15352 6.863943 6.55352 6.602816 7.371549 7.791987 [2,] 8.237465 8.656902 8.64648 8.536057 8.04648 7.797184 8.028451 8.308013 [,9] [,10] [,11] [,12] [1,] 7.512981 6.904968 6.819471 6.869471 [2,] 8.287019 8.195032 7.980529 8.030529 $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(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/fisher/rcomp/tmp/554461355418139.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] [1,] 7.90 7.00 6.10 7.30 7.70 6.50 6.70 [2,] 8.00 7.10 6.55 7.70 8.00 6.75 6.85 [3,] 8.15 7.40 6.90 7.95 8.40 7.10 7.10 [4,] 8.55 7.95 7.40 8.10 8.65 7.60 7.30 [5,] 8.70 8.00 7.90 8.30 8.80 8.00 7.50 $n [1] 12 12 12 12 12 12 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 7.899141 7.012309 6.512309 7.767557 8.103531 6.712309 6.831267 [2,] 8.400859 7.787691 7.287691 8.132443 8.696469 7.487691 7.368733 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" 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/fisher/rcomp/tmp/65l5z1355418139.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.4636809 1.20 0.3250 [2,] 0.5363165 1.35 0.6750 [3,] 0.5765854 1.45 0.9125 [4,] 0.7159212 1.70 1.1750 [5,] 0.8474050 2.20 1.4000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.4946665 1.290363 0.6844466 [2,] 0.6585043 1.609637 1.1405534 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.463680924774785, 0.536316489633119, 0.57658541744755, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10uoh1355418139.ps tmp/10uoh1355418139.png",intern=TRUE)) character(0) > try(system("convert tmp/206h61355418139.ps tmp/206h61355418139.png",intern=TRUE)) character(0) > try(system("convert tmp/37rdi1355418139.ps tmp/37rdi1355418139.png",intern=TRUE)) character(0) > try(system("convert tmp/4l0fc1355418139.ps tmp/4l0fc1355418139.png",intern=TRUE)) character(0) > try(system("convert tmp/554461355418139.ps tmp/554461355418139.png",intern=TRUE)) character(0) > try(system("convert tmp/65l5z1355418139.ps tmp/65l5z1355418139.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.077 0.845 3.914