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(12849,11380,12079,11366,11328,10444,10854,10434,10137,10992,10906,12367,14371,11695,11546,10922,10670,10254,10573,10239,10253,11176,10719,11817,12487,11519,12025,10976,11276,10657,11141,10423,10640,11426,10948,12540,12200,10644,12044,11338,11292,10612,10995,10686,10635,11285,11475,12535,12490,12511,12799,11876,11602,11062,11055,10855,10704,11510,11663,12686,13516,12539,13811,12354,11441,10814,11261,10788,10326,11490,11029,11876) > 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,] 12849 14371 12487 12200 12490 13516 NA [2,] 11380 11695 11519 10644 12511 12539 NA [3,] 12079 11546 12025 12044 12799 13811 NA [4,] 11366 10922 10976 11338 11876 12354 NA [5,] 11328 10670 11276 11292 11602 11441 NA [6,] 10444 10254 10657 10612 11062 10814 NA [7,] 10854 10573 11141 10995 11055 11261 NA [8,] 10434 10239 10423 10686 10855 10788 NA [9,] 10137 10253 10640 10635 10704 10326 NA [10,] 10992 11176 11426 11285 11510 11490 NA [11,] 10906 10719 10948 11475 11663 11029 NA [12,] 12367 11817 12540 12535 12686 11876 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/1jj751416345067.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/2z6n41416345067.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/36uib1416345067.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/4d7q71416345067.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] [1,] 12200.0 10644 11546.0 10922 11276 10254.0 10573 10239 10137.0 10992.0 [2,] 12487.0 11380 12025.0 10976 11276 10444.0 10854 10423 10253.0 11176.0 [3,] 12669.5 11607 12061.5 11352 11310 10634.5 11025 10560 10480.5 11355.5 [4,] 13516.0 12511 12799.0 11876 11441 10814.0 11141 10788 10640.0 11490.0 [5,] 14371.0 12539 13811.0 12354 11602 11062.0 11261 10855 10704.0 11510.0 [,11] [,12] [1,] 10719.0 11817 [2,] 10906.0 11876 [3,] 10988.5 12451 [4,] 11475.0 12540 [5,] 11663.0 12686 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12005.76 10877.47 11562.25 10771.47 11203.57 10395.84 10839.88 10324.56 [2,] 13333.24 12336.53 12560.75 11932.53 11416.43 10873.16 11210.12 10795.44 [,9] [,10] [,11] [,12] [1,] 10230.87 11152.96 10621.48 12022.7 [2,] 10730.13 11558.04 11355.52 12879.3 $out [1] 10670 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(12200, 12487, 12669.5, 13516, 14371, 10644, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5e9cx1416345067.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,] 10137.0 10239.0 10423.0 10612.0 10704.0 10326.0 NA [2,] 10649.0 10413.5 10802.5 10665.0 11058.5 10921.5 NA [3,] 11160.0 10820.5 11208.5 11288.5 11632.5 11465.5 NA [4,] 11729.5 11620.5 11772.0 11759.5 12500.5 12446.5 NA [5,] 12849.0 11817.0 12540.0 12535.0 12799.0 13811.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 10667.18 10269.98 10766.3 10789.29 10974.79 10769.94 NA [2,] 11652.82 11371.02 11650.7 11787.71 12290.21 12161.06 NA $out [1] 14371 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(10137, 10649, 11160, 11729.5, 12849, 10239, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66kqs1416345067.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,] 202.7318 518.0 132.750 [2,] 241.6865 652.0 279.750 [3,] 341.0221 900.5 407.250 [4,] 636.8709 1663.5 635.625 [5,] 816.1747 2265.0 892.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 160.7758 439.1481 244.933 [2,] 521.2684 1361.8519 569.567 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(202.731760379736, 241.686491465523, 341.02209235851, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jj751416345067.ps tmp/1jj751416345067.png",intern=TRUE)) character(0) > try(system("convert tmp/2z6n41416345067.ps tmp/2z6n41416345067.png",intern=TRUE)) character(0) > try(system("convert tmp/36uib1416345067.ps tmp/36uib1416345067.png",intern=TRUE)) character(0) > try(system("convert tmp/4d7q71416345067.ps tmp/4d7q71416345067.png",intern=TRUE)) character(0) > try(system("convert tmp/5e9cx1416345067.ps tmp/5e9cx1416345067.png",intern=TRUE)) character(0) > try(system("convert tmp/66kqs1416345067.ps tmp/66kqs1416345067.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.162 0.389 2.574