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(876,819,610,757,840,745,662,563,624,588,754,705,661,737,542,709,787,689,601,467,555,471,718,676,700,781,596,779,727,692,560,517,572,491,639,585,596,617,445,615,571,592,580,487,540,546,649,620,593,528,492,570,592,512,475,405,540,472,567,538,508,578,466,540,515,550,485,355,386,365,417,356) > 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,] 876 661 700 596 593 508 NA [2,] 819 737 781 617 528 578 NA [3,] 610 542 596 445 492 466 NA [4,] 757 709 779 615 570 540 NA [5,] 840 787 727 571 592 515 NA [6,] 745 689 692 592 512 550 NA [7,] 662 601 560 580 475 485 NA [8,] 563 467 517 487 405 355 NA [9,] 624 555 572 540 540 386 NA [10,] 588 471 491 546 472 365 NA [11,] 754 718 639 649 567 417 NA [12,] 705 676 585 620 538 356 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/172jw1416502782.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/2eetz1416502782.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/3rwjy1416502782.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/4sr831416502782.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,] 508.0 528 445 540 515.0 512.0 475 355 540.0 365.0 417 356.0 [2,] 593.0 578 466 570 571.0 550.0 485 405 540.0 471.0 567 538.0 [3,] 628.5 677 517 662 659.5 640.5 570 477 547.5 481.5 644 602.5 [4,] 700.0 781 596 757 787.0 692.0 601 517 572.0 546.0 718 676.0 [5,] 700.0 819 610 779 840.0 745.0 662 563 572.0 588.0 754 705.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,] 559.4815 546.0584 433.1458 541.379 520.173 548.9054 495.1763 404.7564 [2,] 697.5185 807.9416 600.8542 782.621 798.827 732.0946 644.8237 549.2436 [,9] [,10] [,11] [,12] [1,] 526.859 433.1226 546.6001 513.4855 [2,] 568.141 529.8774 741.3999 691.5145 $out [1] 876 624 386 $group [1] 1 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(508, 593, 628.5, 700, 700, 528, 578, 677, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a5h31416502782.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,] 563 467.0 491.0 445 405.0 355.0 NA [2,] 617 548.5 566.0 543 483.5 375.5 NA [3,] 725 668.5 617.5 586 533.0 475.5 NA [4,] 788 713.5 713.5 616 568.5 527.5 NA [5,] 876 787.0 781.0 649 593.0 578.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 647.0058 593.2424 550.2243 552.7042 494.2309 406.1718 NA [2,] 802.9942 743.7576 684.7757 619.2958 571.7691 544.8282 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(563, 617, 725, 788, 876, 467, 548.5, 668.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62icf1416502782.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,] 68.59276 165.0 27.750 [2,] 75.85173 215.5 90.500 [3,] 96.23801 238.5 111.125 [4,] 122.89663 331.0 147.250 [5,] 130.93815 368.0 195.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 74.78052 185.8197 85.24094 [2,] 117.69550 291.1803 137.00906 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(68.5927595790304, 75.8517334243614, 96.2380080331005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/172jw1416502782.ps tmp/172jw1416502782.png",intern=TRUE)) character(0) > try(system("convert tmp/2eetz1416502782.ps tmp/2eetz1416502782.png",intern=TRUE)) character(0) > try(system("convert tmp/3rwjy1416502782.ps tmp/3rwjy1416502782.png",intern=TRUE)) character(0) > try(system("convert tmp/4sr831416502782.ps tmp/4sr831416502782.png",intern=TRUE)) character(0) > try(system("convert tmp/5a5h31416502782.ps tmp/5a5h31416502782.png",intern=TRUE)) character(0) > try(system("convert tmp/62icf1416502782.ps tmp/62icf1416502782.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.162 0.365 2.542