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(12374.6,12864.7,14905.8,12259.7,14088.9,14243.7,12732.8,11612,14176.6,14452.6,14512.7,12645.1,13820.5,13644.7,15684.1,13568.3,14531.1,15320.1,14344.2,12899.4,14462,16044.7,14731.2,12798.3,14213.1,14683.3,14652,15623.1,14880.4,15765.7,15433.1,12402.6,15639.8,14861.7,11699.4,10651.9,10086.9,10676.9,11332.1,10756.1,10450.5,11930.2,11419.9,9713.1,12608.5,12357.2,12107.9,11627.2,11105.9,11841.6,14290.8,13271.7,12909.4,14924.1,13257.4,12184.4,15035.5,14401,14165,13375.6,14210.8,15017.5,17157.8,15106.2,16696.1,16035.9,15418.9,13763.9,15595.2,15183.1,15515.9,14142.8,15012.7,16293.2,17771.4,15582.8,16049.9,16105.8,15623.6,14254.9,15266.8,16671,15665.4,13949.5,15146.9,15172.9,16981.4,16553.8,16438.5,15895.1,16989,13803.5,16678.3,17315.1,15895.4,14912.1) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 12374.6 13820.5 14213.1 10086.9 11105.9 14210.8 15012.7 15146.9 NA [2,] 12864.7 13644.7 14683.3 10676.9 11841.6 15017.5 16293.2 15172.9 NA [3,] 14905.8 15684.1 14652.0 11332.1 14290.8 17157.8 17771.4 16981.4 NA [4,] 12259.7 13568.3 15623.1 10756.1 13271.7 15106.2 15582.8 16553.8 NA [5,] 14088.9 14531.1 14880.4 10450.5 12909.4 16696.1 16049.9 16438.5 NA [6,] 14243.7 15320.1 15765.7 11930.2 14924.1 16035.9 16105.8 15895.1 NA [7,] 12732.8 14344.2 15433.1 11419.9 13257.4 15418.9 15623.6 16989.0 NA [8,] 11612.0 12899.4 12402.6 9713.1 12184.4 13763.9 14254.9 13803.5 NA [9,] 14176.6 14462.0 15639.8 12608.5 15035.5 15595.2 15266.8 16678.3 NA [10,] 14452.6 16044.7 14861.7 12357.2 14401.0 15183.1 16671.0 17315.1 NA [11,] 14512.7 14731.2 11699.4 12107.9 14165.0 15515.9 15665.4 15895.4 NA [12,] 12645.1 12798.3 10651.9 11627.2 13375.6 14142.8 13949.5 14912.1 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/1rkdz1426197515.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/2lwuj1426197515.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/31m2r1426197515.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/4vv2c1426197515.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,] 10086.90 10676.90 11332.10 10756.10 10450.50 14243.7 11419.90 9713.1 [2,] 11740.25 12353.15 14471.40 12765.70 13499.15 14583.9 12995.10 11898.2 [3,] 14015.65 14164.00 15294.95 14337.25 14705.75 15542.9 14881.55 12651.0 [4,] 14612.90 15095.20 17069.60 15602.95 16244.20 15965.5 15528.35 13783.7 [5,] 15146.90 16293.20 17771.40 16553.80 16696.10 16105.8 16989.00 14254.9 [,9] [,10] [,11] [,12] [1,] 12608.50 12357.20 11699.40 10651.90 [2,] 14319.30 14426.80 13136.45 12136.15 [3,] 15151.15 15022.40 14621.95 13086.95 [4,] 15617.50 16357.85 15590.65 14046.15 [5,] 16678.30 17315.10 15895.40 14912.10 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12410.95 12632.25 13843.56 12752.32 13172.33 14771.12 13466.44 11597.73 [2,] 15620.35 15695.75 16746.34 15922.18 16239.17 16314.68 16296.66 13704.27 [,9] [,10] [,11] [,12] [1,] 14425.96 13943.69 13251.0 12020.0 [2,] 15876.34 16101.11 15992.9 14153.9 $out [1] 11930.2 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(10086.9, 11740.25, 14015.65, 14612.9, 15146.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mxhs1426197515.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,] 11612.00 12798.30 10651.90 9713.10 11105.90 13763.90 13949.50 13803.50 [2,] 12509.85 13606.50 13307.85 10563.70 12546.90 14614.15 15139.75 15159.90 [3,] 13476.80 14403.10 14772.50 11376.00 13323.65 15301.00 15644.50 16166.95 [4,] 14348.15 15025.65 15528.10 12019.05 14345.90 15815.55 16199.50 16829.85 [5,] 14905.80 16044.70 15765.70 12608.50 15035.50 17157.80 17771.40 17315.10 [,9] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12638.34 13755.82 13759.83 10712.21 12503.11 14753.03 15161.14 15405.27 [2,] 14315.26 15050.38 15785.17 12039.79 14144.19 15848.97 16127.86 16928.63 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(11612, 12509.85, 13476.8, 14348.15, 14905.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xfhy1426197515.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,] 1213.222 4069.80 1176.300 [2,] 1437.134 4228.10 1669.850 [3,] 1706.897 5008.95 2127.787 [4,] 1925.588 5707.00 2401.500 [5,] 2077.970 6439.30 2574.175 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1484.110 4334.414 1794.077 [2,] 1929.684 5683.486 2461.498 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1213.22226551268, 1437.13430031482, 1706.89714973208, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rkdz1426197515.ps tmp/1rkdz1426197515.png",intern=TRUE)) character(0) > try(system("convert tmp/2lwuj1426197515.ps tmp/2lwuj1426197515.png",intern=TRUE)) character(0) > try(system("convert tmp/31m2r1426197515.ps tmp/31m2r1426197515.png",intern=TRUE)) character(0) > try(system("convert tmp/4vv2c1426197515.ps tmp/4vv2c1426197515.png",intern=TRUE)) character(0) > try(system("convert tmp/5mxhs1426197515.ps tmp/5mxhs1426197515.png",intern=TRUE)) character(0) > try(system("convert tmp/6xfhy1426197515.ps tmp/6xfhy1426197515.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.135 0.419 2.565