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(41086,39690,43129,37863,35953,29133,24693,22205,21725,27192,21790,13253,37702,30364,32609,30212,29965,28352,25814,22414,20506,28806,22228,13971,36845,35338,35022,34777,26887,23970,22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698) > 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,] 41086 37702 36845 31514 28029 29743 NA [2,] 39690 30364 35338 27071 29383 25591 NA [3,] 43129 32609 35022 29462 36438 29096 NA [4,] 37863 30212 34777 26105 32034 26482 NA [5,] 35953 29965 26887 22397 22679 22405 NA [6,] 29133 28352 23970 23843 24319 27044 NA [7,] 24693 25814 22780 21705 18004 17970 NA [8,] 22205 22414 17351 18089 17537 18730 NA [9,] 21725 20506 21382 20764 20366 19684 NA [10,] 27192 28806 24561 25316 22782 19785 NA [11,] 21790 22228 17409 17704 19169 18479 NA [12,] 13253 13971 11514 15548 13807 10698 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/1mafu1387735838.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/2256a1387735838.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/3g2sn1387735838.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/47kkk1387735838.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] [1,] 28029.0 25591.0 29096.0 26105 22397 23843.0 17970.0 17351.0 19684 19785.0 [2,] 29743.0 27071.0 29462.0 26482 22405 23970.0 18004.0 17537.0 20366 22782.0 [3,] 34179.5 29873.5 33815.5 31123 24783 25681.5 22242.5 18409.5 20635 24938.5 [4,] 37702.0 35338.0 36438.0 34777 29965 28352.0 24693.0 22205.0 21382 27192.0 [5,] 41086.0 39690.0 43129.0 37863 35953 29133.0 25814.0 22414.0 21725 28806.0 [,11] [,12] [1,] 17409 10698 [2,] 17704 11514 [3,] 18824 13530 [4,] 21790 13971 [5,] 22228 15548 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 29045.69 24541.02 29315.75 25772.46 19906.56 22854.97 17927.88 15398.49 [2,] 39313.31 35205.98 38315.25 36473.54 29659.44 28508.03 26557.12 21420.51 [,9] [,10] [,11] [,12] [1,] 19979.65 22093.91 16188.4 11945.16 [2,] 21290.35 27783.09 21459.6 15114.84 $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(28029, 29743, 34179.5, 37702, 41086, 25591, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/563841387735838.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,] 13253.0 13971 11514.0 15548.0 13807.0 10698.0 NA [2,] 21997.5 22321 19395.5 19426.5 18586.5 18604.5 NA [3,] 28162.5 28579 24265.5 23120.0 22730.5 21095.0 NA [4,] 38776.5 30288 34899.5 26588.0 28706.0 26763.0 NA [5,] 43129.0 37702 36845.0 31514.0 36438.0 29743.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 20509.49 24945.2 17194.02 19853.59 18114.93 17373.85 NA [2,] 35815.51 32212.8 31336.98 26386.41 27346.07 24816.15 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(13253, 21997.5, 28162.5, 38776.5, 43129, 13971, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6cq071387735838.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,] 733.8535 2041.0 826.500 [2,] 2192.4074 4956.5 3366.625 [3,] 3252.6081 8432.5 4626.625 [4,] 5178.7615 13306.5 6561.125 [5,] 5467.0512 14099.0 7302.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1890.512 4624.009 3169.592 [2,] 4614.704 12240.991 6083.658 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(733.85350490862, 2192.40738810319, 3252.60809016751, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mafu1387735838.ps tmp/1mafu1387735838.png",intern=TRUE)) character(0) > try(system("convert tmp/2256a1387735838.ps tmp/2256a1387735838.png",intern=TRUE)) character(0) > try(system("convert tmp/3g2sn1387735838.ps tmp/3g2sn1387735838.png",intern=TRUE)) character(0) > try(system("convert tmp/47kkk1387735838.ps tmp/47kkk1387735838.png",intern=TRUE)) character(0) > try(system("convert tmp/563841387735838.ps tmp/563841387735838.png",intern=TRUE)) character(0) > try(system("convert tmp/6cq071387735838.ps tmp/6cq071387735838.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.324 2.029 10.326