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(58896,57616,56232,53708,79784,78524,58896,45848,47112,47112,48372,51040,54968,53708,45848,47112,83716,91572,70664,58896,61548,62828,69404,75856,77260,64088,65476,48372,96888,111200,78524,68016,74596,82452,94220,108656,108656,99412,95484,71928,111200,129564,113848,96888,99412,108656,121704,137420,126896,120444,120444,99412,129564,149188,133492,116516,121704,142612,151856,164888,154380,137420,133492,102080,122968,145260,120444,106008,120444,134756,142612,163624,153120,126896,129564,104744,125636,144000,122968,108656,121704,137420,134756,166168,160976,140068,141332,113848,130824,157048,137420,125636,145260,157048,147928,189724,179340,155784,149188,119056,136140,151856,132212,132212,154380,166168,159696,205420,193652,171484,162240,129564,141332,162240,146524,142612,160976,176672,159696,200228) > 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,] 58896 54968 77260 108656 126896 154380 153120 160976 179340 193652 NA [2,] 57616 53708 64088 99412 120444 137420 126896 140068 155784 171484 NA [3,] 56232 45848 65476 95484 120444 133492 129564 141332 149188 162240 NA [4,] 53708 47112 48372 71928 99412 102080 104744 113848 119056 129564 NA [5,] 79784 83716 96888 111200 129564 122968 125636 130824 136140 141332 NA [6,] 78524 91572 111200 129564 149188 145260 144000 157048 151856 162240 NA [7,] 58896 70664 78524 113848 133492 120444 122968 137420 132212 146524 NA [8,] 45848 58896 68016 96888 116516 106008 108656 125636 132212 142612 NA [9,] 47112 61548 74596 99412 121704 120444 121704 145260 154380 160976 NA [10,] 47112 62828 82452 108656 142612 134756 137420 157048 166168 176672 NA [11,] 48372 69404 94220 121704 151856 142612 134756 147928 159696 159696 NA [12,] 51040 75856 108656 137420 164888 163624 166168 189724 205420 200228 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/1ezmx1377051784.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/2g0du1377051784.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/3gt9o1377051784.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/4spbx1377051784.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,] 54968 53708 45848 47112 79784 78524 58896 45848 47112 47112 [2,] 77260 64088 65476 53708 96888 111200 78524 68016 74596 82452 [3,] 140008 123670 125004 100746 124302 144630 121706 107332 121074 136088 [4,] 160976 140068 141332 113848 130824 151856 133492 125636 145260 157048 [5,] 193652 171484 162240 129564 141332 162240 146524 142612 160976 176672 [,11] [,12] [1,] 48372 51040 [2,] 94220 108656 [3,] 138684 164256 [4,] 151856 189724 [5,] 159696 205420 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98180.15 85707.36 87103.32 70697.66 107346.2 124316.6 94241.8 [2,] 181835.85 161632.64 162904.68 130794.34 141257.8 164943.4 149170.2 [,8] [,9] [,10] [,11] [,12] [1,] 78542.75 85767.45 98816.86 109886.8 123751.2 [2,] 136121.25 156380.55 173359.14 167481.2 204760.8 $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(54968, 77260, 140008, 160976, 193652, 53708, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z3zy1377051784.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] [,11] [1,] 45848 45848 48372 71928 99412 102080 104744 113848 119056 129564 NA [2,] 47742 54338 66746 98150 120444 120444 122336 134122 134176 144568 NA [3,] 54970 62188 77892 108656 128230 134124 128230 143296 153118 161608 NA [4,] 58896 73260 95554 117776 145900 143936 140710 157048 162932 174078 NA [5,] 58896 91572 111200 137420 164888 163624 166168 189724 205420 200228 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 49882.59 53557.55 64752.48 99704.45 116619.3 123409.1 119849.5 132839.3 [2,] 60057.41 70818.45 91031.52 117607.55 139840.7 144838.9 136610.5 153752.7 [,9] [,10] [,11] [1,] 140002.2 148148.3 NA [2,] 166233.8 175067.7 NA $out [1] 79784 78524 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(45848, 47742, 54970, 58896, 58896, 45848, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xwbp1377051784.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,] 21945.01 61548 30043.0 [2,] 30899.54 85672 46969.5 [3,] 39298.90 112594 55940.0 [4,] 43336.71 123668 66440.5 [5,] 52559.14 154380 74218.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 33626.23 95263.77 47059.15 [2,] 44971.58 129924.23 64820.85 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(21945.0141176127, 30899.5357899186, 39298.904945617, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ezmx1377051784.ps tmp/1ezmx1377051784.png",intern=TRUE)) character(0) > try(system("convert tmp/2g0du1377051784.ps tmp/2g0du1377051784.png",intern=TRUE)) character(0) > try(system("convert tmp/3gt9o1377051784.ps tmp/3gt9o1377051784.png",intern=TRUE)) character(0) > try(system("convert tmp/4spbx1377051784.ps tmp/4spbx1377051784.png",intern=TRUE)) character(0) > try(system("convert tmp/5z3zy1377051784.ps tmp/5z3zy1377051784.png",intern=TRUE)) character(0) > try(system("convert tmp/6xwbp1377051784.ps tmp/6xwbp1377051784.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.627 0.818 4.424