R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486,115867,120327,117008,108811,104519,106758,109337,109078,108293,106534,99197,103493,130676,137448,134704,123725,118277,121225,120528,118240,112514,107304,100001,102082,130455,135574,132540,119920,112454,109415,109843,106365,102304,97968,92462,92286,120092,126656,124144,114045,108120,105698,111203) > 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] 73 > (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] 7 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 125326 116566 104782 109337 120528 109843 111203 [2,] 122716 111272 101281 109078 118240 106365 NA [3,] 116615 104609 94545 108293 112514 102304 NA [4,] 113719 101802 93248 106534 107304 97968 NA [5,] 110737 94542 84031 99197 100001 92462 NA [6,] 112093 93051 87486 103493 102082 92286 NA [7,] 143565 124129 115867 130676 130455 120092 NA [8,] 149946 130374 120327 137448 135574 126656 NA [9,] 149147 123946 117008 134704 132540 124144 NA [10,] 134339 114971 108811 123725 119920 114045 NA [11,] 122683 105531 104519 118277 112454 108120 NA [12,] 115614 104919 106758 121225 109415 105698 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/1hn731357751721.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/28dzx1357751721.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/3sr8a1357751721.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/4orzt1357751721.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,] 104782 101281 94545 93248 84031.0 87486.0 115867 120327 117008 [2,] 109590 106365 102304 97968 92462.0 92286.0 120092 126656 123946 [3,] 111203 110175 106451 104168 96869.5 97566.5 127292 132974 128342 [4,] 118547 118240 112514 107304 100001.0 103493.0 130676 137448 134704 [5,] 125326 122716 116615 113719 110737.0 112093.0 143565 149946 149147 [,10] [,11] [,12] [1,] 108811.0 104519 104919.0 [2,] 114045.0 105531 105698.0 [3,] 117445.5 110287 108086.5 [4,] 123725.0 118277 115614.0 [5,] 134339.0 122683 121225.0 $n [1] 7 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105854 102515.2 99865.22 98145.98 92006.6 90337.62 120465 126012.8 [2,] 116552 117834.8 113036.78 110190.02 101732.4 104795.38 134119 139935.2 [,9] [,10] [,11] [,12] [1,] 121402.7 111201.6 102065.4 101690.4 [2,] 135281.3 123689.4 118508.6 114482.6 $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(104782, 109590, 111203, 118547, 125326, 101281, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5vioh1357751721.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,] 110737.0 93051.0 84031.0 99197.0 100001.0 92286.0 111203 [2,] 114666.5 103205.5 93896.5 107413.5 108359.5 100136.0 111203 [3,] 122699.5 108401.5 104650.5 113807.0 115377.0 107242.5 111203 [4,] 138952.0 120256.0 112339.0 127200.5 125491.5 117068.5 111203 [5,] 149946.0 130374.0 120327.0 137448.0 135574.0 126656.0 111203 $n [1] 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 111622.7 100624.7 96238.75 104782 107563 99519.47 111203 [2,] 133776.3 116178.3 113062.25 122832 123191 114965.53 111203 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(110737, 114666.5, 122699.5, 138952, 149946, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ng1e1357751721.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,] 6488.439 16306.0 6818.000 [2,] 7302.297 20507.5 8341.125 [3,] 8380.309 23338.5 9175.500 [4,] 9430.414 27202.0 9843.500 [5,] 11265.461 32139.0 10663.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7409.661 20285.09 8490.257 [2,] 9350.958 26391.91 9860.743 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6488.43948624526, 7302.29669548364, 8380.30928377437, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hn731357751721.ps tmp/1hn731357751721.png",intern=TRUE)) character(0) > try(system("convert tmp/28dzx1357751721.ps tmp/28dzx1357751721.png",intern=TRUE)) character(0) > try(system("convert tmp/3sr8a1357751721.ps tmp/3sr8a1357751721.png",intern=TRUE)) character(0) > try(system("convert tmp/4orzt1357751721.ps tmp/4orzt1357751721.png",intern=TRUE)) character(0) > try(system("convert tmp/5vioh1357751721.ps tmp/5vioh1357751721.png",intern=TRUE)) character(0) > try(system("convert tmp/6ng1e1357751721.ps tmp/6ng1e1357751721.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.068 0.843 3.905