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(1.38,1.96,1.36,1.24,1.35,1.23,1.09,1.08,1.33,1.35,1.38,1.5,1.47,2.09,1.52,1.29,1.52,1.27,1.35,1.29,1.41,1.39,1.45,1.53,1.45,2.11,1.53,1.38,1.54,1.35,1.29,1.33,1.47,1.47,1.54,1.59,1.5,2,1.51,1.4,1.62,1.44,1.29,1.28,1.4,1.39,1.46,1.49,1.45,2.05,1.59,1.42,1.73,1.39,1.23,1.37,1.51,1.47,1.5,1.54,1.54,2.15,1.62,1.4,1.65,1.49,1.45,1.45,1.51,1.48,1.56,1.57) > 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,] 1.38 1.47 1.45 1.50 1.45 1.54 NA [2,] 1.96 2.09 2.11 2.00 2.05 2.15 NA [3,] 1.36 1.52 1.53 1.51 1.59 1.62 NA [4,] 1.24 1.29 1.38 1.40 1.42 1.40 NA [5,] 1.35 1.52 1.54 1.62 1.73 1.65 NA [6,] 1.23 1.27 1.35 1.44 1.39 1.49 NA [7,] 1.09 1.35 1.29 1.29 1.23 1.45 NA [8,] 1.08 1.29 1.33 1.28 1.37 1.45 NA [9,] 1.33 1.41 1.47 1.40 1.51 1.51 NA [10,] 1.35 1.39 1.47 1.39 1.47 1.48 NA [11,] 1.38 1.45 1.54 1.46 1.50 1.56 NA [12,] 1.50 1.53 1.59 1.49 1.54 1.57 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/wessaorg/rcomp/tmp/1ifia1355153156.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/wessaorg/rcomp/tmp/2h20t1355153156.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/wessaorg/rcomp/tmp/35dt41355153156.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/wessaorg/rcomp/tmp/4b3zb1355153156.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,] 1.38 1.96 1.510 1.24 1.35 1.23 1.09 1.28 1.33 1.35 1.38 1.490 [2,] 1.45 2.00 1.510 1.29 1.52 1.27 1.23 1.28 1.40 1.39 1.45 1.500 [3,] 1.46 2.07 1.525 1.39 1.58 1.37 1.29 1.31 1.44 1.43 1.48 1.535 [4,] 1.50 2.11 1.590 1.40 1.65 1.44 1.35 1.37 1.51 1.47 1.54 1.570 [5,] 1.54 2.15 1.620 1.42 1.73 1.49 1.45 1.45 1.51 1.48 1.56 1.590 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.427748 1.999046 1.473397 1.319046 1.496146 1.260345 1.212596 1.251947 [2,] 1.492252 2.140954 1.576603 1.460954 1.663854 1.479655 1.367404 1.368053 [,9] [,10] [,11] [,12] [1,] 1.369046 1.378397 1.421947 1.489848 [2,] 1.510954 1.481603 1.538053 1.580152 $out [1] 1.36 1.08 $group [1] 3 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.38, 1.45, 1.46, 1.5, 1.54, 1.96, 2, 2.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5v99k1355153156.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,] 1.080 1.27 1.290 1.280 1.230 1.400 NA [2,] 1.235 1.32 1.365 1.395 1.405 1.465 NA [3,] 1.350 1.43 1.470 1.450 1.485 1.525 NA [4,] 1.380 1.52 1.540 1.505 1.565 1.595 NA [5,] 1.500 1.53 1.590 1.620 1.730 1.650 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.283865 1.338779 1.390181 1.399828 1.412023 1.465706 NA [2,] 1.416135 1.521221 1.549819 1.500172 1.557977 1.584294 NA $out [1] 1.96 2.09 2.11 2.00 2.05 2.15 $group [1] 1 2 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.08, 1.235, 1.35, 1.38, 1.5, 1.27, 1.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qpg51355153156.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.0388158 0.100 0.04250 [2,] 0.0604494 0.170 0.07000 [3,] 0.0718525 0.185 0.08375 [4,] 0.1098622 0.310 0.09500 [5,] 0.1313646 0.380 0.11750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.04931500 0.1211451 0.07234733 [2,] 0.09439001 0.2488549 0.09515267 $out [1] 0.1375 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0388158043413591, 0.0604494041278198, 0.0718525043508917, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ifia1355153156.ps tmp/1ifia1355153156.png",intern=TRUE)) character(0) > try(system("convert tmp/2h20t1355153156.ps tmp/2h20t1355153156.png",intern=TRUE)) character(0) > try(system("convert tmp/35dt41355153156.ps tmp/35dt41355153156.png",intern=TRUE)) character(0) > try(system("convert tmp/4b3zb1355153156.ps tmp/4b3zb1355153156.png",intern=TRUE)) character(0) > try(system("convert tmp/5v99k1355153156.ps tmp/5v99k1355153156.png",intern=TRUE)) character(0) > try(system("convert tmp/6qpg51355153156.ps tmp/6qpg51355153156.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.013 0.623 3.623