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(376,376,377,380,380,381,385,385,386,386,385,384,382,379,376,375,370,367,369,366,363,359,355,350,349,351,351,352,352,354,355,356,354,349,350,349,350,352,370,370,371,372,373,373,375,381,383,386,390,394,397,401,403,405,407,406,406,407,406,404,405,404,402,401,401,398,401,399,390,391,390,387) > 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,] 376 382 349 350 390 405 NA [2,] 376 379 351 352 394 404 NA [3,] 377 376 351 370 397 402 NA [4,] 380 375 352 370 401 401 NA [5,] 380 370 352 371 403 401 NA [6,] 381 367 354 372 405 398 NA [7,] 385 369 355 373 407 401 NA [8,] 385 366 356 373 406 399 NA [9,] 386 363 354 375 406 390 NA [10,] 386 359 349 381 407 391 NA [11,] 385 355 350 383 406 390 NA [12,] 384 350 349 386 404 387 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/1fhw21416478806.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/2t4jp1416478806.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/3trs91416478806.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/4mcze1416478806.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,] 349 351.0 351.0 352.0 352.0 354.0 355 356 354.0 349.0 350 349 [2,] 350 352.0 370.0 370.0 370.0 367.0 369 366 363.0 359.0 355 350 [3,] 379 377.5 376.5 377.5 375.5 376.5 379 379 380.5 383.5 384 385 [4,] 390 394.0 397.0 401.0 401.0 398.0 401 399 390.0 391.0 390 387 [5,] 405 404.0 402.0 401.0 403.0 405.0 407 406 406.0 407.0 406 404 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 353.1987 350.4086 359.0841 357.504 355.504 356.504 358.359 357.7139 [2,] 404.8013 404.5914 393.9159 397.496 395.496 396.496 399.641 400.2861 [,9] [,10] [,11] [,12] [1,] 363.0841 362.859 361.4239 361.1338 [2,] 397.9159 404.141 406.5761 408.8662 $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(349, 350, 379, 390, 405, 351, 352, 377.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ubvm1416478806.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,] 376.0 350.0 349.0 370.0 390.0 387.0 NA [2,] 378.5 361.0 349.5 370.0 399.0 390.5 NA [3,] 382.5 368.0 351.5 372.5 404.5 400.0 NA [4,] 385.0 375.5 354.0 378.0 406.0 401.5 NA [5,] 386.0 382.0 356.0 386.0 407.0 405.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 379.5353 361.3865 349.4475 368.8511 401.3073 394.9828 NA [2,] 385.4647 374.6135 353.5525 376.1489 407.6927 405.0172 NA $out [1] 350 352 $group [1] 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(376, 378.5, 382.5, 385, 386, 350, 361, 368, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qgwh1416478806.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,] 18.60555 49.0 20.500 [2,] 19.11345 51.0 24.875 [3,] 19.76545 52.0 26.125 [4,] 21.52402 55.5 28.000 [5,] 22.25009 58.0 32.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 18.66598 49.94752 24.69967 [2,] 20.86493 54.05248 27.55033 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(18.6055547261205, 19.1134538260839, 19.7654542002261, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fhw21416478806.ps tmp/1fhw21416478806.png",intern=TRUE)) character(0) > try(system("convert tmp/2t4jp1416478806.ps tmp/2t4jp1416478806.png",intern=TRUE)) character(0) > try(system("convert tmp/3trs91416478806.ps tmp/3trs91416478806.png",intern=TRUE)) character(0) > try(system("convert tmp/4mcze1416478806.ps tmp/4mcze1416478806.png",intern=TRUE)) character(0) > try(system("convert tmp/5ubvm1416478806.ps tmp/5ubvm1416478806.png",intern=TRUE)) character(0) > try(system("convert tmp/6qgwh1416478806.ps tmp/6qgwh1416478806.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.112 0.386 2.523