R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" 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(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,110030,104009,99772,96301,97680,121563,134210,133111,124527,117589,115699) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 125326 116566 104782 109337 120528 109843 111203 NA [2,] 122716 111272 101281 109078 118240 106365 110030 NA [3,] 116615 104609 94545 108293 112514 102304 104009 NA [4,] 113719 101802 93248 106534 107304 97968 99772 NA [5,] 110737 94542 84031 99197 100001 92462 96301 NA [6,] 112093 93051 87486 103493 102082 92286 97680 NA [7,] 143565 124129 115867 130676 130455 120092 121563 NA [8,] 149946 130374 120327 137448 135574 126656 134210 NA [9,] 149147 123946 117008 134704 132540 124144 133111 NA [10,] 134339 114971 108811 123725 119920 114045 124527 NA [11,] 122683 105531 104519 118277 112454 108120 117589 NA [12,] 115614 104919 106758 121225 109415 105698 115699 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/1q3111386508679.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/2opmw1386508679.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/386hv1386508679.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/4mbtc1386508679.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.0 94545.0 93248 92462 87486.0 115867.0 120327 117008.0 [2,] 109590 107721.5 103156.5 98870 93502 92668.5 120827.5 128515 124045.0 [3,] 111203 110030.0 104609.0 101802 96301 97680.0 124129.0 134210 132540.0 [4,] 118547 114756.0 110403.5 106919 99599 102787.5 130565.5 136511 133907.5 [5,] 125326 122716.0 116615.0 113719 100001 112093.0 143565.0 137448 134704.0 [,10] [,11] [,12] [1,] 108811 104519.0 104919.0 [2,] 114508 106825.5 106228.0 [3,] 119920 112454.0 109415.0 [4,] 124126 117933.0 115656.5 [5,] 134339 122683.0 121225.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105854 105829.1 100281.2 96995.27 92659.97 91637.1 118313.6 129434.9 [2,] 116552 114230.9 108936.8 106608.73 99942.03 103722.9 129944.4 138985.1 [,9] [,10] [,11] [,12] [1,] 126650.3 114176.3 105820.8 103784.5 [2,] 138429.7 125663.7 119087.2 115045.5 $out [1] 110737 84031 149946 149147 $group [1] 5 5 8 9 $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/wessaorg/rcomp/tmp/56nr81386508680.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] [1,] 110737.0 93051.0 84031.0 99197.0 100001.0 92286.0 96301.0 NA [2,] 114666.5 103205.5 93896.5 107413.5 108359.5 100136.0 101890.5 NA [3,] 122699.5 108401.5 104650.5 113807.0 115377.0 107242.5 113451.0 NA [4,] 138952.0 120256.0 112339.0 127200.5 125491.5 117068.5 123045.0 NA [5,] 149946.0 130374.0 120327.0 137448.0 135574.0 126656.0 134210.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 111622.7 100624.7 96238.75 104782 107563 99519.47 103802.3 NA [2,] 133776.3 116178.3 113062.25 122832 123191 114965.53 123099.7 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" 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/wessaorg/rcomp/tmp/6e0wy1386508680.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,] 6228.196 16306.0 6097.00 [2,] 7089.843 20507.5 7621.50 [3,] 7669.298 23338.5 9192.75 [4,] 8814.779 27202.0 9800.25 [5,] 10340.680 32139.0 11107.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6882.542 20285.09 8199.007 [2,] 8456.053 26391.91 10186.493 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6228.19596290779, 7089.8426231237, 7669.29755925217, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1q3111386508679.ps tmp/1q3111386508679.png",intern=TRUE)) character(0) > try(system("convert tmp/2opmw1386508679.ps tmp/2opmw1386508679.png",intern=TRUE)) character(0) > try(system("convert tmp/386hv1386508679.ps tmp/386hv1386508679.png",intern=TRUE)) character(0) > try(system("convert tmp/4mbtc1386508679.ps tmp/4mbtc1386508679.png",intern=TRUE)) character(0) > try(system("convert tmp/56nr81386508680.ps tmp/56nr81386508680.png",intern=TRUE)) character(0) > try(system("convert tmp/6e0wy1386508680.ps tmp/6e0wy1386508680.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.798 0.980 5.751