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(383,349,317,401,285,377,380,347,414,406,487,475,566,604,764,725,585,797,740,587,719,621,677,636,591,636,748,571,475,758,554,597,521,597,658,482,567,605,653,512,653,498,520,606,601,608,732,585,800,721,689,689,777,681,836,594,662,835,702,630,857,847,820,801,900,763,897,687,682,844,687,671) > 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,] 383 566 591 567 800 857 NA [2,] 349 604 636 605 721 847 NA [3,] 317 764 748 653 689 820 NA [4,] 401 725 571 512 689 801 NA [5,] 285 585 475 653 777 900 NA [6,] 377 797 758 498 681 763 NA [7,] 380 740 554 520 836 897 NA [8,] 347 587 597 606 594 687 NA [9,] 414 719 521 601 662 682 NA [10,] 406 621 597 608 835 844 NA [11,] 487 677 658 732 702 687 NA [12,] 475 636 482 585 630 671 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/1lbu71420544935.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/2pn941420544935.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/3v7o81420544935.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/4r3p01420544935.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,] 383 604.0 653.0 401 285 377.0 380 587.0 414.0 406.0 658 475.0 [2,] 566 604.0 653.0 512 475 498.0 520 587.0 521.0 597.0 658 482.0 [3,] 579 620.5 718.5 630 619 719.5 647 595.5 631.5 614.5 682 607.5 [4,] 800 721.0 764.0 725 777 763.0 836 606.0 682.0 835.0 702 636.0 [5,] 857 847.0 820.0 801 900 797.0 897 606.0 719.0 844.0 732 671.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,] 428.0624 545.0312 646.9014 492.6081 424.2002 548.5664 443.1698 583.2444 [2,] 729.9376 695.9688 790.0986 767.3919 813.7998 890.4336 850.8302 607.7556 [,9] [,10] [,11] [,12] [1,] 527.6498 460.9823 653.6186 508.165 [2,] 735.3502 768.0177 710.3814 706.835 $out [1] 349 317 347 687 487 $group [1] 2 3 8 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(383, 566, 579, 800, 857, 604, 604, 620.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59vkr1420544935.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,] 285.0 566.0 475.0 498.0 594.0 671.0 NA [2,] 348.0 595.5 537.5 543.5 671.5 687.0 NA [3,] 381.5 656.5 594.0 603.0 695.5 810.5 NA [4,] 410.0 732.5 647.0 630.5 788.5 852.0 NA [5,] 487.0 797.0 758.0 732.0 836.0 900.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 353.2214 594.0134 544.0563 563.3187 642.1355 735.2424 NA [2,] 409.7786 718.9866 643.9437 642.6813 748.8645 885.7576 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(285, 348, 381.5, 410, 487, 566, 595.5, 656.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l1qc1420544935.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,] 83.15147 196.0 15.000 [2,] 114.83603 322.5 96.750 [3,] 165.04653 429.0 158.750 [4,] 177.03492 500.5 203.625 [5,] 218.30048 615.0 283.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 136.6772 347.813 110.0036 [2,] 193.4159 510.187 207.4964 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(83.1514682171437, 114.836025333656, 165.046527470102, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lbu71420544935.ps tmp/1lbu71420544935.png",intern=TRUE)) character(0) > try(system("convert tmp/2pn941420544935.ps tmp/2pn941420544935.png",intern=TRUE)) character(0) > try(system("convert tmp/3v7o81420544935.ps tmp/3v7o81420544935.png",intern=TRUE)) character(0) > try(system("convert tmp/4r3p01420544935.ps tmp/4r3p01420544935.png",intern=TRUE)) character(0) > try(system("convert tmp/59vkr1420544935.ps tmp/59vkr1420544935.png",intern=TRUE)) character(0) > try(system("convert tmp/6l1qc1420544935.ps tmp/6l1qc1420544935.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.192 0.412 2.628