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(732,768,902,739,744,848,745,752,833,703,824,759,797,840,988,819,831,904,814,798,828,789,930,744,832,826,907,776,835,715,729,733,736,712,711,667,799,661,692,649,729,622,671,635,648,744,624,476,710,515,461,590,415,554,585,513,591,561,684,668,795,776,1043,964,762,1030,939,779,918,839,874,840,794,820,1003,780,607,1001,743,810,716,775,883,633,755,782,882,694,896,674,702,799,791,797,1021,738,1023,955,912,850,1011,872,1074,811,878,1081,956,812,1125,1051,1090,1028,1178,1041,1146,866,875,1116,903,887) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 732 797 832 799 710 795 794 755 1023 1125 NA [2,] 768 840 826 661 515 776 820 782 955 1051 NA [3,] 902 988 907 692 461 1043 1003 882 912 1090 NA [4,] 739 819 776 649 590 964 780 694 850 1028 NA [5,] 744 831 835 729 415 762 607 896 1011 1178 NA [6,] 848 904 715 622 554 1030 1001 674 872 1041 NA [7,] 745 814 729 671 585 939 743 702 1074 1146 NA [8,] 752 798 733 635 513 779 810 799 811 866 NA [9,] 833 828 736 648 591 918 716 791 878 875 NA [10,] 703 789 712 744 561 839 775 797 1081 1116 NA [11,] 824 930 711 624 684 874 883 1021 956 903 NA [12,] 759 744 667 476 668 840 633 738 812 887 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/15it41426183647.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/2zb431426183647.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/3hasy1426183647.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/48ovp1426183647.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,] 710 661 882.0 590 607.0 554 585 635.0 591.0 561 624.0 476 [2,] 755 768 882.0 694 729.0 674 702 733.0 716.0 712 711.0 667 [3,] 796 801 909.5 778 796.5 860 744 788.5 809.5 782 878.5 741 [4,] 832 840 1003.0 850 896.0 1001 939 810.0 875.0 839 930.0 812 [5,] 832 840 1090.0 1028 1011.0 1041 1146 866.0 918.0 839 1021.0 887 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 757.5277 765.0259 849.0436 700.0562 713.0601 696.6178 625.5854 750.0277 [2,] 834.4723 836.9741 969.9564 855.9438 879.9399 1023.3822 862.4146 826.9723 [,9] [,10] [,11] [,12] [1,] 730.0573 718.5457 769.0789 668.5522 [2,] 888.9427 845.4543 987.9211 813.4478 $out [1] 1023 1125 515 955 1051 692 461 415 1178 513 1081 1116 $group [1] 1 1 2 2 2 3 3 5 5 8 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(710, 755, 796, 832, 832, 661, 768, 801, 840, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fx5a1426183647.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] [,11] [1,] 703.0 744.0 667.0 622.0 415.0 762.0 607.0 674.0 811.0 866.0 NA [2,] 741.5 797.5 713.5 629.5 514.0 787.0 729.5 720.0 861.0 895.0 NA [3,] 755.5 823.5 734.5 655.0 573.0 857.0 787.0 786.5 933.5 1046.0 NA [4,] 828.5 872.0 829.0 710.5 629.5 951.5 851.5 840.5 1017.0 1120.5 NA [5,] 902.0 930.0 907.0 799.0 710.0 1043.0 1003.0 1021.0 1081.0 1178.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 715.8187 789.52 681.8197 618.0554 520.3197 781.9704 731.355 731.5391 [2,] 795.1813 857.48 787.1803 691.9446 625.6803 932.0296 842.645 841.4609 [,9] [,10] [,11] [1,] 862.3474 943.1479 NA [2,] 1004.6526 1148.8521 NA $out [1] 988 476 $group [1] 2 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(703, 741.5, 755.5, 828.5, 902, 744, 797.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6veel1426183647.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,] 103.2841 327.0 59.00 [2,] 123.4693 404.0 89.00 [3,] 140.4212 462.5 134.25 [4,] 178.5655 558.0 166.00 [5,] 209.2037 763.0 199.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 115.2914 392.2596 99.12978 [2,] 165.5510 532.7404 169.37022 $out [1] 292.5 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(103.284074280598, 123.469298473548, 140.421197859701, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15it41426183647.ps tmp/15it41426183647.png",intern=TRUE)) character(0) > try(system("convert tmp/2zb431426183647.ps tmp/2zb431426183647.png",intern=TRUE)) character(0) > try(system("convert tmp/3hasy1426183647.ps tmp/3hasy1426183647.png",intern=TRUE)) character(0) > try(system("convert tmp/48ovp1426183647.ps tmp/48ovp1426183647.png",intern=TRUE)) character(0) > try(system("convert tmp/5fx5a1426183647.ps tmp/5fx5a1426183647.png",intern=TRUE)) character(0) > try(system("convert tmp/6veel1426183647.ps tmp/6veel1426183647.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.132 0.398 2.559