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(2.1,2.1,2.11,2.12,2.13,2.13,2.13,2.13,2.14,2.15,2.16,2.17,2.16,2.2,2.19,2.2,2.2,2.2,2.21,2.22,2.25,2.33,2.33,2.35,2.37,2.38,2.38,2.41,2.41,2.41,2.41,2.42,2.42,2.43,2.44,2.44,2.43,2.44,2.44,2.44,2.44,2.44,2.43,2.42,2.43,2.43,2.43,2.43,2.43,2.44,2.43,2.43,2.44,2.43,2.43,2.44,2.46,2.48,2.49,2.5,2.53,2.55,2.57,2.56,2.56,2.57,2.56,2.57,2.58,2.58,2.58,2.59) > 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,] 2.10 2.16 2.37 2.43 2.43 2.53 NA [2,] 2.10 2.20 2.38 2.44 2.44 2.55 NA [3,] 2.11 2.19 2.38 2.44 2.43 2.57 NA [4,] 2.12 2.20 2.41 2.44 2.43 2.56 NA [5,] 2.13 2.20 2.41 2.44 2.44 2.56 NA [6,] 2.13 2.20 2.41 2.44 2.43 2.57 NA [7,] 2.13 2.21 2.41 2.43 2.43 2.56 NA [8,] 2.13 2.22 2.42 2.42 2.44 2.57 NA [9,] 2.14 2.25 2.42 2.43 2.46 2.58 NA [10,] 2.15 2.33 2.43 2.43 2.48 2.58 NA [11,] 2.16 2.33 2.44 2.43 2.49 2.58 NA [12,] 2.17 2.35 2.44 2.43 2.50 2.59 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/1bc6l1355336973.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/2geyd1355336973.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/3g8yy1355336973.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/46vv01355336973.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,] 2.10 2.10 2.110 2.12 2.130 2.13 2.13 2.13 2.140 2.15 2.160 2.170 [2,] 2.16 2.20 2.190 2.20 2.200 2.20 2.21 2.22 2.250 2.33 2.330 2.350 [3,] 2.40 2.41 2.405 2.42 2.425 2.42 2.42 2.42 2.425 2.43 2.435 2.435 [4,] 2.43 2.44 2.440 2.44 2.440 2.44 2.43 2.44 2.460 2.48 2.490 2.500 [5,] 2.53 2.55 2.570 2.56 2.560 2.57 2.56 2.57 2.580 2.58 2.580 2.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,] 2.225841 2.255192 2.243742 2.265192 2.270192 2.265192 2.278093 2.278093 [2,] 2.574159 2.564808 2.566258 2.574808 2.579808 2.574808 2.561907 2.561907 [,9] [,10] [,11] [,12] [1,] 2.289543 2.333245 2.331795 2.338245 [2,] 2.560457 2.526755 2.538205 2.531755 $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(2.1, 2.16, 2.4, 2.43, 2.53, 2.1, 2.2, 2.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5fw2q1355336973.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,] 2.100 2.160 2.370 2.42 2.43 2.55 NA [2,] 2.115 2.200 2.395 2.43 2.43 2.56 NA [3,] 2.130 2.205 2.410 2.43 2.44 2.57 NA [4,] 2.145 2.290 2.425 2.44 2.47 2.58 NA [5,] 2.170 2.350 2.440 2.44 2.50 2.59 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.116317 2.16395 2.396317 2.425439 2.421756 2.560878 NA [2,] 2.143683 2.24605 2.423683 2.434561 2.458244 2.579122 NA $out [1] 2.53 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2.1, 2.115, 2.13, 2.145, 2.17, 2.16, 2.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6na2x1355336973.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.1434805 0.420 0.11250 [2,] 0.1525416 0.430 0.14125 [3,] 0.1623739 0.435 0.17750 [4,] 0.1670509 0.440 0.19125 [5,] 0.1714254 0.450 0.21750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1557561 0.4304389 0.1546947 [2,] 0.1689917 0.4395611 0.2003053 $out [1] 0.46 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.143480544558022, 0.152541633787705, 0.162373943237798, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bc6l1355336973.ps tmp/1bc6l1355336973.png",intern=TRUE)) character(0) > try(system("convert tmp/2geyd1355336973.ps tmp/2geyd1355336973.png",intern=TRUE)) character(0) > try(system("convert tmp/3g8yy1355336973.ps tmp/3g8yy1355336973.png",intern=TRUE)) character(0) > try(system("convert tmp/46vv01355336973.ps tmp/46vv01355336973.png",intern=TRUE)) character(0) > try(system("convert tmp/5fw2q1355336973.ps tmp/5fw2q1355336973.png",intern=TRUE)) character(0) > try(system("convert tmp/6na2x1355336973.ps tmp/6na2x1355336973.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.129 0.872 3.995