R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(467,475,470,442,433,427,410,406,429,425,431,408,454,459,441,420,416,400,401,398,442,458,476,447,511,514,513,511,498,490,495,486,530,539,555,548,615,634,645,634,630,635,642,637,675,679,676,660,716,730,717,694,670,641,626,604,630,634,635,619) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 467 454 511 615 716 NA [2,] 475 459 514 634 730 NA [3,] 470 441 513 645 717 NA [4,] 442 420 511 634 694 NA [5,] 433 416 498 630 670 NA [6,] 427 400 490 635 641 NA [7,] 410 401 495 642 626 NA [8,] 406 398 486 637 604 NA [9,] 429 442 530 675 630 NA [10,] 425 458 539 679 634 NA [11,] 431 476 555 676 635 NA [12,] 408 447 548 660 619 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/1pyj21447947787.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/2j3af1447947787.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/3qjwk1447947787.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/43g9d1447947787.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,] 454 459 441 420 416 400 401 398 429 425 431 408 [2,] 467 475 470 442 433 427 410 406 442 458 476 447 [3,] 511 514 513 511 498 490 495 486 530 539 555 548 [4,] 615 634 645 634 630 635 626 604 630 634 635 619 [5,] 716 730 717 694 670 641 642 637 675 679 676 660 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 406.4236 401.651 389.3454 375.3333 358.8003 343.0277 342.3749 346.0937 [2,] 615.5764 626.349 636.6546 646.6667 637.1997 636.9723 647.6251 625.9063 [,9] [,10] [,11] [,12] [1,] 397.1597 414.6388 442.651 426.4652 [2,] 662.8403 663.3612 667.349 669.5348 $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(454, 467, 511, 615, 716, 459, 475, 514, 634, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50jdf1447947787.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] [1,] 406.0 398.0 486.0 615.0 604 NA [2,] 417.5 408.5 496.5 634.0 628 NA [3,] 430.0 441.5 512.0 639.5 638 NA [4,] 454.5 456.0 534.5 667.5 705 NA [5,] 475.0 476.0 555.0 679.0 730 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 413.1241 419.8349 494.6679 624.2204 602.8798 NA [2,] 446.8759 463.1651 529.3321 654.7796 673.1202 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(406, 417.5, 430, 454.5, 475, 398, 408.5, 441.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kcfe1447947787.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.2681 239.0 148.0 [2,] 109.6610 243.0 165.5 [3,] 112.4521 253.0 182.0 [4,] 115.6042 266.5 197.5 [5,] 119.7881 276.0 216.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 109.7413 242.2815 167.4046 [2,] 115.1628 263.7185 196.5954 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(103.268097687524, 109.660954352563, 112.452091767956, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pyj21447947787.ps tmp/1pyj21447947787.png",intern=TRUE)) character(0) > try(system("convert tmp/2j3af1447947787.ps tmp/2j3af1447947787.png",intern=TRUE)) character(0) > try(system("convert tmp/3qjwk1447947787.ps tmp/3qjwk1447947787.png",intern=TRUE)) character(0) > try(system("convert tmp/43g9d1447947787.ps tmp/43g9d1447947787.png",intern=TRUE)) character(0) > try(system("convert tmp/50jdf1447947787.ps tmp/50jdf1447947787.png",intern=TRUE)) character(0) > try(system("convert tmp/6kcfe1447947787.ps tmp/6kcfe1447947787.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.908 0.352 2.284