R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(98.01,99.2,100.7,106.41,107.51,107.1,99.75,98.96,107.26,107.11,107.2,107.65,104.78,105.56,107.95,107.11,107.47,107.06,99.71,99.6,107.19,107.26,113.24,113.52,110.48,111.41,115.5,118.32,118.42,117.5,110.23,109.19,118.41,118.3,116.1,114.11,113.41,114.33,116.61,123.64,123.77,123.39,116.03,114.95,123.4,123.53,114.45,114.26,114.35,112.77,115.31,114.93,116.38,115.07,105,103.43,114.52,115.04,117.16,115) > 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] 60 > (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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 98.01 104.78 110.48 113.41 114.35 NA [2,] 99.20 105.56 111.41 114.33 112.77 NA [3,] 100.70 107.95 115.50 116.61 115.31 NA [4,] 106.41 107.11 118.32 123.64 114.93 NA [5,] 107.51 107.47 118.42 123.77 116.38 NA [6,] 107.10 107.06 117.50 123.39 115.07 NA [7,] 99.75 99.71 110.23 116.03 105.00 NA [8,] 98.96 99.60 109.19 114.95 103.43 NA [9,] 107.26 107.19 118.41 123.40 114.52 NA [10,] 107.11 107.26 118.30 123.53 115.04 NA [11,] 107.20 113.24 116.10 114.45 117.16 NA [12,] 107.65 113.52 114.11 114.26 115.00 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/rcomp/tmp/1mzso1335472462.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/www/rcomp/tmp/2fe6e1335472462.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/www/rcomp/tmp/3qfkx1335472462.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/www/rcomp/tmp/4024y1335472462.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,] 98.01 99.20 100.70 106.41 107.47 107.06 99.71 98.96 107.19 107.11 [2,] 104.78 105.56 107.95 107.11 107.51 107.10 99.75 99.60 107.26 107.26 [3,] 110.48 111.41 115.31 114.93 116.38 115.07 105.00 103.43 114.52 115.04 [4,] 113.41 112.77 115.50 118.32 118.42 117.50 110.23 109.19 118.41 118.30 [5,] 114.35 114.33 116.61 123.64 123.77 123.39 116.03 114.95 123.40 123.53 [,11] [,12] [1,] 113.24 113.52 [2,] 113.24 113.52 [3,] 114.45 114.11 [4,] 116.10 114.26 [5,] 117.16 115.00 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.3821 106.3154 109.9752 107.0090 108.6710 107.7214 97.59486 96.65373 [2,] 116.5779 116.5046 120.6448 122.8510 124.0890 122.4186 112.40514 110.20627 [,9] [,10] [,11] [,12] [1,] 106.6414 107.2392 112.4291 113.5871 [2,] 122.3986 122.8408 116.4709 114.6329 $out [1] 107.20 107.65 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.01, 104.78, 110.48, 113.41, 114.35, 99.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5m80g1335472462.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,] 98.010 104.78 109.190 113.410 112.770 NA [2,] 99.475 105.17 110.945 114.390 113.560 NA [3,] 106.755 107.15 115.800 116.320 114.965 NA [4,] 107.230 107.71 118.310 123.465 115.190 NA [5,] 107.650 107.95 118.420 123.770 117.160 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.2179 105.9915 112.4408 112.1808 114.2215 NA [2,] 110.2921 108.3085 119.1592 120.4592 115.7085 NA $out [1] 99.71 99.60 113.24 113.52 105.00 103.43 $group [1] 2 2 2 2 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(98.01, 99.475, 106.755, 107.23, 107.65, 104.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/6qkia1335472462.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,] 6.239089 15.130 2.860 [2,] 6.514483 15.520 7.380 [3,] 6.918694 16.255 9.995 [4,] 7.094440 16.335 10.975 [5,] 7.374000 17.230 11.210 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.654171 15.88327 8.355296 [2,] 7.183216 16.62673 11.634704 $out [1] 3.896511 2.986230 9.960000 7.350000 0.740000 $group [1] 1 1 2 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.23908887578947, 6.51448294985633, 6.91869371609788, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mzso1335472462.ps tmp/1mzso1335472462.png",intern=TRUE)) character(0) > try(system("convert tmp/2fe6e1335472462.ps tmp/2fe6e1335472462.png",intern=TRUE)) character(0) > try(system("convert tmp/3qfkx1335472462.ps tmp/3qfkx1335472462.png",intern=TRUE)) character(0) > try(system("convert tmp/4024y1335472462.ps tmp/4024y1335472462.png",intern=TRUE)) character(0) > try(system("convert tmp/5m80g1335472462.ps tmp/5m80g1335472462.png",intern=TRUE)) character(0) > try(system("convert tmp/6qkia1335472462.ps tmp/6qkia1335472462.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.380 1.000 2.379