R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(100.44,100.47,100.49,100.52,100.47,100.48,100.48,100.53,100.62,100.89,100.97,101.01,101.02,100.92,100.93,100.98,101.07,101.1,101.11,101.19,101.31,101.52,101.61,101.65,101.66,101.56,101.75,101.83,101.98,102.06,102.07,102.1,102.42,102.91,103.14,103.23,103.23,102.91,103.11,103.14,103.26,103.3,103.32,103.44,103.54,103.98,104.24,104.29,104.29,103.98,103.98,103.89,103.86,103.88,103.88,104.31,104.41,104.8,104.89,104.9,104.9,104.54,104.67,104.87,105.04,105.09,105.1,105.46,105.83,106.27,106.46,106.52,106.53,105.96,106,106.15,106.32,106.41,106.41,106.81,106.99,107.35,107.53,107.56) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.44 101.02 101.66 103.23 104.29 104.90 106.53 NA [2,] 100.47 100.92 101.56 102.91 103.98 104.54 105.96 NA [3,] 100.49 100.93 101.75 103.11 103.98 104.67 106.00 NA [4,] 100.52 100.98 101.83 103.14 103.89 104.87 106.15 NA [5,] 100.47 101.07 101.98 103.26 103.86 105.04 106.32 NA [6,] 100.48 101.10 102.06 103.30 103.88 105.09 106.41 NA [7,] 100.48 101.11 102.07 103.32 103.88 105.10 106.41 NA [8,] 100.53 101.19 102.10 103.44 104.31 105.46 106.81 NA [9,] 100.62 101.31 102.42 103.54 104.41 105.83 106.99 NA [10,] 100.89 101.52 102.91 103.98 104.80 106.27 107.35 NA [11,] 100.97 101.61 103.14 104.24 104.89 106.46 107.53 NA [12,] 101.01 101.65 103.23 104.29 104.90 106.52 107.56 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/1hraq1385977063.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/23gia1385977063.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/3d3c51385977063.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/40san1385977063.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,] 100.440 100.47 100.490 100.520 100.470 100.480 100.48 100.530 100.620 [2,] 101.340 101.24 101.340 101.405 101.525 101.580 101.59 101.645 101.865 [3,] 103.230 102.91 103.110 103.140 103.260 103.300 103.32 103.440 103.540 [4,] 104.595 104.26 104.325 104.380 104.450 104.485 104.49 104.885 105.120 [5,] 106.530 105.96 106.000 106.150 106.320 106.410 106.41 106.810 106.990 [,10] [,11] [,12] [1,] 100.890 100.970 101.01 [2,] 102.215 102.375 102.44 [3,] 103.980 104.240 104.29 [4,] 105.535 105.675 105.71 [5,] 107.350 107.530 107.56 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.2862 101.1065 101.3274 101.3634 101.5132 101.5652 101.5882 101.5051 [2,] 105.1738 104.7135 104.8926 104.9166 105.0068 105.0348 105.0518 105.3749 [,9] [,10] [,11] [,12] [1,] 101.5962 101.9973 102.2693 102.3372 [2,] 105.4838 105.9627 106.2107 106.2428 $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(100.44, 101.34, 103.23, 104.595, 106.53, 100.47, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5n90m1385977063.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] [,8] [1,] 100.440 100.920 101.560 102.910 103.860 104.540 105.960 NA [2,] 100.475 101.000 101.790 103.185 103.885 104.885 106.235 NA [3,] 100.505 101.105 102.065 103.310 104.135 105.095 106.470 NA [4,] 100.755 101.415 102.665 103.760 104.605 106.050 107.170 NA [5,] 101.010 101.650 103.230 104.290 104.900 106.520 107.560 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.3773 100.9157 101.6659 103.0477 103.8066 104.5636 106.0435 NA [2,] 100.6327 101.2943 102.4641 103.5723 104.4634 105.6264 106.8965 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(100.44, 100.475, 100.505, 100.755, 101.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/624ai1385977063.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,] 2.034714 5.490 2.9000 [2,] 2.097972 5.740 2.9500 [3,] 2.185629 6.010 3.1300 [4,] 2.356707 6.415 3.2625 [5,] 2.411569 6.560 3.3200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.067619 5.702128 2.987467 [2,] 2.303640 6.317872 3.272533 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.03471420714603, 2.09797220864511, 2.18562921572091, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hraq1385977063.ps tmp/1hraq1385977063.png",intern=TRUE)) character(0) > try(system("convert tmp/23gia1385977063.ps tmp/23gia1385977063.png",intern=TRUE)) character(0) > try(system("convert tmp/3d3c51385977063.ps tmp/3d3c51385977063.png",intern=TRUE)) character(0) > try(system("convert tmp/40san1385977063.ps tmp/40san1385977063.png",intern=TRUE)) character(0) > try(system("convert tmp/5n90m1385977063.ps tmp/5n90m1385977063.png",intern=TRUE)) character(0) > try(system("convert tmp/624ai1385977063.ps tmp/624ai1385977063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.045 0.988 6.020