R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(1336,1756,2279,1944,1642,2679,2690,2263,2002,2620,3694,3194,2089,2420,3108,2160,1713,1191,2897,1287,2891,2662,2440,1899,519,1079,955,684,1090,1802,1360,804,1905,1732,964,1424,661,579,378,629,737,877,746,518,1032,1227,1610,1268,935,1224,1313,1642,1431,1124,1915,1503,2035,2200,2205,2297,1818,3525,3458,3958,1987,2375,1728,1618,1614,1820,1969,1632) > 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,] 1336 2089 519 661 935 1818 NA [2,] 1756 2420 1079 579 1224 3525 NA [3,] 2279 3108 955 378 1313 3458 NA [4,] 1944 2160 684 629 1642 3958 NA [5,] 1642 1713 1090 737 1431 1987 NA [6,] 2679 1191 1802 877 1124 2375 NA [7,] 2690 2897 1360 746 1915 1728 NA [8,] 2263 1287 804 518 1503 1618 NA [9,] 2002 2891 1905 1032 2035 1614 NA [10,] 2620 2662 1732 1227 2200 1820 NA [11,] 3694 2440 964 1610 2205 1969 NA [12,] 3194 1899 1424 1268 2297 1632 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/13n301479551403.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/2m4e11479551403.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/32aln1479551403.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/4xi4w1479551403.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,] 519.0 579 378 629 737.0 877.0 746.0 518 1032.0 1227 964 1268.0 [2,] 661.0 1079 955 684 1090.0 1124.0 1360.0 804 1614.0 1732 1610 1424.0 [3,] 1135.5 1490 1796 1793 1536.5 1496.5 1821.5 1395 1953.5 2010 2087 1765.5 [4,] 1818.0 2420 3108 2160 1713.0 2375.0 2690.0 1618 2035.0 2620 2440 2297.0 [5,] 2089.0 3525 3458 3958 1987.0 2679.0 2897.0 2263 2035.0 2662 2440 3194.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 389.1976 625.0117 407.2455 840.9323 1134.645 689.5646 963.607 [2,] 1881.8024 2354.9883 3184.7545 2745.0677 1938.355 2303.4354 2679.393 [,8] [,9] [,10] [,11] [,12] [1,] 869.9437 1681.941 1437.211 1551.623 1202.387 [2,] 1920.0563 2225.059 2582.789 2622.377 2328.613 $out [1] 2891 3694 $group [1] 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(519, 661, 1135.5, 1818, 2089, 579, 1079, 1490, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5l1kr1479551403.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,] 1336.0 1191.0 519.0 378.0 935.0 1614.0 NA [2,] 1850.0 1806.0 879.5 604.0 1268.5 1680.0 NA [3,] 2271.0 2290.0 1084.5 741.5 1572.5 1894.5 NA [4,] 2684.5 2776.5 1578.0 1129.5 2117.5 2916.5 NA [5,] 3694.0 3108.0 1905.0 1610.0 2297.0 3958.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1890.379 1847.348 765.9095 501.8159 1185.265 1330.524 NA [2,] 2651.621 2732.652 1403.0905 981.1841 1959.735 2458.476 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1336, 1850, 2271, 2684.5, 3694, 1191, 1806, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60xey1479551403.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,] 454.1069 1250.0 340.000 [2,] 613.6555 1657.5 673.000 [3,] 721.1632 1892.5 864.500 [4,] 992.0580 2838.0 1114.875 [5,] 1231.5005 3329.0 1182.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 548.5713 1354.066 662.9578 [2,] 893.7552 2430.934 1066.0422 $out [1] 1856.25 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(454.10688903238, 613.655546450647, 721.163249852242, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13n301479551403.ps tmp/13n301479551403.png",intern=TRUE)) character(0) > try(system("convert tmp/2m4e11479551403.ps tmp/2m4e11479551403.png",intern=TRUE)) character(0) > try(system("convert tmp/32aln1479551403.ps tmp/32aln1479551403.png",intern=TRUE)) character(0) > try(system("convert tmp/4xi4w1479551403.ps tmp/4xi4w1479551403.png",intern=TRUE)) character(0) > try(system("convert tmp/5l1kr1479551403.ps tmp/5l1kr1479551403.png",intern=TRUE)) character(0) > try(system("convert tmp/60xey1479551403.ps tmp/60xey1479551403.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.406 0.189 2.674