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(93.61,93.17,91.60,90.30,90.88,91.06,92.05,95.29,96.44,96.49,96.52,96.09,99.16,98.09,99.41,99.87,100.06,99.65,99.92,98.44,102.64,112.33,115.63,118.29,121.43,129.96,147.73,154.10,150.09,144.14,141.54,136.68,129.32,118.99,109.61,106.22,104.97,102.45,101.91,101.77,102.67,103.45,101.41,102.45,102.17,101.40,101.68,100.61,97.93,98.30,99.79,101.62,101.55,102.43,102.09,102.01,102.26,101.24,100.91,100.67,100.33,99.99,99.23,98.17,97.38,96.70,98.65,100.68,101.07,101.12,101.13,99.88,99.20,99.91,103.62,108.05,113.96,117.39,126.04,139.67,145.04,142.37,137.72,132.46) > 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,] 93.61 99.16 121.43 104.97 97.93 100.33 99.20 NA [2,] 93.17 98.09 129.96 102.45 98.30 99.99 99.91 NA [3,] 91.60 99.41 147.73 101.91 99.79 99.23 103.62 NA [4,] 90.30 99.87 154.10 101.77 101.62 98.17 108.05 NA [5,] 90.88 100.06 150.09 102.67 101.55 97.38 113.96 NA [6,] 91.06 99.65 144.14 103.45 102.43 96.70 117.39 NA [7,] 92.05 99.92 141.54 101.41 102.09 98.65 126.04 NA [8,] 95.29 98.44 136.68 102.45 102.01 100.68 139.67 NA [9,] 96.44 102.64 129.32 102.17 102.26 101.07 145.04 NA [10,] 96.49 112.33 118.99 101.40 101.24 101.12 142.37 NA [11,] 96.52 115.63 109.61 101.68 100.91 101.13 137.72 NA [12,] 96.09 118.29 106.22 100.61 100.67 99.88 132.46 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/13yhw1389556659.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/2u27y1389556659.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/3m8w61389556659.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/49hxy1389556659.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,] 93.610 98.090 99.230 90.30 90.880 91.060 92.050 95.290 96.44 [2,] 98.545 98.195 99.320 99.02 98.720 98.175 99.285 99.560 101.62 [3,] 99.200 99.910 99.790 101.62 101.550 102.430 101.410 102.010 102.26 [4,] 102.650 101.220 102.765 104.91 108.315 110.420 114.065 119.565 115.98 [5,] 104.970 102.450 103.620 108.05 113.960 117.390 126.040 139.670 129.32 [,10] [,11] [,12] [1,] 96.49 96.52 96.090 [2,] 101.18 101.02 100.245 [3,] 101.40 101.68 100.670 [4,] 115.66 112.62 112.255 [5,] 118.99 115.63 118.290 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.74856 98.10352 97.7327 98.10259 95.82002 95.11748 92.58362 [2,] 101.65144 101.71648 101.8473 105.13741 107.27998 109.74252 110.23638 [,8] [,9] [,10] [,11] [,12] [1,] 90.06334 93.68444 92.75278 94.75267 93.49782 [2,] 113.95666 110.83556 110.04722 108.60733 107.84218 $out [1] 121.43 93.17 129.96 91.60 147.73 154.10 150.09 144.14 141.54 145.04 [11] 142.37 137.72 132.46 $group [1] 1 2 2 3 3 4 5 6 7 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.61, 98.545, 99.2, 102.65, 104.97, 98.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bq1c1389556659.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,] 90.300 98.090 106.220 100.610 97.930 96.700 99.200 NA [2,] 91.330 99.285 120.210 101.545 100.230 98.410 105.835 NA [3,] 93.390 99.895 133.320 102.040 101.395 99.935 121.715 NA [4,] 96.265 107.485 145.935 102.560 102.050 100.875 138.695 NA [5,] 96.520 118.290 154.100 103.450 102.430 101.130 145.040 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.13911 96.15492 121.5867 101.5771 100.5649 98.8107 106.7273 NA [2,] 95.64089 103.63508 145.0533 102.5029 102.2251 101.0593 136.7027 NA $out [1] 104.97 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(90.3, 91.33, 93.39, 96.265, 96.52, 98.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6yhm41389556659.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,] 9.046262 27.820 3.0250 [2,] 13.617199 38.995 4.9975 [3,] 17.938264 47.240 11.8050 [4,] 18.807274 54.605 14.4200 [5,] 21.134898 63.800 20.0050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 15.57104 40.12017 7.507334 [2,] 20.30549 54.35983 16.102666 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(9.04626231682245, 13.6171994484953, 17.9382635479192, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13yhw1389556659.ps tmp/13yhw1389556659.png",intern=TRUE)) character(0) > try(system("convert tmp/2u27y1389556659.ps tmp/2u27y1389556659.png",intern=TRUE)) character(0) > try(system("convert tmp/3m8w61389556659.ps tmp/3m8w61389556659.png",intern=TRUE)) character(0) > try(system("convert tmp/49hxy1389556659.ps tmp/49hxy1389556659.png",intern=TRUE)) character(0) > try(system("convert tmp/5bq1c1389556659.ps tmp/5bq1c1389556659.png",intern=TRUE)) character(0) > try(system("convert tmp/6yhm41389556659.ps tmp/6yhm41389556659.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.084 1.270 7.339