R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(9.24,9.29,9.39,9.42,9.42,9.43,9.5,9.53,9.58,9.58,9.6,9.61,9.65,9.71,9.78,9.79,9.84,9.87,9.9,9.95,9.96,9.98,10.01,10,10.03,10.05,10.06,10.09,10.24,10.23,10.27,10.28,10.29,10.44,10.51,10.52,10.57,10.62,10.71,10.73,10.74,10.75,10.79,10.81,10.87,10.92,10.95,10.94,10.97,10.99,11.04,11.09,11.12,11.11,11.14,11.2,11.25,11.3,11.31,11.31,11.33,11.41,11.46,11.48,11.58,11.63,11.69,11.74,11.68,11.69,11.71,11.75) > 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,] 9.24 9.65 10.03 10.57 10.97 11.33 NA [2,] 9.29 9.71 10.05 10.62 10.99 11.41 NA [3,] 9.39 9.78 10.06 10.71 11.04 11.46 NA [4,] 9.42 9.79 10.09 10.73 11.09 11.48 NA [5,] 9.42 9.84 10.24 10.74 11.12 11.58 NA [6,] 9.43 9.87 10.23 10.75 11.11 11.63 NA [7,] 9.50 9.90 10.27 10.79 11.14 11.69 NA [8,] 9.53 9.95 10.28 10.81 11.20 11.74 NA [9,] 9.58 9.96 10.29 10.87 11.25 11.68 NA [10,] 9.58 9.98 10.44 10.92 11.30 11.69 NA [11,] 9.60 10.01 10.51 10.95 11.31 11.71 NA [12,] 9.61 10.00 10.52 10.94 11.31 11.75 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/1nbu11354119619.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/2fnqt1354119619.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/3fmnn1354119619.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/4pwwp1354119619.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] [,12] [1,] 9.24 9.290 9.390 9.42 9.42 9.43 9.50 9.530 9.58 9.58 9.60 9.61 [2,] 9.65 9.710 9.780 9.79 9.84 9.87 9.90 9.950 9.96 9.98 10.01 10.00 [3,] 10.30 10.335 10.385 10.41 10.49 10.49 10.53 10.545 10.58 10.68 10.73 10.73 [4,] 10.97 10.990 11.040 11.09 11.12 11.11 11.14 11.200 11.25 11.30 11.31 11.31 [5,] 11.33 11.410 11.460 11.48 11.58 11.63 11.69 11.740 11.68 11.69 11.71 11.75 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.448557 9.509359 9.572259 9.571458 9.664359 9.69016 9.73016 [2,] 11.151443 11.160641 11.197741 11.248542 11.315641 11.28984 11.32984 [,8] [,9] [,10] [,11] [,12] [1,] 9.73871 9.747908 9.828557 9.891458 9.885008 [2,] 11.35129 11.412092 11.531443 11.568542 11.574992 $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(9.24, 9.65, 10.3, 10.97, 11.33, 9.29, 9.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5vjzm1354119619.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,] 9.240 9.650 10.030 10.570 10.970 11.330 NA [2,] 9.405 9.785 10.075 10.720 11.065 11.470 NA [3,] 9.465 9.885 10.255 10.770 11.130 11.655 NA [4,] 9.580 9.970 10.365 10.895 11.275 11.700 NA [5,] 9.610 10.010 10.520 10.950 11.310 11.750 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.385181 9.80062 10.12273 10.69018 11.03422 11.5501 NA [2,] 9.544819 9.96938 10.38727 10.84982 11.22578 11.7599 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(9.24, 9.405, 9.465, 9.58, 9.61, 9.65, 9.785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6i7ly1354119619.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.7936162 2.060 1.06000 [2,] 0.7985323 2.095 1.07750 [3,] 0.8027469 2.115 1.09500 [4,] 0.8115446 2.175 1.11125 [5,] 0.8212369 2.210 1.13500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.7968119 2.078511 1.079606 [2,] 0.8086819 2.151489 1.110394 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.793616196071292, 0.798532310378736, 0.802746873986928, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nbu11354119619.ps tmp/1nbu11354119619.png",intern=TRUE)) character(0) > try(system("convert tmp/2fnqt1354119619.ps tmp/2fnqt1354119619.png",intern=TRUE)) character(0) > try(system("convert tmp/3fmnn1354119619.ps tmp/3fmnn1354119619.png",intern=TRUE)) character(0) > try(system("convert tmp/4pwwp1354119619.ps tmp/4pwwp1354119619.png",intern=TRUE)) character(0) > try(system("convert tmp/5vjzm1354119619.ps tmp/5vjzm1354119619.png",intern=TRUE)) character(0) > try(system("convert tmp/6i7ly1354119619.ps tmp/6i7ly1354119619.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.070 0.759 3.834