R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(435,431,434,439,455,452,426,428,433,438,442,446,442,436,444,454,469,471,443,437,444,451,457,460,454,439,441,446,459,456,433,424,430,428,424,419,409,397,397,401,413,413,390,385,397,398,406,412,409,404,412,418,434,431,406,416,424,427,438,444,442,443,453,471,476,476,461,462,460,463,467,468,465,459,465,471,472,472,456,455,456,462,463,461) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 435 442 454 409 409 442 465 NA [2,] 431 436 439 397 404 443 459 NA [3,] 434 444 441 397 412 453 465 NA [4,] 439 454 446 401 418 471 471 NA [5,] 455 469 459 413 434 476 472 NA [6,] 452 471 456 413 431 476 472 NA [7,] 426 443 433 390 406 461 456 NA [8,] 428 437 424 385 416 462 455 NA [9,] 433 444 430 397 424 460 456 NA [10,] 438 451 428 398 427 463 462 NA [11,] 442 457 424 406 438 467 463 NA [12,] 446 460 419 412 444 468 461 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/1of7t1358300475.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/2r35v1358300475.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/3g8391358300475.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/4dfgn1358300475.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,] 409 397.0 397.0 401.0 413.0 413.0 390.0 385 397 398.0 406 412.0 [2,] 422 417.5 423.0 428.5 444.5 441.5 416.0 420 427 427.5 431 431.5 [3,] 442 436.0 441.0 446.0 459.0 456.0 433.0 428 433 438.0 442 446.0 [4,] 448 441.0 448.5 462.5 470.5 471.5 449.5 446 450 456.5 460 460.5 [5,] 465 459.0 465.0 471.0 476.0 476.0 461.0 462 460 463.0 467 468.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 426.4732 421.9662 425.7718 425.6957 443.4732 438.0845 412.9943 412.4732 [2,] 457.5268 450.0338 456.2282 466.3043 474.5268 473.9155 453.0057 443.5268 [,9] [,10] [,11] [,12] [1,] 419.2648 420.6817 424.6817 428.6817 [2,] 446.7352 455.3183 459.3183 463.3183 $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(409, 422, 442, 448, 465, 397, 417.5, 436, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hfbh1358300475.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] [1,] 426.0 436.0 419 385.0 404.0 442.0 455.0 NA [2,] 432.0 442.5 426 397.0 410.5 456.5 457.5 NA [3,] 436.5 447.5 436 399.5 421.0 462.5 462.5 NA [4,] 444.0 458.5 450 410.5 432.5 469.5 468.0 NA [5,] 455.0 471.0 459 413.0 444.0 476.0 472.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 431.0267 440.2023 425.0534 393.3426 410.9657 456.5706 457.7109 NA [2,] 441.9733 454.7977 446.9466 405.6574 431.0343 468.4294 467.2891 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(426, 432, 436.5, 444, 455, 436, 442.5, 447.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62hfc1358300475.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,] 21.18850 56.0 23.00 [2,] 21.72874 61.5 25.75 [3,] 22.96874 63.0 27.50 [4,] 24.59393 69.0 29.50 [5,] 26.14975 77.0 34.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 21.66190 59.5792 25.7896 [2,] 24.27557 66.4208 29.2104 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(21.1884964297229, 21.7287373923157, 22.9687378201436, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1of7t1358300475.ps tmp/1of7t1358300475.png",intern=TRUE)) character(0) > try(system("convert tmp/2r35v1358300475.ps tmp/2r35v1358300475.png",intern=TRUE)) character(0) > try(system("convert tmp/3g8391358300475.ps tmp/3g8391358300475.png",intern=TRUE)) character(0) > try(system("convert tmp/4dfgn1358300475.ps tmp/4dfgn1358300475.png",intern=TRUE)) character(0) > try(system("convert tmp/5hfbh1358300475.ps tmp/5hfbh1358300475.png",intern=TRUE)) character(0) > try(system("convert tmp/62hfc1358300475.ps tmp/62hfc1358300475.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.251 0.454 3.738