R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558,575,580,575,563,552,537,545,601,604,586,564,549,551,556,548,540,531,521,519,572,581,563,548,539,541,562,559,546,536,528,530,582,599,584,571,563,565,578,572,565,561,551,553,611,622,613,599,591,596) > 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,] 561 517 528 580 556 562 578 NA [2,] 549 508 533 575 548 559 572 NA [3,] 532 493 536 563 540 546 565 NA [4,] 526 490 537 552 531 536 561 NA [5,] 511 469 524 537 521 528 551 NA [6,] 499 478 536 545 519 530 553 NA [7,] 555 528 587 601 572 582 611 NA [8,] 565 534 597 604 581 599 622 NA [9,] 542 518 581 586 563 584 613 NA [10,] 527 506 564 564 548 571 599 NA [11,] 510 502 558 549 539 563 591 NA [12,] 514 516 575 551 541 565 596 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/1lx7z1419958344.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/2jiie1419958344.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/39cct1419958344.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/4f7h81419958344.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] [,11] [,12] [1,] 517 508.0 532.0 526.0 511.0 478.0 528.0 534.0 518.0 506.0 502.0 514.0 [2,] 542 540.5 534.0 528.5 516.0 509.0 563.5 573.0 552.5 537.5 524.5 528.5 [3,] 561 549.0 540.0 536.0 524.0 530.0 582.0 597.0 581.0 564.0 549.0 551.0 [4,] 570 565.5 554.5 544.5 532.5 540.5 594.0 601.5 585.0 567.5 560.5 570.0 [5,] 580 575.0 565.0 561.0 551.0 553.0 611.0 622.0 613.0 599.0 591.0 596.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,] 544.2789 534.0704 527.7577 526.4451 514.1465 511.1887 563.7859 579.9803 [2,] 577.7211 563.9296 552.2423 545.5549 533.8535 548.8113 600.2141 614.0197 [,9] [,10] [,11] [,12] [1,] 561.5915 546.0845 527.5014 526.2169 [2,] 600.4085 581.9155 570.4986 575.7831 $out [1] 493 490 469 $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(517, 542, 561, 570, 580, 508, 540.5, 549, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wtx71419958344.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,] 499.0 469.0 524.0 537.0 519.0 528.0 551.0 NA [2,] 512.5 491.5 534.5 550.0 535.0 541.0 563.0 NA [3,] 529.5 507.0 547.5 563.5 544.5 562.5 584.5 NA [4,] 552.0 517.5 578.0 583.0 559.5 576.5 605.0 NA [5,] 565.0 534.0 597.0 604.0 581.0 599.0 622.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 511.4838 495.1412 527.6594 548.4485 533.3254 546.3082 565.3435 NA [2,] 547.5162 518.8588 567.3406 578.5515 555.6746 578.6918 603.6565 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(499, 512.5, 529.5, 552, 565, 469, 491.5, 507, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6122u1419958344.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,] 22.62531 63.0 16.00 [2,] 23.95655 71.5 22.75 [3,] 27.34996 82.0 29.25 [4,] 30.37752 88.5 32.00 [5,] 31.51115 95.0 41.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 24.42131 74.24619 25.03101 [2,] 30.27860 89.75381 33.46899 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(22.6253124156278, 23.9565500710942, 27.3499579856879, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lx7z1419958344.ps tmp/1lx7z1419958344.png",intern=TRUE)) character(0) > try(system("convert tmp/2jiie1419958344.ps tmp/2jiie1419958344.png",intern=TRUE)) character(0) > try(system("convert tmp/39cct1419958344.ps tmp/39cct1419958344.png",intern=TRUE)) character(0) > try(system("convert tmp/4f7h81419958344.ps tmp/4f7h81419958344.png",intern=TRUE)) character(0) > try(system("convert tmp/5wtx71419958344.ps tmp/5wtx71419958344.png",intern=TRUE)) character(0) > try(system("convert tmp/6122u1419958344.ps tmp/6122u1419958344.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.562 0.506 3.095