R version 3.0.1 (2013-05-16) -- "Good Sport" 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(13.29,13.34,13.41,13.45,13.52,13.52,13.53,13.55,13.52,13.51,13.55,13.56,13.62,13.69,13.67,13.66,13.69,13.69,13.7,13.73,13.79,13.8,13.84,13.84,13.88,13.97,14.06,14.11,14.13,14.15,14.2,14.28,14.3,14.33,14.4,14.4,14.42,14.51,14.64,14.68,14.72,14.73,14.76,14.78,14.83,14.84,14.85,14.87,14.87,14.96,15.08,15.08,15.12,15.12,15.1,15.16,15.22,15.28,15.29,15.32,15.4,15.44,15.48,15.52,15.6,15.61,15.66,15.69,15.75,15.82,15.81,15.82) > 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,] 13.29 13.62 13.88 14.42 14.87 15.40 NA [2,] 13.34 13.69 13.97 14.51 14.96 15.44 NA [3,] 13.41 13.67 14.06 14.64 15.08 15.48 NA [4,] 13.45 13.66 14.11 14.68 15.08 15.52 NA [5,] 13.52 13.69 14.13 14.72 15.12 15.60 NA [6,] 13.52 13.69 14.15 14.73 15.12 15.61 NA [7,] 13.53 13.70 14.20 14.76 15.10 15.66 NA [8,] 13.55 13.73 14.28 14.78 15.16 15.69 NA [9,] 13.52 13.79 14.30 14.83 15.22 15.75 NA [10,] 13.51 13.80 14.33 14.84 15.28 15.82 NA [11,] 13.55 13.84 14.40 14.85 15.29 15.81 NA [12,] 13.56 13.84 14.40 14.87 15.32 15.82 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/13a1z1369615277.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/21ibj1369615277.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/3tyue1369615277.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/4puos1369615277.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,] 13.29 13.34 13.41 13.450 13.520 13.52 13.53 13.55 13.520 13.510 13.550 [2,] 13.62 13.69 13.67 13.660 13.690 13.69 13.70 13.73 13.790 13.800 13.840 [3,] 14.15 14.24 14.35 14.395 14.425 14.44 14.48 14.53 14.565 14.585 14.625 [4,] 14.87 14.96 15.08 15.080 15.120 15.12 15.10 15.16 15.220 15.280 15.290 [5,] 15.40 15.44 15.48 15.520 15.600 15.61 15.66 15.69 15.750 15.820 15.810 [,12] [1,] 13.560 [2,] 13.840 [3,] 14.635 [4,] 15.320 [5,] 15.820 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13.34371 13.42081 13.4405 13.47905 13.5026 13.5176 13.57695 13.6076 [2,] 14.95629 15.05919 15.2595 15.31095 15.3474 15.3624 15.38305 15.4524 [,9] [,10] [,11] [,12] [1,] 13.6426 13.63035 13.6897 13.68035 [2,] 15.4874 15.53965 15.5603 15.58965 $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(13.29, 13.62, 14.15, 14.87, 15.4, 13.34, 13.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5zik71369615277.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,] 13.29 13.620 13.880 14.420 14.87 15.400 NA [2,] 13.43 13.680 14.085 14.660 15.08 15.500 NA [3,] 13.52 13.695 14.175 14.745 15.12 15.635 NA [4,] 13.54 13.795 14.315 14.835 15.25 15.780 NA [5,] 13.56 13.840 14.400 14.870 15.32 15.820 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 13.46983 13.64255 14.0701 14.66518 15.04246 15.50729 NA [2,] 13.57017 13.74745 14.2799 14.82482 15.19754 15.76271 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(13.29, 13.43, 13.52, 13.54, 13.56, 13.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/66d9k1369615277.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.7974815 2.070 1.19000 [2,] 0.8149924 2.085 1.19375 [3,] 0.8274432 2.120 1.20375 [4,] 0.8594022 2.245 1.21875 [5,] 0.8842322 2.310 1.23750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.8071877 2.047023 1.192347 [2,] 0.8476988 2.192977 1.215153 $out [1] 1.0725 1.0875 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.797481452239904, 0.814992431991609, 0.82744322446931, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13a1z1369615277.ps tmp/13a1z1369615277.png",intern=TRUE)) character(0) > try(system("convert tmp/21ibj1369615277.ps tmp/21ibj1369615277.png",intern=TRUE)) character(0) > try(system("convert tmp/3tyue1369615277.ps tmp/3tyue1369615277.png",intern=TRUE)) character(0) > try(system("convert tmp/4puos1369615277.ps tmp/4puos1369615277.png",intern=TRUE)) character(0) > try(system("convert tmp/5zik71369615277.ps tmp/5zik71369615277.png",intern=TRUE)) character(0) > try(system("convert tmp/66d9k1369615277.ps tmp/66d9k1369615277.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.864 0.584 3.439