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(679,687,638,628,604,713,712,693,697,555,486,470,465,426,384,379,381,380,351,346,339,336,333,324,324,321,304,343,407,389,361,353,361,387,692,704,742,721,843,847,945,946,946,945,1082,1075,820,832,851,1090,1203,1239,1535,1527,1480,1452,1383,1381,1429,1376,1602,1597,2003,1958,1997,1986,2129,2115,2297,2250,2309,2648,2627,2711,2732,2825,2932,2910,2969,2999,2965,2846,2847,2751) > 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,] 679 465 324 742 851 1602 2627 NA [2,] 687 426 321 721 1090 1597 2711 NA [3,] 638 384 304 843 1203 2003 2732 NA [4,] 628 379 343 847 1239 1958 2825 NA [5,] 604 381 407 945 1535 1997 2932 NA [6,] 713 380 389 946 1527 1986 2910 NA [7,] 712 351 361 946 1480 2129 2969 NA [8,] 693 346 353 945 1452 2115 2999 NA [9,] 697 339 361 1082 1383 2297 2965 NA [10,] 555 336 387 1075 1381 2250 2846 NA [11,] 486 333 692 820 1429 2309 2847 NA [12,] 470 324 704 832 1376 2648 2751 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/1aoqz1385569256.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/2vvfa1385569256.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/3ou4f1385569256.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/4udit1385569256.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] [1,] 324.0 321.0 304 343.0 381.0 380.0 351.0 346.0 339 336.0 333 [2,] 572.0 556.5 511 503.5 505.5 551.0 536.5 523.0 529 471.0 589 [3,] 742.0 721.0 843 847.0 945.0 946.0 946.0 945.0 1082 1075.0 820 [4,] 1226.5 1343.5 1603 1598.5 1766.0 1756.5 1804.5 1783.5 1840 1815.5 1869 [5,] 1602.0 1597.0 2732 2825.0 2932.0 2910.0 2969.0 2999.0 2965 2846.0 2847 [,12] [1,] 324 [2,] 587 [3,] 832 [4,] 2012 [5,] 2751 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 351.1432 251.0163 190.8752 193.0837 192.2497 226.0948 188.7709 [2,] 1132.8568 1190.9837 1495.1248 1500.9163 1697.7503 1665.9052 1703.2291 [,8] [,9] [,10] [,11] [,12] [1,] 192.2497 299.0919 272.0863 55.60465 -18.98701 [2,] 1697.7503 1864.9081 1877.9137 1584.39535 1682.98701 $out [1] 2627 2711 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(324, 572, 742, 1226.5, 1602, 321, 556.5, 721, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5hw0q1385569256.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,] 470.0 324.0 304.0 721 1090 1597.0 2627.0 NA [2,] 579.5 337.5 333.5 826 1221 1972.0 2741.5 NA [3,] 658.5 365.0 361.0 896 1382 2059.0 2846.5 NA [4,] 695.0 382.5 398.0 946 1466 2273.5 2948.5 NA [5,] 713.0 426.0 407.0 1082 1535 2648.0 2999.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 605.8197 344.4752 331.5811 841.2672 1270.254 1921.484 2752.086 NA [2,] 711.1803 385.5248 390.4189 950.7328 1493.746 2196.516 2940.914 NA $out [1] 465 692 704 851 $group [1] 2 3 3 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(470, 579.5, 658.5, 695, 713, 324, 337.5, 365, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/60r5q1385569256.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,] 809.5807 2303.0 1092.0 [2,] 911.1822 2427.5 1093.5 [3,] 960.2203 2512.0 1260.5 [4,] 984.2419 2584.5 1295.5 [5,] 1011.9283 2653.0 1425.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 926.8972 2440.391 1168.366 [2,] 993.5433 2583.609 1352.634 $out [1] 654.5 787.0 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(809.580726290438, 911.182187165078, 960.220257736678, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1aoqz1385569256.ps tmp/1aoqz1385569256.png",intern=TRUE)) character(0) > try(system("convert tmp/2vvfa1385569256.ps tmp/2vvfa1385569256.png",intern=TRUE)) character(0) > try(system("convert tmp/3ou4f1385569256.ps tmp/3ou4f1385569256.png",intern=TRUE)) character(0) > try(system("convert tmp/4udit1385569256.ps tmp/4udit1385569256.png",intern=TRUE)) character(0) > try(system("convert tmp/5hw0q1385569256.ps tmp/5hw0q1385569256.png",intern=TRUE)) character(0) > try(system("convert tmp/60r5q1385569256.ps tmp/60r5q1385569256.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.221 1.251 6.438