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(498.10,498.76,498.88,498.88,498.88,498.88,499.48,501.21,502.05,502.05,502.05,504.10,506.81,516.88,520.43,520.68,520.68,520.68,521.03,521.25,521.25,521.25,521.65,521.65,522.77,518.72,519.27,519.38,521.29,521.29,521.29,523.47,523.86,524.14,524.14,524.14,534.60,534.99,535.39,535.39,535.39,535.39,535.39,535.64,536.08,537.80,537.80,537.80,537.85,544.39,545.15,544.65,544.65,544.65,545.73,548.94,550.94,551.22,551.22,551.22,553.12,565.37,566.73,566.73,566.78,566.78,566.78,566.78,566.93,566.93,566.93,566.93,574.38,574.40,574.40,574.40,574.40,574.40,574.50,574.50,574.67,574.66,574.66,574.94,576.10,583.38,584.15,584.15,584.15,584.15,585.14,585.14,585.67,586.49,586.81,586.85) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 498.10 506.81 522.77 534.60 537.85 553.12 574.38 576.10 NA [2,] 498.76 516.88 518.72 534.99 544.39 565.37 574.40 583.38 NA [3,] 498.88 520.43 519.27 535.39 545.15 566.73 574.40 584.15 NA [4,] 498.88 520.68 519.38 535.39 544.65 566.73 574.40 584.15 NA [5,] 498.88 520.68 521.29 535.39 544.65 566.78 574.40 584.15 NA [6,] 498.88 520.68 521.29 535.39 544.65 566.78 574.40 584.15 NA [7,] 499.48 521.03 521.29 535.39 545.73 566.78 574.50 585.14 NA [8,] 501.21 521.25 523.47 535.64 548.94 566.78 574.50 585.14 NA [9,] 502.05 521.25 523.86 536.08 550.94 566.93 574.67 585.67 NA [10,] 502.05 521.25 524.14 537.80 551.22 566.93 574.66 586.49 NA [11,] 502.05 521.65 524.14 537.80 551.22 566.93 574.66 586.81 NA [12,] 504.10 521.65 524.14 537.80 551.22 566.93 574.94 586.85 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/1o3wt1432659468.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/2nqv81432659468.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/3thl21432659468.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/40a481432659468.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,] 498.100 498.760 498.880 498.880 498.880 498.880 499.48 501.21 502.050 [2,] 514.790 517.800 519.850 520.030 520.985 520.985 521.16 522.36 522.555 [3,] 536.225 539.690 540.270 540.020 540.020 540.020 540.56 542.29 543.510 [4,] 563.750 569.885 570.565 570.565 570.590 570.590 570.64 570.64 570.800 [5,] 576.100 583.380 584.150 584.150 584.150 584.150 585.14 585.14 585.670 [,10] [,11] [,12] [1,] 502.050 502.050 504.100 [2,] 522.695 522.895 522.895 [3,] 544.510 544.510 544.510 [4,] 570.795 570.795 570.935 [5,] 586.490 586.810 586.850 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 508.8752 510.5946 511.9399 511.7904 512.3099 512.3099 512.9198 515.3201 [2,] 563.5748 568.7854 568.6001 568.2496 567.7301 567.7301 568.2002 569.2599 [,9] [,10] [,11] [,12] [1,] 516.5597 517.6406 517.7524 517.6742 [2,] 570.4603 571.3794 571.2676 571.3458 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(498.1, 514.79, 536.225, 563.75, 576.1, 498.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57x5i1432659468.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] [1,] 498.10 520.430 518.720 534.60 537.85 566.73 574.38 583.380 NA [2,] 498.88 520.555 520.335 535.39 544.65 566.73 574.40 584.150 NA [3,] 499.18 520.855 522.030 535.39 545.44 566.78 574.45 584.645 NA [4,] 502.05 521.250 524.000 536.94 551.08 566.93 574.66 586.080 NA [5,] 504.10 521.650 524.140 537.80 551.22 566.93 574.94 586.850 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 497.7341 520.538 520.3584 534.683 542.5072 566.6888 574.3314 583.7647 NA [2,] 500.6259 521.172 523.7016 536.097 548.3728 566.8712 574.5686 585.5253 NA $out [1] 506.81 516.88 553.12 565.37 576.10 $group [1] 2 2 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(498.1, 498.88, 499.18, 502.05, 504.1, 520.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ra3n1432659468.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,] 28.81488 82.750 45.3450 [2,] 29.26296 83.775 45.4300 [3,] 29.56942 84.690 46.6400 [4,] 29.93913 85.270 47.9200 [5,] 30.25049 85.660 49.3675 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 29.26101 84.00812 45.50429 [2,] 29.87782 85.37188 47.77571 $out [1] 78.000 39.655 $group [1] 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(28.8148800535418, 29.26295652294, 29.5694151954832, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o3wt1432659468.ps tmp/1o3wt1432659468.png",intern=TRUE)) character(0) > try(system("convert tmp/2nqv81432659468.ps tmp/2nqv81432659468.png",intern=TRUE)) character(0) > try(system("convert tmp/3thl21432659468.ps tmp/3thl21432659468.png",intern=TRUE)) character(0) > try(system("convert tmp/40a481432659468.ps tmp/40a481432659468.png",intern=TRUE)) character(0) > try(system("convert tmp/57x5i1432659468.ps tmp/57x5i1432659468.png",intern=TRUE)) character(0) > try(system("convert tmp/6ra3n1432659468.ps tmp/6ra3n1432659468.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.112 0.426 2.556