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(324,336,327,302,299,311,315,264,278,278,287,279,324,354,354,360,363,385,412,370,389,395,417,404,456,478,468,437,432,441,449,386,396,394,403,373,409,430,415,392,401,400,447,392,427,444,448,427,480,490,482,490,485,498,544,483,508,529,547,543,608,638,661,650,654,678,725,644,670,662,641,642) > 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,] 324 324 456 409 480 608 NA [2,] 336 354 478 430 490 638 NA [3,] 327 354 468 415 482 661 NA [4,] 302 360 437 392 490 650 NA [5,] 299 363 432 401 485 654 NA [6,] 311 385 441 400 498 678 NA [7,] 315 412 449 447 544 725 NA [8,] 264 370 386 392 483 644 NA [9,] 278 389 396 427 508 670 NA [10,] 278 395 394 444 529 662 NA [11,] 287 417 403 448 547 641 NA [12,] 279 404 373 427 543 642 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/12uqx1419671984.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/24y891419671984.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/3c2p41419671984.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/4numx1419671984.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,] 324.0 336 327.0 302.0 299.0 311.0 315 264 278.0 278.0 287.0 279.0 [2,] 324.0 354 354.0 360.0 363.0 385.0 412 370 389.0 394.0 403.0 373.0 [3,] 432.5 454 441.5 414.5 416.5 420.5 448 389 411.5 419.5 432.5 415.5 [4,] 480.0 490 482.0 490.0 485.0 498.0 544 483 508.0 529.0 547.0 543.0 [5,] 608.0 638 661.0 650.0 654.0 498.0 725 644 670.0 662.0 641.0 642.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,] 331.875 366.2756 358.9359 330.6458 337.8061 347.6114 362.8557 316.1114 [2,] 533.125 541.7244 524.0641 498.3542 495.1939 493.3886 533.1443 461.8886 [,9] [,10] [,11] [,12] [1,] 334.7412 332.4206 339.6153 305.8445 [2,] 488.2588 506.5794 525.3847 525.1555 $out [1] 678 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(324, 324, 432.5, 480, 608, 336, 354, 454, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58z8s1419671984.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,] 264.0 324.0 373.0 392.0 480 608.0 NA [2,] 278.5 357.0 395.0 400.5 484 641.5 NA [3,] 300.5 377.5 434.5 421.0 494 652.0 NA [4,] 319.5 399.5 452.5 437.0 536 666.0 NA [5,] 336.0 417.0 478.0 448.0 547 678.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 281.7996 358.1155 408.2739 404.3521 470.2825 640.8254 NA [2,] 319.2004 396.8845 460.7261 437.6479 517.7175 663.1746 NA $out [1] 725 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(264, 278.5, 300.5, 319.5, 336, 324, 357, 377.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/635bh1419671984.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,] 107.4239 284 86.250 [2,] 120.7310 341 98.125 [3,] 124.8201 359 109.000 [4,] 130.4229 382 114.875 [5,] 139.9971 410 133.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 120.3996 340.2996 101.3602 [2,] 129.2406 377.7004 116.6398 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(107.423926571318, 120.731016161532, 124.820111899301, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12uqx1419671984.ps tmp/12uqx1419671984.png",intern=TRUE)) character(0) > try(system("convert tmp/24y891419671984.ps tmp/24y891419671984.png",intern=TRUE)) character(0) > try(system("convert tmp/3c2p41419671984.ps tmp/3c2p41419671984.png",intern=TRUE)) character(0) > try(system("convert tmp/4numx1419671984.ps tmp/4numx1419671984.png",intern=TRUE)) character(0) > try(system("convert tmp/58z8s1419671984.ps tmp/58z8s1419671984.png",intern=TRUE)) character(0) > try(system("convert tmp/635bh1419671984.ps tmp/635bh1419671984.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.189 0.372 2.590