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(82303,79596,74472,73562,66618,69029,89899,93774,90305,83799,80320,82497,84420,84646,84186,83269,77793,81145,101691,107357,104253,95963,91432,94324,93855,92183,87600,83641,78195,79604,100846,105293,102518,93132,87479,85476,85460,82868,79941,76909,72613,72496,93244,99126,96748,89318,84724,83111,87497,86961,82319,79196,76898,77971,97335,106855,105401,99108,93456,92506,94602,93027,89722,87391,83030,83390,104501,110393,111017,103434,97817,96893) > 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,] 82303 84420 93855 85460 87497 94602 NA [2,] 79596 84646 92183 82868 86961 93027 NA [3,] 74472 84186 87600 79941 82319 89722 NA [4,] 73562 83269 83641 76909 79196 87391 NA [5,] 66618 77793 78195 72613 76898 83030 NA [6,] 69029 81145 79604 72496 77971 83390 NA [7,] 89899 101691 100846 93244 97335 104501 NA [8,] 93774 107357 105293 99126 106855 110393 NA [9,] 90305 104253 102518 96748 105401 111017 NA [10,] 83799 95963 93132 89318 99108 103434 NA [11,] 80320 91432 87479 84724 93456 97817 NA [12,] 82497 94324 85476 83111 92506 96893 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/11sg91416654011.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/28j5c1416654011.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/38ywc1416654011.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/4l1om1416654011.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,] 82303.0 79596.0 74472.0 73562.0 66618.0 69029.0 89899.0 93774 90305.0 [2,] 84420.0 82868.0 79941.0 76909.0 72613.0 72496.0 93244.0 99126 96748.0 [3,] 86478.5 85803.5 83252.5 81232.5 77345.5 78787.5 99090.5 106074 103385.5 [4,] 93855.0 92183.0 87600.0 83641.0 78195.0 81145.0 101691.0 107357 105401.0 [5,] 94602.0 93027.0 89722.0 87391.0 83030.0 83390.0 104501.0 110393 111017.0 [,10] [,11] [,12] [1,] 83799.0 80320.0 82497 [2,] 89318.0 84724.0 83111 [3,] 94547.5 89455.5 88991 [4,] 99108.0 93456.0 94324 [5,] 103434.0 97817.0 96893 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 80392.62 79795.02 78312.2 76890.14 73744.93 73208.62 93641.91 100764.7 [2,] 92564.38 91811.98 88192.8 85574.86 80946.07 84366.38 104539.09 111383.3 [,9] [,10] [,11] [,12] [1,] 97804.04 88232.63 83823.08 81758.25 [2,] 108966.96 100862.37 95087.92 96223.75 $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(82303, 84420, 86478.5, 93855, 94602, 79596, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sqnb1416654011.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,] 66618.0 77793.0 78195.0 72496.0 76898.0 83030.0 NA [2,] 74017.0 83727.5 84558.5 78425.0 80757.5 88556.5 NA [3,] 81311.5 88039.0 89891.5 83917.5 90001.5 95747.5 NA [4,] 86849.0 98827.0 97350.5 91281.0 98221.5 103967.5 NA [5,] 93774.0 107357.0 105293.0 99126.0 106855.0 111017.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 75458.74 81152.02 84056.98 78053.79 82036.05 88718.44 NA [2,] 87164.26 94925.98 95726.02 89781.21 97966.95 102776.56 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(66618, 74017, 81311.5, 86849, 93774, 77793, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6bemq1416654011.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,] 5051.623 12299 6067.250 [2,] 5370.509 14095 6387.375 [3,] 5569.987 14926 7068.250 [4,] 6256.064 17058 7575.250 [5,] 7239.597 20712 8050.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5166.080 13574.56 6526.452 [2,] 5973.895 16277.44 7610.048 $out [1] 4410.25 10167.25 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5051.62336943944, 5370.50929667756, 5569.98738978059, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11sg91416654011.ps tmp/11sg91416654011.png",intern=TRUE)) character(0) > try(system("convert tmp/28j5c1416654011.ps tmp/28j5c1416654011.png",intern=TRUE)) character(0) > try(system("convert tmp/38ywc1416654011.ps tmp/38ywc1416654011.png",intern=TRUE)) character(0) > try(system("convert tmp/4l1om1416654011.ps tmp/4l1om1416654011.png",intern=TRUE)) character(0) > try(system("convert tmp/5sqnb1416654011.ps tmp/5sqnb1416654011.png",intern=TRUE)) character(0) > try(system("convert tmp/6bemq1416654011.ps tmp/6bemq1416654011.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.099 0.375 2.505