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(27.65,28.19,28.98,28.99,29.02,29,29.04,29.19,29.23,29.26,29.02,28.47,28.53,28.48,28.68,28.89,29.2,29.21,29.15,29.22,29.34,29.13,28.84,28.76,28.75,28.89,28.82,29.12,29.21,29.3,29.32,29.52,29.64,29.54,29.54,29.34,29.34,29.54,29.94,30.17,30.23,30.34,30.34,30.36,30.3,30.28,29.89,29.58,29.68,29.73,30.07,30.32,30.55,30.62,30.67,30.79,30.8,30.5,30.07,29.41,29.42,29.99,30.14,30.41,30.78,30.88,30.92,30.93,31.62,31.48,31.3,31.11,31.16,31.22,31.66,32.11,32.27,32.36,32.42,32.52,32.41,31.87,31.04,30.58) > 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,] 27.65 28.53 28.75 29.34 29.68 29.42 31.16 NA [2,] 28.19 28.48 28.89 29.54 29.73 29.99 31.22 NA [3,] 28.98 28.68 28.82 29.94 30.07 30.14 31.66 NA [4,] 28.99 28.89 29.12 30.17 30.32 30.41 32.11 NA [5,] 29.02 29.20 29.21 30.23 30.55 30.78 32.27 NA [6,] 29.00 29.21 29.30 30.34 30.62 30.88 32.36 NA [7,] 29.04 29.15 29.32 30.34 30.67 30.92 32.42 NA [8,] 29.19 29.22 29.52 30.36 30.79 30.93 32.52 NA [9,] 29.23 29.34 29.64 30.30 30.80 31.62 32.41 NA [10,] 29.26 29.13 29.54 30.28 30.50 31.48 31.87 NA [11,] 29.02 28.84 29.54 29.89 30.07 31.30 31.04 NA [12,] 28.47 28.76 29.34 29.58 29.41 31.11 30.58 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/1cmxs1388080641.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/2wz8h1388080641.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/3qoz51388080641.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/4cuxs1388080641.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,] 27.65 28.190 28.680 28.890 29.020 29.000 29.040 29.19 29.23 29.13 28.840 [2,] 28.64 28.685 28.900 29.055 29.205 29.255 29.235 29.37 29.49 29.40 29.280 [3,] 29.34 29.540 29.940 30.170 30.230 30.340 30.340 30.36 30.30 30.28 29.890 [4,] 29.55 29.860 30.105 30.365 30.665 30.750 30.795 30.86 31.21 30.99 30.555 [5,] 29.68 31.220 31.660 32.110 32.270 32.360 32.420 32.52 32.41 31.87 31.300 [,12] [1,] 28.47 [2,] 29.05 [3,] 29.41 [4,] 30.08 [5,] 31.11 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 28.79656 28.83831 29.22039 29.38769 29.35811 29.44721 29.40839 29.4702 [2,] 29.88344 30.24169 30.65961 30.95231 31.10189 31.23279 31.27161 31.2498 [,9] [,10] [,11] [,12] [1,] 29.27284 29.33048 29.12859 28.7949 [2,] 31.32716 31.22952 30.65141 30.0251 $out [1] 31.16 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(27.65, 28.64, 29.34, 29.55, 29.68, 28.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5e6dc1388080641.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,] 28.190 28.480 28.750 29.340 29.410 29.420 30.580 NA [2,] 28.725 28.720 29.005 29.735 29.900 30.275 31.190 NA [3,] 29.010 29.010 29.310 30.200 30.410 30.900 31.990 NA [4,] 29.115 29.205 29.530 30.320 30.645 31.205 32.385 NA [5,] 29.260 29.340 29.640 30.360 30.800 31.620 32.520 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 28.83212 28.78879 29.07054 29.93318 30.0702 30.47582 31.44495 NA [2,] 29.18788 29.23121 29.54946 30.46682 30.7498 31.32418 32.53505 NA $out [1] 27.65 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(28.19, 28.725, 29.01, 29.115, 29.26, 28.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6u3dc1388080641.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.9392677 2.460 0.9100 [2,] 1.0364943 2.860 1.1900 [3,] 1.1166849 3.200 1.3850 [4,] 1.1933795 3.345 1.5275 [5,] 1.2165231 3.510 1.7200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.045129 2.978788 1.231064 [2,] 1.188241 3.421212 1.538936 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.939267698541694, 1.03649426253319, 1.11668492164101, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cmxs1388080641.ps tmp/1cmxs1388080641.png",intern=TRUE)) character(0) > try(system("convert tmp/2wz8h1388080641.ps tmp/2wz8h1388080641.png",intern=TRUE)) character(0) > try(system("convert tmp/3qoz51388080641.ps tmp/3qoz51388080641.png",intern=TRUE)) character(0) > try(system("convert tmp/4cuxs1388080641.ps tmp/4cuxs1388080641.png",intern=TRUE)) character(0) > try(system("convert tmp/5e6dc1388080641.ps tmp/5e6dc1388080641.png",intern=TRUE)) character(0) > try(system("convert tmp/6u3dc1388080641.ps tmp/6u3dc1388080641.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.554 1.230 6.789