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(473,475,552,530,525,548,487,483,550,528,560,546,521,507,596,520,590,568,503,515,529,573,590,529,524,516,598,532,582,573,535,538,554,590,607,529,563,562,593,588,576,558,543,494,585,586,553,541,506,500,570,541,544,545,552,460,526,569,549,525,473,498,582,573,528,571,518,483,551,562,580,515,492,509,601,579,561,537,513,499,563,561,546,558,507,517,544,529,557,532,512,488,518,567,537,484,487,484,534,514,523,489,495,468,513,544,520,509) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 473 521 524 563 506 473 492 507 487 NA [2,] 475 507 516 562 500 498 509 517 484 NA [3,] 552 596 598 593 570 582 601 544 534 NA [4,] 530 520 532 588 541 573 579 529 514 NA [5,] 525 590 582 576 544 528 561 557 523 NA [6,] 548 568 573 558 545 571 537 532 489 NA [7,] 487 503 535 543 552 518 513 512 495 NA [8,] 483 515 538 494 460 483 499 488 468 NA [9,] 550 529 554 585 526 551 563 518 513 NA [10,] 528 573 590 586 569 562 561 567 544 NA [11,] 560 590 607 553 549 580 546 537 520 NA [12,] 546 529 529 541 525 515 558 484 509 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/1xuay1425913283.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/20al41425913283.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/3p1dh1425913283.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/4uiqd1425913283.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,] 473 475 534 514 523 532 487 460 513 544 520 484 [2,] 487 498 552 529 528 537 503 483 526 561 546 515 [3,] 506 507 582 532 557 548 513 488 550 567 553 529 [4,] 521 516 596 573 576 568 535 499 554 573 580 541 [5,] 563 517 601 588 590 573 552 515 585 590 607 558 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 488.0933 497.52 558.8267 508.8267 531.72 531.6733 496.1467 479.5733 [2,] 523.9067 516.48 605.1733 555.1733 582.28 564.3267 529.8533 496.4267 [,9] [,10] [,11] [,12] [1,] 535.2533 560.68 535.0933 515.3067 [2,] 564.7467 573.32 570.9067 542.6933 $out [1] 562 489 538 528 $group [1] 2 6 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(473, 487, 506, 521, 563, 475, 498, 507, 516, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tnqv1425913283.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] [1,] 473 503.0 516.0 494.0 500.0 473.0 492 484.0 468.0 NA [2,] 485 517.5 530.5 548.0 515.5 506.5 511 509.5 488.0 NA [3,] 529 529.0 546.0 562.5 542.5 539.5 552 523.5 511.0 NA [4,] 549 581.5 586.0 585.5 550.5 572.0 562 540.5 521.5 NA [5,] 560 596.0 607.0 593.0 570.0 582.0 601 567.0 544.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 499.8092 499.8092 520.6861 545.396 526.5363 509.625 528.7386 509.3607 [2,] 558.1908 558.1908 571.3139 579.604 558.4637 569.375 575.2614 537.6393 [,9] [,10] [1,] 495.7204 NA [2,] 526.2796 NA $out [1] 460 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(473, 485, 529, 549, 560, 503, 517.5, 529, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6a5av1425913283.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,] 19.30745 62.0 12.0 [2,] 22.69657 67.0 22.0 [3,] 25.10956 74.0 31.5 [4,] 26.81623 85.5 39.0 [5,] 28.56328 90.0 48.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 23.23056 65.56203 23.74619 [2,] 26.98857 82.43797 39.25381 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(19.3074539434328, 22.6965748007572, 25.1095649805595, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xuay1425913283.ps tmp/1xuay1425913283.png",intern=TRUE)) character(0) > try(system("convert tmp/20al41425913283.ps tmp/20al41425913283.png",intern=TRUE)) character(0) > try(system("convert tmp/3p1dh1425913283.ps tmp/3p1dh1425913283.png",intern=TRUE)) character(0) > try(system("convert tmp/4uiqd1425913283.ps tmp/4uiqd1425913283.png",intern=TRUE)) character(0) > try(system("convert tmp/5tnqv1425913283.ps tmp/5tnqv1425913283.png",intern=TRUE)) character(0) > try(system("convert tmp/6a5av1425913283.ps tmp/6a5av1425913283.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.195 0.322 2.547