R version 2.6.0 (2007-10-03) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(18.33,22.6,24.9,24.8,23.8,25.1,26,27.4,27.3,24.3,28.4,24.4,30.3,31.5,29.8,25.3,25.6,26.7,27.4,28.6,26.3,28.5,28.4,29.4,30.3,29.6,32.1,32.4,36.3,34.6,36.3,40.3,40.4,45.4,39,35.7,40.2,41.7,49.1,49.6,47,52,53.1,57.8,57.9,54.6,51.3,52.7,58.5,56.6,57.9,64.4,65.1,64.6,68.9,68.8,59.3,55,55.4,58,50.8,54.6,58.6,63.6,64.5,66.9,71.9,68.7,74.2,75.8) > par1 = '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2006), Standard Deviation Plot (v1.0.0) 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 > #Technical description: Write here your technical program description > par1 <- as.numeric(par1) > (n <- length(x)) [1] 70 > (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 6 6 6 6 6 6 6 6 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18.33 30.3 30.3 40.2 58.5 50.8 [2,] 22.60 31.5 29.6 41.7 56.6 54.6 [3,] 24.90 29.8 32.1 49.1 57.9 58.6 [4,] 24.80 25.3 32.4 49.6 64.4 63.6 [5,] 23.80 25.6 36.3 47.0 65.1 64.5 [6,] 25.10 26.7 34.6 52.0 64.6 66.9 [7,] 26.00 27.4 36.3 53.1 68.9 71.9 [8,] 27.40 28.6 40.3 57.8 68.8 68.7 [9,] 27.30 26.3 40.4 57.9 59.3 74.2 [10,] 24.30 28.5 45.4 54.6 55.0 75.8 [11,] 28.40 28.4 39.0 51.3 55.4 NA [12,] 24.40 29.4 35.7 52.7 58.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/www/html/rcomp/tmp/12kth1197032082.ps",horizontal=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/www/html/rcomp/tmp/2jhw61197032082.ps",horizontal=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/www/html/rcomp/tmp/37nld1197032082.ps",horizontal=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/www/html/rcomp/tmp/4ve791197032082.ps",horizontal=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,] 18.33 22.6 24.9 24.8 23.80 25.1 26.0 27.40 26.30 24.3 28.4 24.4 [2,] 30.30 29.6 29.8 25.3 25.60 26.7 27.4 28.60 27.30 28.5 28.4 29.4 [3,] 35.25 36.6 40.6 41.0 41.65 43.3 44.7 49.05 49.15 50.0 39.0 35.7 [4,] 50.80 54.6 57.9 63.6 64.50 64.6 68.9 68.70 59.30 55.0 51.3 52.7 [5,] 58.50 56.6 58.6 64.4 65.10 66.9 71.9 68.80 74.20 75.8 55.4 58.0 $n [1] 6 6 6 6 6 6 6 6 6 6 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 22.02684 20.47419 22.47459 16.29526 16.55824 18.85328 17.93116 23.18420 [2,] 48.47316 52.72581 58.72541 65.70474 66.74176 67.74672 71.46884 74.91580 [,9] [,10] [,11] [,12] [1,] 28.50897 32.90664 22.81892 19.23628 [2,] 69.79103 67.09336 55.18108 52.16372 $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(18.33, 30.3, 35.25, 50.8, 58.5, 22.6, 29.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5k76t1197032082.ps",horizontal=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,] 22.60 25.30 29.60 40.20 55.00 50.8 [2,] 24.05 26.50 32.25 48.05 57.25 58.6 [3,] 24.85 28.45 36.00 51.65 58.90 65.7 [4,] 26.65 29.60 39.65 53.85 64.85 71.9 [5,] 28.40 31.50 45.40 57.90 68.90 75.8 $n [1] 12 12 12 12 12 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 23.66412 27.03607 32.62481 49.00458 55.43359 59.05479 [2,] 26.03588 29.86393 39.37519 54.29542 62.36641 72.34521 $out [1] 18.33 $group [1] 1 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(22.6, 24.05, 24.85, 26.65, 28.4, 25.3, 26.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6aurr1197032082.ps",horizontal=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,] 12.58690 27.000 17.8500 [2,] 14.72653 33.850 22.5375 [3,] 18.33549 40.735 26.8500 [4,] 19.04178 43.850 32.9000 [5,] 20.37672 51.500 35.3250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16.36728 36.17393 22.12359 [2,] 20.30371 45.29607 31.57641 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(12.5868979498525, 14.7265300271534, 18.3354928601388, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/12kth1197032082.ps tmp/12kth1197032082.png") > system("convert tmp/2jhw61197032082.ps tmp/2jhw61197032082.png") > system("convert tmp/37nld1197032082.ps tmp/37nld1197032082.png") > system("convert tmp/4ve791197032082.ps tmp/4ve791197032082.png") > system("convert tmp/5k76t1197032082.ps tmp/5k76t1197032082.png") > system("convert tmp/6aurr1197032082.ps tmp/6aurr1197032082.png") > > > proc.time() user system elapsed 1.361 0.850 1.603