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(18293.9,18613.4,18728.5,20091.8,18947.2,20124.9,19819.2,15908.6,19927.4,19551.9,15588.6,14206.2,13566.7,13941.5,14964.1,14086,13505.1,15300.4,14725.2,12484.9,16082.6,15915.8,15916.1,15713,14746,15253.2,18384.3,16848.5,16485.5,19257.1,17093.4,15700.1,19124.3,18640.8,18439.2,17106.3,18347.7,19372.7,22263.8,19422.9,21268.6,20310,19256,17535.9,19857.4,19628.4,19727.5,18112.2,19080.2,20684.6,22537.7,19954.6,20230.2,20445.5,19615.3,18071.6,19287.2,21031.4,19860.9,17671.3,19359.2,19287,21498,20859.7,20833.1,20318.8,21375.9,17403.4,21050.1,22010.2,20372.1,19028.4) > 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,] 18293.9 13566.7 14746.0 18347.7 19080.2 19359.2 NA [2,] 18613.4 13941.5 15253.2 19372.7 20684.6 19287.0 NA [3,] 18728.5 14964.1 18384.3 22263.8 22537.7 21498.0 NA [4,] 20091.8 14086.0 16848.5 19422.9 19954.6 20859.7 NA [5,] 18947.2 13505.1 16485.5 21268.6 20230.2 20833.1 NA [6,] 20124.9 15300.4 19257.1 20310.0 20445.5 20318.8 NA [7,] 19819.2 14725.2 17093.4 19256.0 19615.3 21375.9 NA [8,] 15908.6 12484.9 15700.1 17535.9 18071.6 17403.4 NA [9,] 19927.4 16082.6 19124.3 19857.4 19287.2 21050.1 NA [10,] 19551.9 15915.8 18640.8 19628.4 21031.4 22010.2 NA [11,] 15588.6 15916.1 18439.2 19727.5 19860.9 20372.1 NA [12,] 14206.2 15713.0 17106.3 18112.2 17671.3 19028.4 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/1o34y1416581897.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/20mxb1416581897.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/38z571416581897.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/4k0y11416581897.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] [1,] 13566.7 13941.5 14964.10 14086.00 13505.1 19257.10 14725.20 15700.1 [2,] 14746.0 15253.2 18384.30 16848.50 16485.5 19257.10 17093.40 15700.1 [3,] 18320.8 18950.2 20113.25 19688.75 19588.7 20217.45 19435.65 16656.0 [4,] 19080.2 19372.7 22263.80 20091.80 20833.1 20318.80 19819.20 17535.9 [5,] 19359.2 20684.6 22537.70 20859.70 21268.6 20445.50 21375.90 18071.6 [,9] [,10] [,11] [,12] [1,] 19124.3 15915.80 15588.60 14206.2 [2,] 19124.3 18640.80 15916.10 15713.0 [3,] 19572.3 19590.15 19083.35 17388.8 [4,] 19927.4 21031.40 19860.90 18112.2 [5,] 21050.1 22010.20 20372.10 19028.4 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15525.1 16292.99 17610.85 17596.72 16784.36 19532.62 17677.42 15471.85 [2,] 21116.5 21607.41 22615.65 21780.78 22393.04 20902.28 21193.88 17840.15 [,9] [,10] [,11] [,12] [1,] 19054.27 18048.14 16538.83 15841.24 [2,] 20090.33 21132.16 21627.87 18936.36 $out [1] 15300.4 12484.9 16082.6 $group [1] 6 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(13566.7, 14746, 18320.8, 19080.2, 19359.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tfnv1416581897.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,] 14206.20 12484.90 14746.00 17535.90 17671.30 17403.4 NA [2,] 17101.25 13754.10 16092.80 18801.85 19183.70 19323.1 NA [3,] 18837.85 14844.65 17099.85 19525.65 19907.75 20602.6 NA [4,] 19873.30 15814.40 18540.00 20083.70 20565.05 21213.0 NA [5,] 20124.90 16082.60 19257.10 21268.60 22537.70 22010.2 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 17573.5 13904.93 15983.67 18940.99 19277.71 19740.6 NA [2,] 20102.2 15784.37 18216.03 20110.31 20537.79 21464.6 NA $out [1] 22263.8 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14206.2, 17101.25, 18837.85, 19873.3, 20124.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6meh91416581897.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,] 1680.054 4783.50 744.875 [2,] 2022.766 5056.30 1781.313 [3,] 2236.163 5943.45 2349.788 [4,] 2613.011 6758.40 3272.388 [5,] 3009.890 7763.50 3602.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1966.948 5167.111 1669.698 [2,] 2505.377 6719.789 3029.877 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1680.05351819518, 2022.76624425705, 2236.16274191851, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o34y1416581897.ps tmp/1o34y1416581897.png",intern=TRUE)) character(0) > try(system("convert tmp/20mxb1416581897.ps tmp/20mxb1416581897.png",intern=TRUE)) character(0) > try(system("convert tmp/38z571416581897.ps tmp/38z571416581897.png",intern=TRUE)) character(0) > try(system("convert tmp/4k0y11416581897.ps tmp/4k0y11416581897.png",intern=TRUE)) character(0) > try(system("convert tmp/5tfnv1416581897.ps tmp/5tfnv1416581897.png",intern=TRUE)) character(0) > try(system("convert tmp/6meh91416581897.ps tmp/6meh91416581897.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.165 0.376 2.567