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(0.75,0.75,0.77,0.78,0.79,1.01,1.16,1.14,1.12,1.1,1.1,1.1,1.1,1.09,1.09,1.1,1.1,1.17,1.15,1.04,0.94,0.88,0.85,0.85,0.85,0.84,0.83,0.8,0.78,1.02,1.19,1.1,0.96,0.87,0.83,0.82,0.81,0.78,0.79,0.8,0.79,0.97,1.01,0.92,0.87,0.84,0.81,0.81,0.83,0.83,0.85,0.88,0.89,1.21,1.32,1.33,1.23,1.16,1.12,1.06,1.08,1.09,1.03,1.04,1.05,1.19,1.14,1.05,0.95,0.87,0.86,0.85) > 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,] 0.75 1.10 0.85 0.81 0.83 1.08 NA [2,] 0.75 1.09 0.84 0.78 0.83 1.09 NA [3,] 0.77 1.09 0.83 0.79 0.85 1.03 NA [4,] 0.78 1.10 0.80 0.80 0.88 1.04 NA [5,] 0.79 1.10 0.78 0.79 0.89 1.05 NA [6,] 1.01 1.17 1.02 0.97 1.21 1.19 NA [7,] 1.16 1.15 1.19 1.01 1.32 1.14 NA [8,] 1.14 1.04 1.10 0.92 1.33 1.05 NA [9,] 1.12 0.94 0.96 0.87 1.23 0.95 NA [10,] 1.10 0.88 0.87 0.84 1.16 0.87 NA [11,] 1.10 0.85 0.83 0.81 1.12 0.86 NA [12,] 1.10 0.85 0.82 0.81 1.06 0.85 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/1irvi1356643212.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/2xaui1356643212.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/3b7cn1356643212.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/4cqfb1356643212.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,] 0.75 0.750 0.77 0.78 0.78 0.970 1.140 0.920 0.870 0.840 0.810 0.81 [2,] 0.81 0.780 0.79 0.80 0.79 1.010 1.140 1.040 0.940 0.870 0.830 0.82 [3,] 0.84 0.835 0.84 0.84 0.84 1.095 1.155 1.075 0.955 0.875 0.855 0.85 [4,] 1.08 1.090 1.03 1.04 1.05 1.190 1.190 1.140 1.120 1.100 1.100 1.06 [5,] 1.10 1.090 1.09 1.10 1.10 1.210 1.190 1.140 1.230 1.160 1.120 1.10 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6658413 0.63504 0.6851922 0.6851922 0.6722916 0.9788942 1.122748 [2,] 1.0141587 1.03496 0.9948078 0.9948078 1.0077084 1.2111058 1.187252 [,8] [,9] [,10] [,11] [,12] [1,] 1.010497 0.8388942 0.7266426 0.6808413 0.6951922 [2,] 1.139503 1.0711058 1.0233574 1.0291587 1.0048078 $out [1] 1.01 1.32 1.33 $group [1] 7 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.75, 0.81, 0.84, 1.08, 1.1, 0.75, 0.78, 0.835, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/517ja1356643212.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,] 0.750 0.85 0.780 0.780 0.830 0.850 NA [2,] 0.775 0.91 0.825 0.795 0.865 0.910 NA [3,] 1.055 1.09 0.845 0.810 1.090 1.045 NA [4,] 1.110 1.10 0.990 0.895 1.220 1.085 NA [5,] 1.160 1.17 1.190 1.010 1.330 1.190 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9022043 1.00334 0.7697424 0.7643893 0.9280821 0.9651813 NA [2,] 1.2077957 1.17666 0.9202576 0.8556107 1.2519179 1.1248187 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.75, 0.775, 1.055, 1.11, 1.16, 0.85, 0.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6issi1356643212.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.1294218 0.290 0.08750 [2,] 0.1314692 0.310 0.15500 [3,] 0.1368687 0.320 0.18250 [4,] 0.1420855 0.345 0.20625 [5,] 0.1533188 0.360 0.23500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1320265 0.3040363 0.1591245 [2,] 0.1417109 0.3359637 0.2058755 $out [1] 0.10616026 0.09948199 0.24000000 0.41000000 0.04000000 $group [1] 1 1 2 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.129421791055448, 0.131469165926729, 0.136868719066652, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1irvi1356643212.ps tmp/1irvi1356643212.png",intern=TRUE)) character(0) > try(system("convert tmp/2xaui1356643212.ps tmp/2xaui1356643212.png",intern=TRUE)) character(0) > try(system("convert tmp/3b7cn1356643212.ps tmp/3b7cn1356643212.png",intern=TRUE)) character(0) > try(system("convert tmp/4cqfb1356643212.ps tmp/4cqfb1356643212.png",intern=TRUE)) character(0) > try(system("convert tmp/517ja1356643212.ps tmp/517ja1356643212.png",intern=TRUE)) character(0) > try(system("convert tmp/6issi1356643212.ps tmp/6issi1356643212.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.344 0.848 4.186