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(107.2,107.56,107.72,108.14,108.16,108.16,108.16,108.1,108.95,110.49,110.72,110.82,110.82,110.75,110.71,110.86,110.84,110.84,110.84,110.92,111.46,112.46,113.04,113.15,113.15,113.21,113.37,113.47,113.71,113.71,113.71,113.8,115.46,117,117.94,118.08,118.08,118.47,118.49,118.45,118.54,118.55,118.55,118.55,119.04,121.37,122,122.14,122.14,122.03,121.91,122.23,121.73,121.83,121.83,122.49,123.02,125.98,126.13,126.39,126.39,126.57,126.87,127.26,126.82,126.7,126.7,126.7,128.53,130.37,130.39,130.65,130.65,130.65,130.85,130.89,130.85,131.6,131.6,131.6,132.53,133.05,133.49,133.46) > 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,] 107.20 110.82 113.15 118.08 122.14 126.39 130.65 NA [2,] 107.56 110.75 113.21 118.47 122.03 126.57 130.65 NA [3,] 107.72 110.71 113.37 118.49 121.91 126.87 130.85 NA [4,] 108.14 110.86 113.47 118.45 122.23 127.26 130.89 NA [5,] 108.16 110.84 113.71 118.54 121.73 126.82 130.85 NA [6,] 108.16 110.84 113.71 118.55 121.83 126.70 131.60 NA [7,] 108.16 110.84 113.71 118.55 121.83 126.70 131.60 NA [8,] 108.10 110.92 113.80 118.55 122.49 126.70 131.60 NA [9,] 108.95 111.46 115.46 119.04 123.02 128.53 132.53 NA [10,] 110.49 112.46 117.00 121.37 125.98 130.37 133.05 NA [11,] 110.72 113.04 117.94 122.00 126.13 130.39 133.49 NA [12,] 110.82 113.15 118.08 122.14 126.39 130.65 133.46 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/1ikai1386004298.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/2gvre1386004298.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/3y0mi1386004298.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/4ekk71386004298.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,] 107.200 107.56 107.72 108.140 108.160 108.160 108.160 108.100 108.950 [2,] 111.985 111.98 112.04 112.165 112.275 112.275 112.275 112.360 113.460 [3,] 118.080 118.47 118.49 118.450 118.540 118.550 118.550 118.550 119.040 [4,] 124.265 124.30 124.39 124.745 124.275 124.265 124.265 124.595 125.775 [5,] 130.650 130.65 130.85 130.890 130.850 131.600 131.600 131.600 132.530 [,10] [,11] [,12] [1,] 110.490 110.72 110.820 [2,] 114.730 115.49 115.615 [3,] 121.370 122.00 122.140 [4,] 128.175 128.26 128.520 [5,] 133.050 133.49 133.460 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.7466 111.1127 111.1148 110.9374 111.3738 111.3898 111.3898 111.2435 [2,] 125.4134 125.8273 125.8652 125.9626 125.7062 125.7102 125.7102 125.8565 [,9] [,10] [,11] [,12] [1,] 111.6857 113.3409 114.374 114.4333 [2,] 126.3943 129.3991 129.626 129.8467 $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(107.2, 111.985, 118.08, 124.265, 130.65, 107.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5urv51386004298.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,] 107.20 110.71 113.15 118.080 121.730 126.390 130.65 NA [2,] 107.91 110.83 113.42 118.480 121.870 126.700 130.85 NA [3,] 108.16 110.85 113.71 118.550 122.185 126.845 131.60 NA [4,] 109.72 111.96 116.23 120.205 124.500 129.450 132.79 NA [5,] 110.82 113.15 118.08 122.140 126.390 130.650 133.49 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.3344 110.3346 112.4283 117.7632 120.9854 125.5907 130.7152 NA [2,] 108.9856 111.3654 114.9917 119.3368 123.3846 128.0993 132.4848 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(107.2, 107.91, 108.16, 109.72, 110.82, 110.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ml9w1386004298.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,] 8.494407 22.560 11.9900 [2,] 8.524925 22.720 12.1175 [3,] 8.545946 23.110 12.3175 [4,] 8.599998 23.445 12.6750 [5,] 8.711597 23.580 13.4450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.511704 22.77932 12.06322 [2,] 8.580188 23.44068 12.57178 $out [1] 8.371835 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.49440740386621, 8.52492458101221, 8.54594582747203, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ikai1386004298.ps tmp/1ikai1386004298.png",intern=TRUE)) character(0) > try(system("convert tmp/2gvre1386004298.ps tmp/2gvre1386004298.png",intern=TRUE)) character(0) > try(system("convert tmp/3y0mi1386004298.ps tmp/3y0mi1386004298.png",intern=TRUE)) character(0) > try(system("convert tmp/4ekk71386004298.ps tmp/4ekk71386004298.png",intern=TRUE)) character(0) > try(system("convert tmp/5urv51386004298.ps tmp/5urv51386004298.png",intern=TRUE)) character(0) > try(system("convert tmp/6ml9w1386004298.ps tmp/6ml9w1386004298.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.446 1.115 5.536