R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570,596594,580523,564478,557560,575093,580112,574761,563250,551531,537034,544686,600991,604378,586111,563668,548604,551174,555654,547970,540324,530577,520579,518654,572273,581302,563280,547612,538712,540735,561649,558685,545732,536352,527676,530455,581744,598714,583775,571477,563278,564872) > 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] 72 > (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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 560576 516922 528222 580112 555654 561649 NA [2,] 548854 507561 532638 574761 547970 558685 NA [3,] 531673 492622 536322 563250 540324 545732 NA [4,] 525919 490243 536535 551531 530577 536352 NA [5,] 511038 469357 523597 537034 520579 527676 NA [6,] 498662 477580 536214 544686 518654 530455 NA [7,] 555362 528379 586570 600991 572273 581744 NA [8,] 564591 533590 596594 604378 581302 598714 NA [9,] 541657 517945 580523 586111 563280 583775 NA [10,] 527070 506174 564478 563668 547612 571477 NA [11,] 509846 501866 557560 548604 538712 563278 NA [12,] 514258 516141 575093 551174 540735 564872 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/1j57k1367230171.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/2ld0n1367230171.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/3dbmu1367230171.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/413y81367230171.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,] 516922 507561 531673 525919.0 511038 477580.0 528379.0 533590 517945.0 [2,] 528222 532638 531673 525919.0 511038 498662.0 555362.0 564591 541657.0 [3,] 558115 548412 538323 533464.5 522088 524554.5 577008.5 588948 571901.5 [4,] 561649 558685 545732 536535.0 527676 536214.0 586570.0 598714 583775.0 [5,] 580112 574761 563250 551531.0 537034 544686.0 600991.0 604378 586111.0 [,10] [,11] [,12] [1,] 506174 501866 514258.0 [2,] 527070 509846 516141.0 [3,] 555640 543658 545954.5 [4,] 564478 557560 564872.0 [5,] 571477 563278 575093.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 536553.5 531610.8 529254.5 526616.8 511356 500332.2 556878.3 566937.6 [2,] 579676.5 565213.2 547391.5 540312.2 532820 548776.8 597138.7 610958.4 [,9] [,10] [,11] [,12] [1,] 544734 531510.6 512880.9 514521.4 [2,] 599069 579769.4 574435.1 577387.6 $out [1] 492622 490243 469357 $group [1] 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(516922, 528222, 558115, 561649, 580112, 507561, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/528ax1367230171.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,] 498662.0 469357.0 523597.0 537034.0 518654.0 527676.0 NA [2,] 512648.0 491432.5 534426.0 549889.0 534644.5 541042.0 NA [3,] 529371.5 506867.5 547047.5 563459.0 544173.5 562463.5 NA [4,] 552108.0 517433.5 577808.0 583111.5 559467.0 576610.5 NA [5,] 564591.0 533590.0 596594.0 604378.0 581302.0 598714.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 511373.5 495008.3 527260.7 548306 532851.8 546240.5 NA [2,] 547369.5 518726.7 566834.3 578612 555495.2 578686.5 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(498662, 512648, 529371.5, 552108, 564591, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68kfv1367230171.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,] 20645.64 60835 9405.75 [2,] 23459.20 62301 16494.62 [3,] 25161.80 67153 27858.00 [4,] 25624.47 69397 33984.62 [5,] 27403.04 72612 39158.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 24174.21 63916.47 19880.69 [2,] 26149.39 70389.53 35835.31 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(20645.6364437299, 23459.2029523642, 25161.8001326086, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1j57k1367230171.ps tmp/1j57k1367230171.png",intern=TRUE)) character(0) > try(system("convert tmp/2ld0n1367230171.ps tmp/2ld0n1367230171.png",intern=TRUE)) character(0) > try(system("convert tmp/3dbmu1367230171.ps tmp/3dbmu1367230171.png",intern=TRUE)) character(0) > try(system("convert tmp/413y81367230171.ps tmp/413y81367230171.png",intern=TRUE)) character(0) > try(system("convert tmp/528ax1367230171.ps tmp/528ax1367230171.png",intern=TRUE)) character(0) > try(system("convert tmp/68kfv1367230171.ps tmp/68kfv1367230171.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.270 0.767 4.037