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(59.8,60.7,59.7,60.2,61.3,59.8,61.2,59.3,59.4,63.1,68,69.4,70.2,72.6,72.1,69.7,71.5,75.7,76,76.4,83.8,86.2,88.5,95.9,103.1,113.5,115.7,113.1,112.7,121.9,120.3,108.7,102.8,83.4,79.4,77.8,85.7,83.2,82,86.9,95.7,97.9,89.3,91.5,86.8,91,93.8,96.8,95.7,91.4,88.7,88.2,87.7,89.5,95.6,100.5,106.3,112,117.7,125,132.4,138.1,134.7,136.7,134.3,131.6,129.8,131.9,129.8,119.4,116.7,112.8,116,117.5,118.8,118.7,116.3,115.2,131.7,133.7,132.5,126.9,122.2,120.2) > 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,] 59.8 70.2 103.1 85.7 95.7 132.4 116.0 NA [2,] 60.7 72.6 113.5 83.2 91.4 138.1 117.5 NA [3,] 59.7 72.1 115.7 82.0 88.7 134.7 118.8 NA [4,] 60.2 69.7 113.1 86.9 88.2 136.7 118.7 NA [5,] 61.3 71.5 112.7 95.7 87.7 134.3 116.3 NA [6,] 59.8 75.7 121.9 97.9 89.5 131.6 115.2 NA [7,] 61.2 76.0 120.3 89.3 95.6 129.8 131.7 NA [8,] 59.3 76.4 108.7 91.5 100.5 131.9 133.7 NA [9,] 59.4 83.8 102.8 86.8 106.3 129.8 132.5 NA [10,] 63.1 86.2 83.4 91.0 112.0 119.4 126.9 NA [11,] 68.0 88.5 79.4 93.8 117.7 116.7 122.2 NA [12,] 69.4 95.9 77.8 96.8 125.0 112.8 120.2 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/1jtg61386258429.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/2lh2p1386258429.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/3ln9j1386258429.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/4ibq91386258429.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,] 59.80 60.7 59.70 60.2 61.3 59.80 61.20 59.30 59.40 63.1 68.00 [2,] 77.95 77.9 77.05 78.3 79.6 82.60 82.65 83.95 85.30 84.8 83.95 [3,] 95.70 91.4 88.70 88.2 95.7 97.90 95.60 100.50 102.80 91.0 93.80 [4,] 109.55 115.5 117.25 115.9 114.5 118.55 125.05 120.30 118.05 115.7 117.20 [5,] 132.40 138.1 134.70 136.7 134.3 131.60 131.70 133.70 132.50 126.9 122.20 [,12] [1,] 69.40 [2,] 86.85 [3,] 96.80 [4,] 116.50 [5,] 125.00 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 76.82899 68.94589 64.69321 65.74589 74.85828 76.43124 70.2794 [2,] 114.57101 113.85411 112.70679 110.65411 116.54172 119.36876 120.9206 [,8] [,9] [,10] [,11] [,12] [1,] 78.79237 83.24223 72.54702 73.94364 79.0935 [2,] 122.20763 122.35777 109.45298 113.65636 114.5065 $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(59.8, 77.95, 95.7, 109.55, 132.4, 60.7, 77.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5n17b1386258429.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,] 59.30 69.70 77.8 82.00 87.70 112.80 115.2 NA [2,] 59.75 71.80 93.1 86.25 89.10 124.60 116.9 NA [3,] 60.45 75.85 110.7 90.15 95.65 131.75 119.5 NA [4,] 62.20 85.00 114.6 94.75 109.15 134.50 129.3 NA [5,] 63.10 95.90 121.9 97.90 125.00 138.10 133.7 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 59.33254 69.82939 100.8937 86.27309 86.50506 127.2345 113.8443 NA [2,] 61.56746 81.87061 120.5063 94.02691 104.79494 136.2655 125.1557 NA $out [1] 68.0 69.4 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(59.3, 59.75, 60.45, 62.2, 63.1, 69.7, 71.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/695jx1386258429.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,] 21.02578 63.80 29.650 [2,] 24.03534 67.15 32.175 [3,] 25.98019 72.80 35.425 [4,] 27.43800 74.70 37.600 [5,] 27.63105 77.40 42.400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 24.42822 69.35639 32.95062 [2,] 27.53217 76.24361 37.89938 $out [1] 54.2 55.6 $group [1] 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(21.0257778294486, 24.0353432988988, 25.9801946778256, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jtg61386258429.ps tmp/1jtg61386258429.png",intern=TRUE)) character(0) > try(system("convert tmp/2lh2p1386258429.ps tmp/2lh2p1386258429.png",intern=TRUE)) character(0) > try(system("convert tmp/3ln9j1386258429.ps tmp/3ln9j1386258429.png",intern=TRUE)) character(0) > try(system("convert tmp/4ibq91386258429.ps tmp/4ibq91386258429.png",intern=TRUE)) character(0) > try(system("convert tmp/5n17b1386258429.ps tmp/5n17b1386258429.png",intern=TRUE)) character(0) > try(system("convert tmp/695jx1386258429.ps tmp/695jx1386258429.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.000 1.089 6.115