R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(106.68,109.73,108.06,111.33,105.66,103.65,100.34,100.56,102.67,101.5,102.35,104.98,106.31,103.73,106.62,108.54,105.12,105.29,104.62,104.34,108.23,107.6,106.87,107.96,108.34,109.04,106.95,105.59,108.08,108.48,106.84,105.6,106.9,106.84,106.81,106.98,107.53,107.37,106.98,108.94,106.38,109.02,106.53,105.02,109.7,108.39,110.18,109.54,109.1,110.85,112.23,110.58,110.77,108.08,108.05,108.87,109.61,111.27,107.61,110.98,106.63,106.83,108.77,106.12,106.8,106.34,105.16,107.97,106.76,108.78,105.58,109.22,105.67,109.04,106.59,109.66,108.05,109.91,107.63,107.15,103.8,103.43,103.59,107.63) > 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,] 106.68 106.31 108.34 107.53 109.10 106.63 105.67 NA [2,] 109.73 103.73 109.04 107.37 110.85 106.83 109.04 NA [3,] 108.06 106.62 106.95 106.98 112.23 108.77 106.59 NA [4,] 111.33 108.54 105.59 108.94 110.58 106.12 109.66 NA [5,] 105.66 105.12 108.08 106.38 110.77 106.80 108.05 NA [6,] 103.65 105.29 108.48 109.02 108.08 106.34 109.91 NA [7,] 100.34 104.62 106.84 106.53 108.05 105.16 107.63 NA [8,] 100.56 104.34 105.60 105.02 108.87 107.97 107.15 NA [9,] 102.67 108.23 106.90 109.70 109.61 106.76 103.80 NA [10,] 101.50 107.60 106.84 108.39 111.27 108.78 103.43 NA [11,] 102.35 106.87 106.81 110.18 107.61 105.58 103.59 NA [12,] 104.98 107.96 106.98 109.54 110.98 109.22 107.63 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/fisher/rcomp/tmp/1cos01386073849.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/fisher/rcomp/tmp/2g08b1386073849.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/fisher/rcomp/tmp/3r1sg1386073849.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/fisher/rcomp/tmp/4v6i61386073849.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.670 103.730 106.590 105.59 105.120 103.650 104.620 100.56 102.67 [2,] 106.470 107.100 106.785 107.33 106.020 105.815 104.890 104.68 105.28 [3,] 106.680 109.040 106.980 108.94 106.800 108.080 106.530 105.60 106.90 [4,] 107.935 109.385 108.415 110.12 108.065 108.750 107.235 107.56 108.92 [5,] 109.100 110.850 108.770 111.33 110.770 109.910 108.050 108.87 109.70 [,10] [,11] [,12] [1,] 101.500 102.350 104.980 [2,] 105.135 104.585 107.305 [3,] 107.600 106.810 107.960 [4,] 108.585 107.240 109.380 [5,] 111.270 110.180 110.980 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.8051 107.6754 106.0066 107.2739 105.5788 106.3273 105.1296 103.8801 [2,] 107.5549 110.4046 107.9534 110.6061 108.0212 109.8327 107.9304 107.3199 [,9] [,10] [,11] [,12] [1,] 104.7263 105.5397 105.2245 106.7208 [2,] 109.0737 109.6603 108.3955 109.1992 $out [1] 112.23 100.34 $group [1] 3 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(105.67, 106.47, 106.68, 107.935, 109.1, 103.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5kljb1386073849.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,] 100.340 103.730 105.590 105.020 107.610 105.16 103.430 NA [2,] 101.925 104.870 106.825 106.755 108.475 106.23 104.735 NA [3,] 104.315 106.465 106.925 107.960 110.095 106.78 107.390 NA [4,] 107.370 107.780 108.210 109.280 110.915 108.37 108.545 NA [5,] 111.330 108.540 109.040 110.180 112.230 109.22 109.910 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.8315 105.1377 106.2933 106.8083 108.9821 105.8039 105.6522 NA [2,] 106.7985 107.7923 107.5567 109.1117 111.2079 107.7561 109.1278 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(100.34, 101.925, 104.315, 107.37, 111.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6dbc11386073849.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,] 1.207201 3.430 1.4650 [2,] 1.985478 5.695 2.0600 [3,] 2.295418 6.645 2.5000 [4,] 2.672992 7.770 2.9075 [5,] 3.329454 9.770 3.6400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.981838 5.698579 2.11345 [2,] 2.608998 7.591421 2.88655 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.207200618511, 1.98547800723114, 2.2954182249768, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cos01386073849.ps tmp/1cos01386073849.png",intern=TRUE)) character(0) > try(system("convert tmp/2g08b1386073849.ps tmp/2g08b1386073849.png",intern=TRUE)) character(0) > try(system("convert tmp/3r1sg1386073849.ps tmp/3r1sg1386073849.png",intern=TRUE)) character(0) > try(system("convert tmp/4v6i61386073849.ps tmp/4v6i61386073849.png",intern=TRUE)) character(0) > try(system("convert tmp/5kljb1386073849.ps tmp/5kljb1386073849.png",intern=TRUE)) character(0) > try(system("convert tmp/6dbc11386073849.ps tmp/6dbc11386073849.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.343 1.468 7.779