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(412,406,398,397,385,390,413,413,401,397,397,409,419,424,428,430,424,433,456,459,446,441,439,454,460,457,451,444,437,443,471,469,454,444,436,442,446,442,438,433,428,426,452,455,439,434,431,435,450,449,442,437,431,433,460,465,451,447,446,449,460,457,454,453,449,451,482,486,476,472,471,479) > 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,] 412 419 460 446 450 460 NA [2,] 406 424 457 442 449 457 NA [3,] 398 428 451 438 442 454 NA [4,] 397 430 444 433 437 453 NA [5,] 385 424 437 428 431 449 NA [6,] 390 433 443 426 433 451 NA [7,] 413 456 471 452 460 482 NA [8,] 413 459 469 455 465 486 NA [9,] 401 446 454 439 451 476 NA [10,] 397 441 444 434 447 472 NA [11,] 397 439 436 431 446 471 NA [12,] 409 454 442 435 449 479 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/1yxye1416739893.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/2nrot1416739893.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/3ztwd1416739893.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/4pnp11416739893.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,] 412 406.0 398 430 424.0 426 452 455 439.0 434.0 431.0 409.0 [2,] 419 424.0 428 430 424.0 426 452 455 439.0 434.0 431.0 435.0 [3,] 448 445.5 440 435 429.5 433 458 462 448.5 442.5 437.5 445.5 [4,] 460 457.0 451 444 437.0 443 471 469 454.0 447.0 446.0 454.0 [5,] 460 457.0 454 453 449.0 451 482 486 476.0 447.0 446.0 479.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 421.5537 424.2139 425.1643 425.9695 421.1146 422.0345 445.7444 452.9695 [2,] 474.4463 466.7861 454.8357 444.0305 437.8854 443.9655 470.2556 471.0305 [,9] [,10] [,11] [,12] [1,] 438.8245 434.1146 427.8245 433.2444 [2,] 458.1755 450.8854 447.1755 457.7556 $out [1] 397 385 390 413 413 401 397 472 397 471 $group [1] 4 5 6 7 8 9 10 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(412, 419, 448, 460, 460, 406, 424, 445.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b8yo1416739893.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,] 385.0 419 436.0 426.0 431.0 449.0 NA [2,] 397.0 426 442.5 432.0 439.5 453.5 NA [3,] 399.5 436 447.5 436.5 448.0 465.5 NA [4,] 410.5 450 458.5 444.0 450.5 477.5 NA [5,] 413.0 459 471.0 455.0 465.0 486.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 393.3426 425.0534 440.2023 431.0267 442.9828 454.5534 NA [2,] 405.6574 446.9466 454.7977 441.9733 453.0172 476.4466 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(385, 397, 399.5, 410.5, 413, 419, 426, 436, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6p89g1416739893.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,] 19.17985 48.0 10.500 [2,] 20.60450 56.0 11.750 [3,] 22.39723 66.5 12.625 [4,] 24.18221 73.5 17.125 [5,] 24.69615 75.0 18.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20.76541 58.51813 10.17343 [2,] 24.02905 74.48187 15.07657 $out [1] 31.75 26.50 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(19.1798505381733, 20.6045011471728, 22.3972296514222, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yxye1416739893.ps tmp/1yxye1416739893.png",intern=TRUE)) character(0) > try(system("convert tmp/2nrot1416739893.ps tmp/2nrot1416739893.png",intern=TRUE)) character(0) > try(system("convert tmp/3ztwd1416739893.ps tmp/3ztwd1416739893.png",intern=TRUE)) character(0) > try(system("convert tmp/4pnp11416739893.ps tmp/4pnp11416739893.png",intern=TRUE)) character(0) > try(system("convert tmp/5b8yo1416739893.ps tmp/5b8yo1416739893.png",intern=TRUE)) character(0) > try(system("convert tmp/6p89g1416739893.ps tmp/6p89g1416739893.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.092 0.365 2.479