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(1.464,1.474,1.479,1.517,1.575,1.627,1.464,1.474,1.479,1.517,1.575,1.627,1.613,1.558,1.545,1.406,1.269,1.191,1.231,1.276,1.281,1.312,1.363,1.419,1.374,1.422,1.378,1.38,1.409,1.398,1.445,1.452,1.506,1.531,1.524,1.52,1.499,1.491,1.496,1.493,1.507,1.569,1.593,1.597,1.633,1.686,1.683,1.646,1.658,1.636,1.67,1.634,1.618,1.622,1.688,1.723,1.776,1.809,1.754,1.714,1.733,1.783,1.818,1.81,1.764,1.73,1.742,1.785,1.769,1.743,1.721,1.73,1.753,1.764,1.758,1.7,1.678,1.688) > 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] 78 > (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] 7 7 7 7 7 7 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.464 1.613 1.374 1.499 1.658 1.733 1.753 [2,] 1.474 1.558 1.422 1.491 1.636 1.783 1.764 [3,] 1.479 1.545 1.378 1.496 1.670 1.818 1.758 [4,] 1.517 1.406 1.380 1.493 1.634 1.810 1.700 [5,] 1.575 1.269 1.409 1.507 1.618 1.764 1.678 [6,] 1.627 1.191 1.398 1.569 1.622 1.730 1.688 [7,] 1.464 1.231 1.445 1.593 1.688 1.742 NA [8,] 1.474 1.276 1.452 1.597 1.723 1.785 NA [9,] 1.479 1.281 1.506 1.633 1.776 1.769 NA [10,] 1.517 1.312 1.531 1.686 1.809 1.743 NA [11,] 1.575 1.363 1.524 1.683 1.754 1.721 NA [12,] 1.627 1.419 1.520 1.646 1.714 1.730 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/1z0ud1416574297.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/26brm1416574297.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/3amck1416574297.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/46q4c1416574297.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] [1,] 1.3740 1.4220 1.3780 1.3800 1.269 1.3980 1.2310 1.2760 1.2810 1.3120 1.363 [2,] 1.4815 1.4825 1.4875 1.4495 1.458 1.4835 1.4450 1.4520 1.4790 1.5170 1.524 [3,] 1.6130 1.5580 1.5450 1.5170 1.575 1.6220 1.5285 1.5355 1.5695 1.6085 1.629 [4,] 1.6955 1.7000 1.7140 1.6670 1.648 1.6575 1.6880 1.7230 1.7690 1.7430 1.721 [5,] 1.7530 1.7830 1.8180 1.8100 1.764 1.7300 1.7420 1.7850 1.7760 1.8090 1.754 [,12] [1,] 1.4190 [2,] 1.5200 [3,] 1.6365 [4,] 1.7140 [5,] 1.7300 $n [1] 7 7 7 7 7 7 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.485203 1.428113 1.409738 1.387113 1.461535 1.51809 1.371757 1.360696 [2,] 1.740797 1.687887 1.680262 1.646887 1.688465 1.72591 1.685243 1.710304 [,9] [,10] [,11] [,12] [1,] 1.382441 1.462723 1.501929 1.511364 [2,] 1.756559 1.754277 1.756071 1.761636 $out [1] 1.191 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.374, 1.4815, 1.613, 1.6955, 1.753, 1.422, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lslm1416574297.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,] 1.464 1.1910 1.3740 1.4910 1.6180 1.7210 1.6780 [2,] 1.474 1.2725 1.3890 1.4975 1.6350 1.7315 1.6880 [3,] 1.498 1.3375 1.4335 1.5810 1.6790 1.7535 1.7265 [4,] 1.575 1.4820 1.5130 1.6395 1.7385 1.7840 1.7580 [5,] 1.627 1.6130 1.5310 1.6860 1.8090 1.8180 1.7640 $n [1] 12 12 12 12 12 12 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.451933 1.241946 1.376943 1.516233 1.631793 1.729554 1.681348 [2,] 1.544067 1.433054 1.490057 1.645767 1.726207 1.777446 1.771652 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.464, 1.474, 1.498, 1.575, 1.627, 1.191, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nf5t1416574297.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,] 0.1194817 0.3110 0.150250 [2,] 0.1449299 0.3850 0.182375 [3,] 0.1639514 0.4675 0.214250 [4,] 0.1877805 0.5030 0.222000 [5,] 0.1906872 0.5390 0.249250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1444069 0.4136794 0.1961768 [2,] 0.1834958 0.5213206 0.2323232 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.119481658285557, 0.144929910467159, 0.163951372505998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1z0ud1416574297.ps tmp/1z0ud1416574297.png",intern=TRUE)) character(0) > try(system("convert tmp/26brm1416574297.ps tmp/26brm1416574297.png",intern=TRUE)) character(0) > try(system("convert tmp/3amck1416574297.ps tmp/3amck1416574297.png",intern=TRUE)) character(0) > try(system("convert tmp/46q4c1416574297.ps tmp/46q4c1416574297.png",intern=TRUE)) character(0) > try(system("convert tmp/5lslm1416574297.ps tmp/5lslm1416574297.png",intern=TRUE)) character(0) > try(system("convert tmp/6nf5t1416574297.ps tmp/6nf5t1416574297.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.122 0.362 2.505