R version 3.0.1 (2013-05-16) -- "Good Sport" 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(42364,42206,42046,41715,44991,44818,42364,40733,40891,40891,41067,41382,41873,41873,41558,40733,44991,45640,44660,42364,43346,41873,42538,42855,43186,42364,42538,41382,44991,46131,45151,43346,45309,43186,45151,44991,45482,43678,45640,45482,48426,47762,45151,43835,45640,43186,44991,45309,45973,44502,45309,45800,47604,46131,44169,42046,44011,38611,41224,42695,44169,42046,42046,42046,43186,41558,39420,37631,38929,33862,36967,38771,39102,37298,37455,36967,38611,37455,35178,33531,36315,30269,34195,35984,35984,33862,31900,31742,33531,31900,28798,26660,28956,23558,28464,31075,31900,30096,27816,29447,30096,29604,24696,22418,24047,19140,24207,26011,27482,25029,22733,24047,24696,23398,18491,16353,18316,12918,18807,22418) > 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,] 42364 41873 43186 45482 45973 44169 39102 35984 31900 27482 NA [2,] 42206 41873 42364 43678 44502 42046 37298 33862 30096 25029 NA [3,] 42046 41558 42538 45640 45309 42046 37455 31900 27816 22733 NA [4,] 41715 40733 41382 45482 45800 42046 36967 31742 29447 24047 NA [5,] 44991 44991 44991 48426 47604 43186 38611 33531 30096 24696 NA [6,] 44818 45640 46131 47762 46131 41558 37455 31900 29604 23398 NA [7,] 42364 44660 45151 45151 44169 39420 35178 28798 24696 18491 NA [8,] 40733 42364 43346 43835 42046 37631 33531 26660 22418 16353 NA [9,] 40891 43346 45309 45640 44011 38929 36315 28956 24047 18316 NA [10,] 40891 41873 43186 43186 38611 33862 30269 23558 19140 12918 NA [11,] 41067 42538 45151 44991 41224 36967 34195 28464 24207 18807 NA [12,] 41382 42855 44991 45309 42695 38771 35984 31075 26011 22418 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/fisher/rcomp/tmp/1f7sn1376761678.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/fisher/rcomp/tmp/2n5971376761678.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/fisher/rcomp/tmp/3gh791376761678.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/fisher/rcomp/tmp/4k4zx1376761678.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,] 27482.0 25029.0 22733 24047.0 24696.0 23398 18491 16353 18316 12918.0 [2,] 35984.0 33862.0 31900 31742.0 33531.0 31900 28798 26660 28956 23558.0 [3,] 42118.5 41959.5 41802 41057.5 44088.5 43188 40892 39182 39910 36236.5 [4,] 44169.0 42364.0 42538 42046.0 44991.0 46131 44660 42364 44011 41873.0 [5,] 45973.0 44502.0 45640 45800.0 48426.0 47762 45151 43835 45640 43186.0 [,11] [,12] [1,] 18807 22418.0 [2,] 28464 31075.0 [3,] 39017 40076.5 [4,] 42538 42855.0 [5,] 45151 45309.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 38028.95 37711.56 36486.83 35909.21 38362.63 36077.63 32966.71 31335.66 [2,] 46208.05 46207.44 47117.17 46205.79 49814.37 50298.37 48817.29 47028.34 [,9] [,10] [,11] [,12] [1,] 32387.92 27085.6 31985.07 34190.74 [2,] 47432.08 45387.4 46048.93 45962.26 $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(27482, 35984, 42118.5, 44169, 45973, 25029, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5thc61376761678.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] [1,] 40733.0 40733 41382.0 43186.0 38611.0 33862 33531.0 23558.0 19140.0 [2,] 40979.0 41873 42862.0 44413.0 42370.5 38201 34686.5 28631.0 24127.0 [3,] 41880.5 42451 44168.5 45395.5 44335.5 40489 36641.0 31408.5 26913.5 [4,] 42364.0 44003 45151.0 45640.0 45886.5 42046 37455.0 32715.5 29850.0 [5,] 42364.0 45640 46131.0 45640.0 47604.0 44169 39102.0 35984.0 31900.0 [,10] [,11] [1,] 12918.0 NA [2,] 18403.5 NA [3,] 22575.5 NA [4,] 24371.5 NA [5,] 27482.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 41248.79 41479.49 43124.47 44835.86 42731.83 38735.27 35378.27 29545.53 [2,] 42512.21 43422.51 45212.53 45955.14 45939.17 42242.73 37903.73 33271.47 [,9] [,10] [,11] [1,] 24303.2 19853.46 NA [2,] 29523.8 25297.54 NA $out [1] 44991 44818 48426 47762 30269 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(40733, 40979, 41880.5, 42364, 42364, 40733, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6me3y1376761678.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,] 6155.253 18491 7159.750 [2,] 7544.073 22322 9020.625 [3,] 8287.168 24047 11412.750 [4,] 9643.602 26992 13477.875 [5,] 10914.321 30268 16391.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7329.559 21916.98 9379.768 [2,] 9244.777 26177.02 13445.732 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6155.25337054094, 7544.07339822235, 8287.16769542414, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1f7sn1376761678.ps tmp/1f7sn1376761678.png",intern=TRUE)) character(0) > try(system("convert tmp/2n5971376761678.ps tmp/2n5971376761678.png",intern=TRUE)) character(0) > try(system("convert tmp/3gh791376761678.ps tmp/3gh791376761678.png",intern=TRUE)) character(0) > try(system("convert tmp/4k4zx1376761678.ps tmp/4k4zx1376761678.png",intern=TRUE)) character(0) > try(system("convert tmp/5thc61376761678.ps tmp/5thc61376761678.png",intern=TRUE)) character(0) > try(system("convert tmp/6me3y1376761678.ps tmp/6me3y1376761678.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.074 0.661 3.711