R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(540,520,550,440,570,560,600,620,690,600,570,710,600,450,530,400,560,460,610,550,580,650,640,760,550,460,510,370,530,410,580,550,490,700,630,720,540,500,450,370,490,440,600,580,500,670,620,800,640,390,390,390,460,460,620,570,510,640,590,850,670,390,410,340,470,540,680,670,540,630,560,800,610,490,440,330,490,590,690,650,480,690,540,830,690,500,460,310,490,470,710,710,540,700,520,810,690,510,390,270,530,510,670,770,570,640,480,830) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 540 600 550 540 640 670 610 690 690 NA [2,] 520 450 460 500 390 390 490 500 510 NA [3,] 550 530 510 450 390 410 440 460 390 NA [4,] 440 400 370 370 390 340 330 310 270 NA [5,] 570 560 530 490 460 470 490 490 530 NA [6,] 560 460 410 440 460 540 590 470 510 NA [7,] 600 610 580 600 620 680 690 710 670 NA [8,] 620 550 550 580 570 670 650 710 770 NA [9,] 690 580 490 500 510 540 480 540 570 NA [10,] 600 650 700 670 640 630 690 700 640 NA [11,] 570 640 630 620 590 560 540 520 480 NA [12,] 710 760 720 800 850 800 830 810 830 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/1mksx1471292387.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/2dkbp1471292387.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/3ij6l1471292387.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/4bouo1471292387.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,] 540 390 390 270 460 410 580 550 480 600 480 710 [2,] 550 450 410 330 490 460 600 570 500 640 540 760 [3,] 610 490 450 370 490 470 620 620 540 650 570 800 [4,] 670 500 510 390 530 540 680 670 570 690 620 830 [5,] 690 520 550 440 570 590 710 770 580 700 640 850 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 546.8 463.6667 397.3333 338.4 468.9333 427.8667 577.8667 567.3333 503.1333 [2,] 673.2 516.3333 502.6667 401.6 511.0667 512.1333 662.1333 672.6667 576.8667 [,10] [,11] [,12] [1,] 623.6667 527.8667 763.1333 [2,] 676.3333 612.1333 836.8667 $out [1] 690 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(540, 550, 610, 670, 690, 390, 450, 490, 500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wuyj1471292387.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] [,9] [,10] [1,] 520 400 370 370 390 340 330 310 270 NA [2,] 545 495 475 470 425 440 485 480 495 NA [3,] 570 570 540 520 540 550 565 530 550 NA [4,] 610 625 605 610 630 670 670 705 680 NA [5,] 690 760 720 800 850 800 830 810 830 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 540.3531 510.7061 480.7061 456.1451 446.4981 445.0955 480.6203 427.376 [2,] 599.6469 629.2939 599.2939 583.8549 633.5019 654.9045 649.3797 632.624 [,9] [,10] [1,] 465.6203 NA [2,] 634.3797 NA $out [1] 440 710 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(520, 545, 570, 610, 690, 400, 495, 570, 625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6calb1471292387.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,] 34.56074 100 40 [2,] 48.43774 130 55 [3,] 52.37385 155 75 [4,] 60.93452 175 90 [5,] 76.64855 220 120 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 46.67399 134.4752 59.03627 [2,] 58.07371 175.5248 90.96373 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(34.5607355888795, 48.4377440749151, 52.3738520212871, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mksx1471292387.ps tmp/1mksx1471292387.png",intern=TRUE)) character(0) > try(system("convert tmp/2dkbp1471292387.ps tmp/2dkbp1471292387.png",intern=TRUE)) character(0) > try(system("convert tmp/3ij6l1471292387.ps tmp/3ij6l1471292387.png",intern=TRUE)) character(0) > try(system("convert tmp/4bouo1471292387.ps tmp/4bouo1471292387.png",intern=TRUE)) character(0) > try(system("convert tmp/5wuyj1471292387.ps tmp/5wuyj1471292387.png",intern=TRUE)) character(0) > try(system("convert tmp/6calb1471292387.ps tmp/6calb1471292387.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.198 0.232 2.476