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(104.4,104.4,104.4,104.4,104.4,104.41,104.42,104.68,106.02,106.35,106.38,106.47,106.5,106.56,113.07,116.26,118,118.02,118.04,118.12,118.12,118.17,118.22,118.22,118.23,118.23,118.23,119.94,120.88,121.14,121.16,121.2,121.2,121.2,121.2,121.2,121.22,121.22,121.95,123.05,123.44,123.65,123.79,123.87,123.91,123.94,124.28,126.28,126.68,126.69,126.69,126.99,128.79,128.84,128.95,128.97,128.97,128.97,128.97,128.97,128.97,128.98,128.99,129.07,129.76,130.47,130.76,130.88,131.04,131.06,131.13,131.15) > 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] 72 > (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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 104.40 106.50 118.23 121.22 126.68 128.97 NA [2,] 104.40 106.56 118.23 121.22 126.69 128.98 NA [3,] 104.40 113.07 118.23 121.95 126.69 128.99 NA [4,] 104.40 116.26 119.94 123.05 126.99 129.07 NA [5,] 104.40 118.00 120.88 123.44 128.79 129.76 NA [6,] 104.41 118.02 121.14 123.65 128.84 130.47 NA [7,] 104.42 118.04 121.16 123.79 128.95 130.76 NA [8,] 104.68 118.12 121.20 123.87 128.97 130.88 NA [9,] 106.02 118.12 121.20 123.91 128.97 131.04 NA [10,] 106.35 118.17 121.20 123.94 128.97 131.06 NA [11,] 106.38 118.22 121.20 124.28 128.97 131.13 NA [12,] 106.47 118.22 121.20 126.28 128.97 131.15 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/1ytrb1355431507.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/2o2d81355431507.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/3a5he1355431507.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/4h0iw1355431507.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] [1,] 104.400 104.400 104.40 104.400 104.40 104.410 104.420 104.680 106.020 [2,] 106.500 106.560 113.07 116.260 118.00 118.020 118.040 118.120 118.120 [3,] 119.725 119.725 120.09 121.495 122.16 122.395 122.475 122.535 122.555 [4,] 126.680 126.690 126.69 126.990 128.79 128.840 128.950 128.970 128.970 [5,] 128.970 128.980 128.99 129.070 129.76 130.470 130.760 130.880 131.040 [,10] [,11] [,12] [1,] 106.35 106.38 106.47 [2,] 118.17 118.22 118.22 [3,] 122.57 122.74 123.74 [4,] 128.97 128.97 128.97 [5,] 131.06 131.13 131.15 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106.7082 106.7405 111.3047 114.5738 115.2001 115.4158 115.4377 115.5364 [2,] 132.7418 132.7095 128.8753 128.4162 129.1199 129.3742 129.5123 129.5336 [,9] [,10] [,11] [,12] [1,] 115.5564 115.6037 115.8059 116.8059 [2,] 129.5536 129.5363 129.6741 130.6741 $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(104.4, 106.5, 119.725, 126.68, 128.97, 104.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5vb8h1355431507.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,] 104.400 113.070 118.230 121.220 126.680 128.970 NA [2,] 104.400 114.665 119.085 122.500 126.840 129.030 NA [3,] 104.415 118.030 121.150 123.720 128.895 130.615 NA [4,] 106.185 118.145 121.200 123.925 128.970 131.050 NA [5,] 106.470 118.220 121.200 124.280 128.970 131.150 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.6008 116.4427 120.1853 123.07 127.9235 129.6937 NA [2,] 105.2292 119.6173 122.1147 124.37 129.8665 131.5363 NA $out [1] 106.50 106.56 126.28 $group [1] 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(104.4, 104.4, 104.415, 106.185, 106.47, 113.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6iufc1355431507.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,] 8.874347 24.57 8.73250 [2,] 8.952696 24.63 8.79500 [3,] 9.188603 24.73 8.82875 [4,] 9.451265 25.71 10.23875 [5,] 9.483868 26.34 11.14500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.961202 24.2374 8.170246 [2,] 9.416003 25.2226 9.487254 $out [1] 10.22397 10.21486 15.88250 15.84500 $group [1] 1 1 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.87434673652095, 8.95269583578691, 9.18860286209005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ytrb1355431507.ps tmp/1ytrb1355431507.png",intern=TRUE)) character(0) > try(system("convert tmp/2o2d81355431507.ps tmp/2o2d81355431507.png",intern=TRUE)) character(0) > try(system("convert tmp/3a5he1355431507.ps tmp/3a5he1355431507.png",intern=TRUE)) character(0) > try(system("convert tmp/4h0iw1355431507.ps tmp/4h0iw1355431507.png",intern=TRUE)) character(0) > try(system("convert tmp/5vb8h1355431507.ps tmp/5vb8h1355431507.png",intern=TRUE)) character(0) > try(system("convert tmp/6iufc1355431507.ps tmp/6iufc1355431507.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.659 1.003 4.690