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(95870,95523,95208,94541,101097,100781,95870,92581,92928,92928,93244,93910,93559,96190,97172,96190,99799,97488,92261,90964,90964,91599,89004,90964,89319,90964,93559,94541,96852,95870,89981,87670,86692,87670,86057,86692,84728,88021,89635,89981,96190,96190,88021,86057,86057,87039,82764,80799,78524,79186,82133,79821,86057,87039,80799,78524,77221,78524,74910,73613,68390,69688,70004,70355,76559,75893,68390,65097,63799,65444,59208,54964,47115,47777,47777,47115,52684,53004,46448,45151,42524,46133,39577,35653,28146,29764,27800,28462,33373,34355,31093,30742,30742,35017,27484,22573,14058,20929,19946,20293,28146,27164,23555,25204,25204,31093,24222,20293,14058,22258,21595,21911,28782,28146,25835,26186,27800,31409,25835,21275) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 95870 93559 89319 84728 78524 68390 47115 28146 14058 14058 NA [2,] 95523 96190 90964 88021 79186 69688 47777 29764 20929 22258 NA [3,] 95208 97172 93559 89635 82133 70004 47777 27800 19946 21595 NA [4,] 94541 96190 94541 89981 79821 70355 47115 28462 20293 21911 NA [5,] 101097 99799 96852 96190 86057 76559 52684 33373 28146 28782 NA [6,] 100781 97488 95870 96190 87039 75893 53004 34355 27164 28146 NA [7,] 95870 92261 89981 88021 80799 68390 46448 31093 23555 25835 NA [8,] 92581 90964 87670 86057 78524 65097 45151 30742 25204 26186 NA [9,] 92928 90964 86692 86057 77221 63799 42524 30742 25204 27800 NA [10,] 92928 91599 87670 87039 78524 65444 46133 35017 31093 31409 NA [11,] 93244 89004 86057 82764 74910 59208 39577 27484 24222 25835 NA [12,] 93910 90964 86692 80799 73613 54964 35653 22573 20293 21275 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/1pui01408342664.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/2258f1408342664.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/33dmw1408342664.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/4sdhh1408342664.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,] 14058 20929 19946.0 20293 28146 27164 23555.0 25204.0 25204 31093 24222 [2,] 28146 29764 27800.0 28462 33373 34355 31093.0 30742.0 30742 35017 27484 [3,] 73457 74437 76068.5 75088 81308 81466 74594.5 71810.5 70510 71984 67059 [4,] 89319 90964 93559.0 94541 96852 96190 89981.0 87670.0 86692 87670 86057 [5,] 95870 96190 97172.0 96190 101097 100781 95870.0 92581.0 92928 92928 93244 [,12] [1,] 20293.0 [2,] 22573.0 [3,] 64288.5 [4,] 86692.0 [5,] 93910.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 42892.53 43859.04 43212.68 42072.3 49591.36 50570.77 45171.71 [2,] 104021.47 105014.96 108924.32 108103.7 113024.64 112361.23 104017.29 [,8] [,9] [,10] [,11] [,12] [1,] 43367 42555.15 45676.46 37793.59 32252.09 [2,] 100254 98464.85 98291.54 96324.41 96324.91 $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(14058, 28146, 73457, 89319, 95870, 20929, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5itg71408342664.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] [,9] [,10] [1,] 92581.0 89004 86057 80799.0 73613.0 59208.0 39577.0 22573 14058.0 14058 [2,] 93086.0 90964 87181 85392.5 77872.5 64448.0 43837.5 27973 20293.0 21753 [3,] 94874.5 92910 89650 87530.0 78855.0 68390.0 46781.5 30253 23888.5 25835 [4,] 95870.0 96681 94050 89808.0 81466.0 70179.5 47777.0 32233 26184.0 27973 [5,] 95870.0 99799 96852 96190.0 86057.0 76559.0 53004.0 35017 31093.0 31409 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 93604.7 90302.44 86517 85516.06 77215.98 65775.82 44984.67 28309.99 [2,] 96144.3 95517.56 92783 89543.94 80494.02 71004.18 48578.33 32196.01 [,9] [,10] [,11] [1,] 21201.58 22998.02 NA [2,] 26575.42 28671.98 NA $out [1] 101097 100781 87039 54964 35653 $group [1] 1 1 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(92581, 93086, 94874.5, 95870, 95870, 89004, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6saps1408342664.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,] 26251.39 61835 49716.25 [2,] 28355.65 68373 53740.88 [3,] 30754.26 73284 55622.00 [4,] 31400.91 75579 58930.75 [5,] 32796.60 81812 60275.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 29365.30 69997.3 53254.86 [2,] 32143.22 76570.7 57989.14 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(26251.3863176785, 28355.6530354913, 30754.2588102801, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pui01408342664.ps tmp/1pui01408342664.png",intern=TRUE)) character(0) > try(system("convert tmp/2258f1408342664.ps tmp/2258f1408342664.png",intern=TRUE)) character(0) > try(system("convert tmp/33dmw1408342664.ps tmp/33dmw1408342664.png",intern=TRUE)) character(0) > try(system("convert tmp/4sdhh1408342664.ps tmp/4sdhh1408342664.png",intern=TRUE)) character(0) > try(system("convert tmp/5itg71408342664.ps tmp/5itg71408342664.png",intern=TRUE)) character(0) > try(system("convert tmp/6saps1408342664.ps tmp/6saps1408342664.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.212 0.472 2.694