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(2201,1239,966,1001,1079,909,1038,817,817,926,555,156,1604,610,635,623,744,939,993,634,858,849,458,109,1538,739,855,834,1004,1355,968,811,1121,960,973,233,1662,894,966,859,946,1156,895,952,1078,689,621,587,1425,1022,1406,776,1105,2244,679,665,704,449,560,229,1158,908,1104,731,989,1308,757,896,917,844,815,401) > 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,] 2201 1604 1538 1662 1425 1158 NA [2,] 1239 610 739 894 1022 908 NA [3,] 966 635 855 966 1406 1104 NA [4,] 1001 623 834 859 776 731 NA [5,] 1079 744 1004 946 1105 989 NA [6,] 909 939 1355 1156 2244 1308 NA [7,] 1038 993 968 895 679 757 NA [8,] 817 634 811 952 665 896 NA [9,] 817 858 1121 1078 704 917 NA [10,] 926 849 960 689 449 844 NA [11,] 555 458 973 621 560 815 NA [12,] 156 109 233 587 229 401 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/1rf1u1425906112.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/251bn1425906112.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/39jlr1425906112.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/4yd8e1425906112.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,] 1158 610 635 623 946.0 909 679.0 634 704.0 449.0 458.0 109 [2,] 1425 739 855 731 946.0 939 757.0 665 817.0 689.0 555.0 156 [3,] 1571 901 966 805 996.5 1232 931.5 814 887.5 846.5 590.5 231 [4,] 1662 1022 1104 859 1079.0 1355 993.0 896 1078.0 926.0 815.0 401 [5,] 1662 1239 1406 1001 1105.0 1355 1038.0 952 1121.0 960.0 973.0 587 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1418.127 718.4559 805.387 722.4359 910.7107 963.6666 779.2724 [2,] 1723.873 1083.5441 1126.613 887.5641 1082.2893 1500.3334 1083.7276 [,8] [,9] [,10] [,11] [,12] [1,] 664.9975 719.1466 693.6273 422.7916 72.96709 [2,] 963.0025 1055.8534 999.3727 758.2084 389.03291 $out [1] 2201 744 2244 $group [1] 1 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1158, 1425, 1571, 1662, 1662, 610, 739, 901, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5im801425906112.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,] 555.0 458.0 739.0 587.0 229.0 401.0 NA [2,] 817.0 616.5 822.5 774.0 612.5 786.0 NA [3,] 946.0 689.5 964.0 920.5 740.0 902.0 NA [4,] 1058.5 898.5 1062.5 1022.0 1255.5 1046.5 NA [5,] 1239.0 993.0 1355.0 1156.0 1425.0 1308.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 835.8502 560.8779 854.5344 807.3855 446.7234 783.1842 NA [2,] 1056.1498 818.1221 1073.4656 1033.6145 1033.2766 1020.8158 NA $out [1] 2201 156 1604 109 1538 233 1662 2244 $group [1] 1 1 2 2 3 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(555, 817, 946, 1058.5, 1239, 458, 616.5, 689.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dpzu1425906112.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,] 125.2253 318.0 174.750 [2,] 135.3827 369.5 176.875 [3,] 183.8312 494.5 190.500 [4,] 238.2551 700.0 210.375 [5,] 344.9261 1043.0 215.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 136.9104 343.7567 175.2204 [2,] 230.7520 645.2433 205.7796 $out [1] 489.1032 1335.0000 110.5000 103.5000 350.0000 $group [1] 1 2 3 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(125.225263691743, 135.382684591671, 183.83122730564, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rf1u1425906112.ps tmp/1rf1u1425906112.png",intern=TRUE)) character(0) > try(system("convert tmp/251bn1425906112.ps tmp/251bn1425906112.png",intern=TRUE)) character(0) > try(system("convert tmp/39jlr1425906112.ps tmp/39jlr1425906112.png",intern=TRUE)) character(0) > try(system("convert tmp/4yd8e1425906112.ps tmp/4yd8e1425906112.png",intern=TRUE)) character(0) > try(system("convert tmp/5im801425906112.ps tmp/5im801425906112.png",intern=TRUE)) character(0) > try(system("convert tmp/6dpzu1425906112.ps tmp/6dpzu1425906112.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.156 0.322 2.511