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.42,104.42,104.42,104.42,104.42,104.42,104.42,104.44,104.44,104.44,105.19,105.19,105.19,106.38,106.38,106.38,106.38,106.38,106.38,106.72,106.73,106.72,108.6,108.6,109.65,109.65,109.65,109.65,109.65,109.65,109.65,109.65,112.27,112.27,112.27,112.27,112.27,114.98,114.98,114.98,114.98,114.98,114.98,116.04,116.59,116.59,116.59,116.59,118.75,118.75,118.75,118.75,118.75,118.75,118.75,119.31,119.31,119.31,119.31,119.31,121.19,121.19,121.19,121.19,121.19,122.91,122.91,122.91,122.91,122.91,122.91,122.91) > 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.42 105.19 109.65 112.27 118.75 121.19 NA [2,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [3,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [4,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [5,] 104.42 106.38 109.65 114.98 118.75 121.19 NA [6,] 104.42 106.38 109.65 114.98 118.75 122.91 NA [7,] 104.42 106.38 109.65 114.98 118.75 122.91 NA [8,] 104.44 106.72 109.65 116.04 119.31 122.91 NA [9,] 104.44 106.73 112.27 116.59 119.31 122.91 NA [10,] 104.44 106.72 112.27 116.59 119.31 122.91 NA [11,] 105.19 108.60 112.27 116.59 119.31 122.91 NA [12,] 105.19 108.60 112.27 116.59 119.31 122.91 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/1pi8a1354201811.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/20rui1354201812.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/3ws151354201812.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/4guz21354201812.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.42 104.420 104.420 104.420 104.420 104.420 104.420 104.440 104.44 [2,] 105.19 106.380 106.380 106.380 106.380 106.380 106.380 106.720 106.73 [3,] 110.96 112.315 112.315 112.315 112.315 112.315 112.315 112.845 114.43 [4,] 118.75 118.750 118.750 118.750 118.750 118.750 118.750 119.310 119.31 [5,] 121.19 121.190 121.190 121.190 121.190 122.910 122.910 122.910 122.91 [,10] [,11] [,12] [1,] 104.44 105.19 105.19 [2,] 106.72 108.60 108.60 [3,] 114.43 114.43 114.43 [4,] 119.31 119.31 119.31 [5,] 122.91 122.91 122.91 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 102.2134 104.336 104.336 104.336 104.336 104.336 104.336 104.724 106.3155 [2,] 119.7066 120.294 120.294 120.294 120.294 120.294 120.294 120.966 122.5445 [,10] [,11] [,12] [1,] 106.309 107.5217 107.5217 [2,] 122.551 121.3383 121.3383 $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.42, 105.19, 110.96, 118.75, 121.19, 104.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/53pap1354201812.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.42 106.380 109.65 114.98 118.75 121.19 NA [2,] 104.42 106.380 109.65 114.98 118.75 121.19 NA [3,] 104.42 106.380 109.65 114.98 118.75 122.91 NA [4,] 104.44 106.725 112.27 116.59 119.31 122.91 NA [5,] 104.44 106.730 112.27 116.59 119.31 122.91 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 104.4109 106.2226 108.455 114.2457 118.4946 122.1255 NA [2,] 104.4291 106.5374 110.845 115.7143 119.0054 123.6945 NA $out [1] 105.19 105.19 105.19 108.60 108.60 112.27 $group [1] 1 1 2 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(104.42, 104.42, 104.42, 104.44, 104.44, 106.38, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6t7xi1354201812.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.692311 16.77 10.51500 [2,] 6.805431 16.77 10.51875 [3,] 6.862482 17.72 10.61000 [4,] 7.244820 18.47 10.61000 [5,] 7.362194 18.49 10.61000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.662074 16.94462 10.56838 [2,] 7.062890 18.49538 10.65162 $out [1] 10.8250 11.0400 9.1125 9.1125 $group [1] 3 3 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.692311259946, 6.80543140929851, 6.86248219484287, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pi8a1354201811.ps tmp/1pi8a1354201811.png",intern=TRUE)) character(0) > try(system("convert tmp/20rui1354201812.ps tmp/20rui1354201812.png",intern=TRUE)) character(0) > try(system("convert tmp/3ws151354201812.ps tmp/3ws151354201812.png",intern=TRUE)) character(0) > try(system("convert tmp/4guz21354201812.ps tmp/4guz21354201812.png",intern=TRUE)) character(0) > try(system("convert tmp/53pap1354201812.ps tmp/53pap1354201812.png",intern=TRUE)) character(0) > try(system("convert tmp/6t7xi1354201812.ps tmp/6t7xi1354201812.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.109 0.784 3.885