R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(425.25,417.75,410.25,395.25,546.75,539.25,425.25,349.50,357.00,357.00,364.50,380.25,334.50,288.75,251.25,251.25,395.25,410.25,296.25,167.25,235.50,235.50,288.75,319.50,312.00,235.50,273.75,258.75,387.75,357.00,235.50,144.75,228.00,251.25,273.75,303.75,243.00,190.50,213.00,220.50,417.75,417.75,303.75,288.75,334.50,312.00,372.75,448.50,463.50,357.00,327.00,296.25,501.75,516.75,478.50,516.75,509.25,448.50,516.75,592.50,623.25,531.75,471.00,516.75,714.00,774.75,759.75,789.75,782.25,706.50,835.50,866.25,911.25,774.75,721.50,782.25,927.00,1056.00,1025.25,1025.25,1040.25,987.75,1124.25,1124.25,1101.00,972.00,995.25,1010.25,1109.25,1238.25,1146.75,1192.50,1154.25,1131.75,1306.50,1268.25,1215.00,1139.25,1215.00,1253.25,1299.00,1359.75,1299.00,1336.50,1290.75,1283.25,1473.00,1488.75,1428.00,1321.50,1412.25,1450.50,1496.25,1564.50,1496.25,1549.50,1526.25,1443.00,1617.75,1617.75) > 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] [1,] 425.25 334.50 312.00 243.00 463.50 623.25 911.25 1101.00 1215.00 1428.00 [2,] 417.75 288.75 235.50 190.50 357.00 531.75 774.75 972.00 1139.25 1321.50 [3,] 410.25 251.25 273.75 213.00 327.00 471.00 721.50 995.25 1215.00 1412.25 [4,] 395.25 251.25 258.75 220.50 296.25 516.75 782.25 1010.25 1253.25 1450.50 [5,] 546.75 395.25 387.75 417.75 501.75 714.00 927.00 1109.25 1299.00 1496.25 [6,] 539.25 410.25 357.00 417.75 516.75 774.75 1056.00 1238.25 1359.75 1564.50 [7,] 425.25 296.25 235.50 303.75 478.50 759.75 1025.25 1146.75 1299.00 1496.25 [8,] 349.50 167.25 144.75 288.75 516.75 789.75 1025.25 1192.50 1336.50 1549.50 [9,] 357.00 235.50 228.00 334.50 509.25 782.25 1040.25 1154.25 1290.75 1526.25 [10,] 357.00 235.50 251.25 312.00 448.50 706.50 987.75 1131.75 1283.25 1443.00 [11,] 364.50 288.75 273.75 372.75 516.75 835.50 1124.25 1306.50 1473.00 1617.75 [12,] 380.25 319.50 303.75 448.50 592.50 866.25 1124.25 1268.25 1488.75 1617.75 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/14mwd1471026179.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/2pfsx1471026179.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/3l4z51471026179.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/4w7ub1471026179.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] [1,] 243.000 190.50 213.000 220.50 387.750 357.00 235.500 144.75 [2,] 334.500 288.75 273.750 258.75 417.750 417.75 303.750 288.75 [3,] 543.375 474.75 440.625 456.00 630.375 657.00 619.125 653.25 [4,] 1101.000 972.00 995.250 1010.25 1109.250 1238.25 1146.750 1192.50 [5,] 1428.000 1321.50 1412.250 1450.50 1496.250 1564.50 1496.250 1549.50 [,9] [,10] [,11] [,12] [1,] 228.00 235.50 273.750 303.750 [2,] 334.50 312.00 364.500 380.250 [3,] 645.75 577.50 676.125 729.375 [4,] 1154.25 1131.75 1306.500 1268.250 [5,] 1526.25 1443.00 1617.750 1617.750 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 160.401 133.3711 80.13483 80.52064 284.874 247.0455 197.9286 201.7005 [2,] 926.349 816.1289 801.11517 831.47936 975.876 1066.9545 1040.3214 1104.7995 [,9] [,10] [,11] [,12] [1,] 236.1702 167.9202 205.4642 285.6948 [2,] 1055.3298 987.0798 1146.7858 1173.0552 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(243, 334.5, 543.375, 1101, 1428, 190.5, 288.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p7uh1471026179.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] [1,] 349.50 167.250 144.750 190.500 296.250 471.000 721.500 972.000 1139.250 [2,] 360.75 243.375 235.500 231.750 402.750 577.500 846.750 1055.625 1234.125 [3,] 402.75 288.750 266.250 307.875 490.125 736.875 1006.500 1139.250 1294.875 [4,] 425.25 327.000 307.875 395.250 516.750 786.000 1048.125 1215.375 1348.125 [5,] 425.25 410.250 387.750 448.500 592.500 866.250 1124.250 1306.500 1488.750 [,10] [,11] [1,] 1321.50 NA [2,] 1435.50 NA [3,] 1496.25 NA [4,] 1557.00 NA [5,] 1617.75 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 373.3311 250.6081 233.2393 233.3016 438.1288 641.7768 914.6515 1066.387 [2,] 432.1689 326.8919 299.2607 382.4484 542.1212 831.9732 1098.3485 1212.113 [,9] [,10] [,11] [1,] 1242.879 1440.833 NA [2,] 1346.871 1551.667 NA $out [1] 546.75 539.25 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(349.5, 360.75, 402.75, 425.25, 425.25, 167.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kbwg1471026179.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,] 404.0615 1108.500 616.8750 [2,] 430.4863 1192.125 662.4375 [3,] 457.2462 1218.750 761.3438 [4,] 490.9317 1306.125 810.2812 [5,] 524.1208 1404.750 894.3750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 429.6767 1166.754 693.9112 [2,] 484.8158 1270.746 828.7763 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(404.061451081392, 430.486309286063, 457.246233145761, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14mwd1471026179.ps tmp/14mwd1471026179.png",intern=TRUE)) character(0) > try(system("convert tmp/2pfsx1471026179.ps tmp/2pfsx1471026179.png",intern=TRUE)) character(0) > try(system("convert tmp/3l4z51471026179.ps tmp/3l4z51471026179.png",intern=TRUE)) character(0) > try(system("convert tmp/4w7ub1471026179.ps tmp/4w7ub1471026179.png",intern=TRUE)) character(0) > try(system("convert tmp/5p7uh1471026179.ps tmp/5p7uh1471026179.png",intern=TRUE)) character(0) > try(system("convert tmp/6kbwg1471026179.ps tmp/6kbwg1471026179.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.382 0.232 2.677