R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570,596594,580523,564478,557560,575093,580112,574761,563250,551531,537034,544686,600991,604378,586111,563668,548604,551174,555654,547970,540324,530577,520579,518654,572273,581302,563280,547612,538712,540735,561649,558685,545732,536352,527676,530455,581744,598714,583775,571477,563278,564872,577537,572399,565430,560619,551227,553397,610893,621668,613148,598778,590623,595902,612186,603453,593362,581940,568075,567467,619423,627325,617144,602280,590816,589812) > 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,] 516922 528222 580112 555654 561649 577537 612186 NA [2,] 507561 532638 574761 547970 558685 572399 603453 NA [3,] 492622 536322 563250 540324 545732 565430 593362 NA [4,] 490243 536535 551531 530577 536352 560619 581940 NA [5,] 469357 523597 537034 520579 527676 551227 568075 NA [6,] 477580 536214 544686 518654 530455 553397 567467 NA [7,] 528379 586570 600991 572273 581744 610893 619423 NA [8,] 533590 596594 604378 581302 598714 621668 627325 NA [9,] 517945 580523 586111 563280 583775 613148 617144 NA [10,] 506174 564478 563668 547612 571477 598778 602280 NA [11,] 501866 557560 548604 538712 563278 590623 590816 NA [12,] 516141 575093 551174 540735 564872 595902 589812 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/1u2fe1450774137.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/2jxol1450774137.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/36nmc1450774137.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/4ns1l1450774137.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] [1,] 516922.0 507561 536322 530577.0 520579.0 518654.0 572273.0 581302 563280.0 [2,] 541938.0 540304 538323 533464.5 522088.0 524554.5 577008.5 588948 571901.5 [3,] 561649.0 558685 545732 536535.0 527676.0 536214.0 586570.0 598714 583775.0 [4,] 578824.5 573580 564340 556075.0 544130.5 549041.5 605942.0 613023 599629.5 [5,] 612186.0 603453 593362 581940.0 568075.0 567467.0 619423.0 627325 617144.0 [,10] [,11] [,12] [1,] 547612.0 501866.0 516141.0 [2,] 555640.0 543658.0 545954.5 [3,] 564478.0 557560.0 564872.0 [4,] 585127.5 576950.5 582452.5 [5,] 602280.0 590816.0 595902.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,] 539621 538813.1 530195.1 523032.4 514512.6 521590.8 569291.4 584336.8 [2,] 583677 578556.9 561268.9 550037.6 540839.4 550837.2 603848.6 613091.2 [,9] [,10] [,11] [,12] [1,] 567216.3 546868.5 537678.3 543076 [2,] 600333.7 582087.5 577441.7 586668 $out [1] 492622 490243 469357 477580 528379 533590 517945 506174 $group [1] 3 4 5 6 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(516922, 541938, 561649, 578824.5, 612186, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5oc751450774137.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,] 469357.0 523597.0 537034.0 518654.0 527676.0 551227.0 567467 NA [2,] 491432.5 534426.0 549889.0 534644.5 541042.0 563024.5 585876 NA [3,] 506867.5 547047.5 563459.0 544173.5 562463.5 584080.0 597821 NA [4,] 517433.5 577808.0 583111.5 559467.0 576610.5 604835.5 614665 NA [5,] 533590.0 596594.0 604378.0 581302.0 598714.0 621668.0 627325 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 495008.3 527260.7 548306 532851.8 546240.5 565009.7 584690.1 NA [2,] 518726.7 566834.3 578612 555495.2 578686.5 603150.3 610951.9 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(469357, 491432.5, 506867.5, 517433.5, 533590, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j30e1450774137.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,] 28210.42 88950.0 22042.50 [2,] 29604.11 90465.5 24281.00 [3,] 31049.87 94499.5 28330.75 [4,] 31830.46 97412.0 33284.25 [5,] 33317.13 100740.0 36886.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 30034.42 91331.15 24224.31 [2,] 32065.32 97667.85 32437.19 $out [1] 79761 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(28210.4232256701, 29604.1095210571, 31049.8686584177, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u2fe1450774137.ps tmp/1u2fe1450774137.png",intern=TRUE)) character(0) > try(system("convert tmp/2jxol1450774137.ps tmp/2jxol1450774137.png",intern=TRUE)) character(0) > try(system("convert tmp/36nmc1450774137.ps tmp/36nmc1450774137.png",intern=TRUE)) character(0) > try(system("convert tmp/4ns1l1450774137.ps tmp/4ns1l1450774137.png",intern=TRUE)) character(0) > try(system("convert tmp/5oc751450774137.ps tmp/5oc751450774137.png",intern=TRUE)) character(0) > try(system("convert tmp/6j30e1450774137.ps tmp/6j30e1450774137.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.082 0.389 2.493