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(564410,658506,574787,611567,565210,638288,524970,505151,605350,517957,510879,622942,459903,486911,545974,481494,492324,609265,573243,524622,540071,564556,465319,458048,492603,606596,776475,749810,832426,895273,643875,348031,301771,411429,350941,425245,447041,449723,514318,445044,532552,469484,442289,532681,524463,590857,487590,612157,598030,577042,755394,697253,476835,510995,527816,482667,531528,628748,472131,445430,551715,561949,769474,583410,480271,576444,550457,534892,541769,741041,482062,586176) > 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,] 564410 459903 492603 447041 598030 551715 NA [2,] 658506 486911 606596 449723 577042 561949 NA [3,] 574787 545974 776475 514318 755394 769474 NA [4,] 611567 481494 749810 445044 697253 583410 NA [5,] 565210 492324 832426 532552 476835 480271 NA [6,] 638288 609265 895273 469484 510995 576444 NA [7,] 524970 573243 643875 442289 527816 550457 NA [8,] 505151 524622 348031 532681 482667 534892 NA [9,] 605350 540071 301771 524463 531528 541769 NA [10,] 517957 564556 411429 590857 628748 741041 NA [11,] 510879 465319 350941 487590 472131 482062 NA [12,] 622942 458048 425245 612157 445430 586176 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/1hfcf1416663947.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/2vfb91416663947.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/3051g1416663947.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/47h9c1416663947.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] [1,] 447041 449723.0 514318.0 445044.0 476835 469484.0 524970.0 482667.0 [2,] 459903 486911.0 545974.0 481494.0 480271 510995.0 524970.0 482667.0 [3,] 522159 569495.5 665090.5 597488.5 512438 592854.5 539136.5 514886.5 [4,] 564410 606596.0 769474.0 697253.0 565210 638288.0 573243.0 532681.0 [5,] 598030 658506.0 776475.0 749810.0 565210 638288.0 643875.0 534892.0 [,9] [,10] [,11] [,12] [1,] 524463.0 411429.0 465319.0 425245 [2,] 524463.0 517957.0 465319.0 445430 [3,] 535799.5 577706.5 477096.5 522112 [4,] 541769.0 628748.0 487590.0 612157 [5,] 541769.0 741041.0 510879.0 622942 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 454748.6 492294.8 520925.8 458317 457649.6 510746.4 507998.9 482625.9 [2,] 589569.4 646696.2 809255.2 736660 567226.4 674962.6 570274.1 547147.1 [,9] [,10] [,11] [,12] [1,] 524636.6 506242.7 462731 414567.7 [2,] 546962.4 649170.3 491462 629656.3 $out [1] 832426 895273 442289 348031 605350 301771 350941 $group [1] 5 6 7 8 9 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(447041, 459903, 522159, 564410, 598030, 449723, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52sa51416663947.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,] 505151.0 458048.0 301771.0 442289.0 445430 480271.0 NA [2,] 521463.5 473406.5 381185.0 448382.0 479751 538330.5 NA [3,] 569998.5 508473.0 549599.5 500954.0 529672 556832.0 NA [4,] 617254.5 555265.0 763142.5 532616.5 613389 584793.0 NA [5,] 658506.0 609265.0 895273.0 612157.0 755394 586176.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 526307.6 471136.8 375386.1 462534.1 468718.8 535640.1 NA [2,] 613689.4 545809.2 723812.9 539373.9 590625.2 578023.9 NA $out [1] 769474 741041 $group [1] 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(505151, 521463.5, 569998.5, 617254.5, 658506, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60ypg1416663947.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,] 56378.48 150989 15115.25 [2,] 68718.35 192279 42121.62 [3,] 98100.02 235470 91413.38 [4,] 120907.84 317189 130376.12 [5,] 150060.55 425789 212776.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 74296.05 178497.7 51159.91 [2,] 121904.00 292442.3 131666.84 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(56378.4781170971, 68718.3458951144, 98100.0220667924, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hfcf1416663947.ps tmp/1hfcf1416663947.png",intern=TRUE)) character(0) > try(system("convert tmp/2vfb91416663947.ps tmp/2vfb91416663947.png",intern=TRUE)) character(0) > try(system("convert tmp/3051g1416663947.ps tmp/3051g1416663947.png",intern=TRUE)) character(0) > try(system("convert tmp/47h9c1416663947.ps tmp/47h9c1416663947.png",intern=TRUE)) character(0) > try(system("convert tmp/52sa51416663947.ps tmp/52sa51416663947.png",intern=TRUE)) character(0) > try(system("convert tmp/60ypg1416663947.ps tmp/60ypg1416663947.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.062 0.402 2.486