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(105.86,105.97,106.08,106.04,106.65,106.85,106.85,106.95,107.29,107.65,107.87,107.98,107.98,107.83,108.69,108.91,109.67,109.72,109.72,109.72,109.74,109.78,110.49,110.37,110.37,110.41,110.64,110.88,110.91,110.99,110.99,110.99,111.28,112.37,112.35,112.24,112.24,112.21,112.35,112.71,113.08,113.26,113.26,113.27,113.85,114.92,115.24,115.21,115.21,115.18,115.24,116.24,116.68,116.77,116.77,116.84,116.94,117.83,118.16,118.27,113.62,113.72,113.53,113.69,114.61,114.46,114.68,114.72,115.62,115.4,115.43,115.44) > 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,] 105.86 107.98 110.37 112.24 115.21 113.62 NA [2,] 105.97 107.83 110.41 112.21 115.18 113.72 NA [3,] 106.08 108.69 110.64 112.35 115.24 113.53 NA [4,] 106.04 108.91 110.88 112.71 116.24 113.69 NA [5,] 106.65 109.67 110.91 113.08 116.68 114.61 NA [6,] 106.85 109.72 110.99 113.26 116.77 114.46 NA [7,] 106.85 109.72 110.99 113.26 116.77 114.68 NA [8,] 106.95 109.72 110.99 113.27 116.84 114.72 NA [9,] 107.29 109.74 111.28 113.85 116.94 115.62 NA [10,] 107.65 109.78 112.37 114.92 117.83 115.40 NA [11,] 107.87 110.49 112.35 115.24 118.16 115.43 NA [12,] 107.98 110.37 112.24 115.21 118.27 115.44 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/1iehi1416860400.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/2ewgd1416860400.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/3coxq1416860400.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/4m9ih1416860400.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,] 105.860 105.97 106.080 106.040 106.650 106.850 106.850 106.95 107.290 [2,] 107.980 107.83 108.690 108.910 109.670 109.720 109.720 109.72 109.740 [3,] 111.305 111.31 111.495 111.795 111.995 112.125 112.125 112.13 112.565 [4,] 113.620 113.72 113.530 113.690 114.610 114.460 114.680 114.72 115.620 [5,] 115.210 115.18 115.240 116.240 116.680 116.770 116.770 116.84 116.940 [,10] [,11] [,12] [1,] 107.650 107.870 107.980 [2,] 109.780 110.490 110.370 [3,] 113.645 113.795 113.725 [4,] 115.400 115.430 115.440 [5,] 117.830 118.160 118.270 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.667 107.5108 108.373 108.7117 108.8085 109.0675 108.9256 108.9048 [2,] 114.943 115.1092 114.617 114.8783 115.1815 115.1825 115.3244 115.3552 [,9] [,10] [,11] [,12] [1,] 108.7722 110.0199 110.6085 110.4547 [2,] 116.3578 117.2701 116.9815 116.9953 $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(105.86, 107.98, 111.305, 113.62, 115.21, 105.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5uflj1416860400.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,] 105.86 107.83 110.37 112.210 115.180 113.530 NA [2,] 106.06 108.80 110.76 112.530 115.740 113.705 NA [3,] 106.85 109.72 110.99 113.260 116.770 114.645 NA [4,] 107.47 109.76 111.76 114.385 117.385 115.415 NA [5,] 107.98 110.49 112.37 115.240 118.270 115.620 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 106.2069 109.2821 110.5339 112.4139 116.0197 113.8651 NA [2,] 107.4931 110.1579 111.4461 114.1061 117.5203 115.4249 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(105.86, 106.06, 106.85, 107.47, 107.98, 107.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jnde1416860400.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,] 3.341445 9.16 4.04250 [2,] 3.537041 9.50 4.18500 [3,] 3.596444 9.92 4.37375 [4,] 3.710617 10.19 4.77500 [5,] 3.799018 10.29 5.05250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.517275 9.605286 4.104647 [2,] 3.675613 10.234714 4.642853 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.34144529607574, 3.53704131378042, 3.59644425901043, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1iehi1416860400.ps tmp/1iehi1416860400.png",intern=TRUE)) character(0) > try(system("convert tmp/2ewgd1416860400.ps tmp/2ewgd1416860400.png",intern=TRUE)) character(0) > try(system("convert tmp/3coxq1416860400.ps tmp/3coxq1416860400.png",intern=TRUE)) character(0) > try(system("convert tmp/4m9ih1416860400.ps tmp/4m9ih1416860400.png",intern=TRUE)) character(0) > try(system("convert tmp/5uflj1416860400.ps tmp/5uflj1416860400.png",intern=TRUE)) character(0) > try(system("convert tmp/6jnde1416860400.ps tmp/6jnde1416860400.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.235 0.406 2.657