R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(101.97,103.9,106.85,106.93,107.13,107.07,107.2,107.78,108,108.11,107.26,105.3,105.55,105.38,106.12,106.85,107.92,107.97,107.76,107.99,108.41,107.61,106.54,106.24,106.19,106.71,106.36,107.53,107.89,108,108.05,108.86,109.27,108.87,108.88,108.19,108.19,108.91,110.39,111.21,111.44,111.87,111.88,111.93,111.76,111.66,110.25,109.05,109.47,109.68,110.93,111.86,112.66,112.96,113.14,113.53,113.62,112.51,111,108.49,108.52,110.66,111.15,112.14,113.38,113.75,113.89,113.92,116.4,115.86,115.16,114.45,114.65,114.85,116.51,118.18,118.75,119.06,119.28,119.68,119.28,117.3,114.23,112.56,112.83,112.35,112.8,113.84,115.02,115.46,115,115.3,116.09,115.49,112.89,110.66) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 101.97 105.55 106.19 108.19 109.47 108.52 114.65 112.83 NA [2,] 103.90 105.38 106.71 108.91 109.68 110.66 114.85 112.35 NA [3,] 106.85 106.12 106.36 110.39 110.93 111.15 116.51 112.80 NA [4,] 106.93 106.85 107.53 111.21 111.86 112.14 118.18 113.84 NA [5,] 107.13 107.92 107.89 111.44 112.66 113.38 118.75 115.02 NA [6,] 107.07 107.97 108.00 111.87 112.96 113.75 119.06 115.46 NA [7,] 107.20 107.76 108.05 111.88 113.14 113.89 119.28 115.00 NA [8,] 107.78 107.99 108.86 111.93 113.53 113.92 119.68 115.30 NA [9,] 108.00 108.41 109.27 111.76 113.62 116.40 119.28 116.09 NA [10,] 108.11 107.61 108.87 111.66 112.51 115.86 117.30 115.49 NA [11,] 107.26 106.54 108.88 110.25 111.00 115.16 114.23 112.89 NA [12,] 105.30 106.24 108.19 109.05 108.49 114.45 112.56 110.66 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/108e71426175014.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/2l2qb1426175014.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/3l8ps1426175014.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/4qib61426175014.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,] 101.970 103.900 106.120 106.850 107.130 107.070 107.200 107.780 108.000 [2,] 105.870 106.045 106.605 107.230 107.905 107.985 107.905 108.425 108.840 [3,] 108.355 109.295 110.660 111.535 112.050 112.415 112.510 112.730 112.690 [4,] 111.150 111.505 111.975 112.990 114.200 114.605 114.445 114.610 116.245 [5,] 114.650 114.850 116.510 118.180 118.750 119.060 119.280 119.680 119.280 [,10] [,11] [,12] [1,] 107.610 106.540 105.300 [2,] 108.490 108.070 107.215 [3,] 112.085 110.625 108.770 [4,] 115.675 113.560 111.610 [5,] 117.300 115.160 114.450 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.4055 106.245 107.6602 108.3174 108.5335 108.717 108.8567 109.275 [2,] 111.3045 112.345 113.6598 114.7526 115.5665 116.113 116.1633 116.185 [,9] [,10] [,11] [,12] [1,] 108.5535 108.0714 107.5582 106.3149 [2,] 116.8265 116.0986 113.6918 111.2251 $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(101.97, 105.87, 108.355, 111.15, 114.65, 103.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eahu1426175014.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] [,9] [1,] 105.300 105.380 106.190 108.190 108.490 108.520 112.56 110.660 NA [2,] 106.075 106.180 107.120 109.650 110.305 111.645 114.75 112.815 NA [3,] 107.100 107.230 108.025 111.325 112.185 113.820 117.74 114.420 NA [4,] 107.520 107.945 108.865 111.815 113.050 114.805 119.17 115.380 NA [5,] 108.110 108.410 109.270 111.930 113.620 116.400 119.68 116.090 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 106.4409 106.425 107.2291 110.3375 110.933 112.3787 115.724 113.2501 NA [2,] 107.7591 108.035 108.8209 112.3125 113.437 115.2613 119.756 115.5899 NA $out [1] 101.97 103.90 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(105.3, 106.075, 107.1, 107.52, 108.11, 105.38, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q8u41426175014.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,] 3.077048 8.620 3.43250 [2,] 3.621659 10.040 4.72750 [3,] 3.978739 11.305 5.40375 [4,] 4.147280 11.945 6.18750 [5,] 4.200333 12.680 7.11250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.739000 10.43612 4.737834 [2,] 4.218478 12.17388 6.069666 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.07704751808799, 3.62165923957615, 3.97873869755295, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/108e71426175014.ps tmp/108e71426175014.png",intern=TRUE)) character(0) > try(system("convert tmp/2l2qb1426175014.ps tmp/2l2qb1426175014.png",intern=TRUE)) character(0) > try(system("convert tmp/3l8ps1426175014.ps tmp/3l8ps1426175014.png",intern=TRUE)) character(0) > try(system("convert tmp/4qib61426175014.ps tmp/4qib61426175014.png",intern=TRUE)) character(0) > try(system("convert tmp/5eahu1426175014.ps tmp/5eahu1426175014.png",intern=TRUE)) character(0) > try(system("convert tmp/6q8u41426175014.ps tmp/6q8u41426175014.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.135 0.305 2.470