R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(16.68,16.68,16.69,16.61,16.58,16.6,16.6,16.62,16.62,16.6,16.63,16.66,16.66,16.65,16.5,16.39,16.34,16.35,16.35,16.38,16.36,16.38,16.39,16.41,16.41,16.41,16.45,16.41,16.44,16.47,16.47,16.49,16.54,16.62,16.69,16.72,16.72,16.71,16.89,16.93,16.91,16.93,16.93,16.93,16.95,16.93,16.95,16.95,16.95,16.95,16.92,16.91,16.9,16.96,16.96,16.95,16.92,16.87,16.87,16.88,16.88,16.86,16.88,16.88,16.88,16.88,16.88,16.87,16.92,16.94,17.03,17.02) > 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,] 16.68 16.66 16.41 16.72 16.95 16.88 NA [2,] 16.68 16.65 16.41 16.71 16.95 16.86 NA [3,] 16.69 16.50 16.45 16.89 16.92 16.88 NA [4,] 16.61 16.39 16.41 16.93 16.91 16.88 NA [5,] 16.58 16.34 16.44 16.91 16.90 16.88 NA [6,] 16.60 16.35 16.47 16.93 16.96 16.88 NA [7,] 16.60 16.35 16.47 16.93 16.96 16.88 NA [8,] 16.62 16.38 16.49 16.93 16.95 16.87 NA [9,] 16.62 16.36 16.54 16.95 16.92 16.92 NA [10,] 16.60 16.38 16.62 16.93 16.87 16.94 NA [11,] 16.63 16.39 16.69 16.95 16.87 17.03 NA [12,] 16.66 16.41 16.72 16.95 16.88 17.02 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/1yakk1366983749.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/2p0nc1366983749.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/3k6m51366983749.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/4ru5o1366983749.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,] 16.41 16.410 16.450 16.390 16.34 16.35 16.35 16.380 16.36 16.380 16.39 [2,] 16.66 16.650 16.500 16.410 16.44 16.47 16.47 16.490 16.54 16.600 16.63 [3,] 16.70 16.695 16.785 16.745 16.73 16.74 16.74 16.745 16.77 16.745 16.78 [4,] 16.88 16.860 16.890 16.910 16.90 16.93 16.93 16.930 16.92 16.930 16.95 [5,] 16.95 16.950 16.920 16.930 16.91 16.96 16.96 16.950 16.95 16.940 17.03 [,12] [1,] 16.41 [2,] 16.66 [3,] 16.80 [4,] 16.95 [5,] 17.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.55809 16.55954 16.53344 16.42248 16.43329 16.44329 16.44329 16.46119 [2,] 16.84191 16.83046 17.03656 17.06752 17.02671 17.03671 17.03671 17.02881 [,9] [,10] [,11] [,12] [1,] 16.52489 16.53214 16.57359 16.61294 [2,] 17.01511 16.95786 16.98641 16.98706 $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(16.41, 16.66, 16.7, 16.88, 16.95, 16.41, 16.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g9dh1366983749.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,] 16.58 16.340 16.410 16.89 16.87 16.86 NA [2,] 16.60 16.355 16.425 16.90 16.89 16.88 NA [3,] 16.62 16.385 16.470 16.93 16.92 16.88 NA [4,] 16.67 16.455 16.580 16.94 16.95 16.93 NA [5,] 16.69 16.500 16.720 16.95 16.96 16.94 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 16.58807 16.33939 16.3993 16.91176 16.89263 16.85719 NA [2,] 16.65193 16.43061 16.5407 16.94824 16.94737 16.90281 NA $out [1] 16.66 16.65 16.72 16.71 17.03 17.02 $group [1] 2 2 4 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(16.58, 16.6, 16.62, 16.67, 16.69, 16.34, 16.355, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65wtg1366983749.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.1868689 0.47 0.16500 [2,] 0.2161438 0.54 0.27125 [3,] 0.2401262 0.57 0.35000 [4,] 0.2532216 0.61 0.41500 [5,] 0.2601090 0.64 0.44250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.2232148 0.5380725 0.2844347 [2,] 0.2570376 0.6019275 0.4155653 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.186868938028769, 0.216143836451272, 0.240126228870163, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yakk1366983749.ps tmp/1yakk1366983749.png",intern=TRUE)) character(0) > try(system("convert tmp/2p0nc1366983749.ps tmp/2p0nc1366983749.png",intern=TRUE)) character(0) > try(system("convert tmp/3k6m51366983749.ps tmp/3k6m51366983749.png",intern=TRUE)) character(0) > try(system("convert tmp/4ru5o1366983749.ps tmp/4ru5o1366983749.png",intern=TRUE)) character(0) > try(system("convert tmp/5g9dh1366983749.ps tmp/5g9dh1366983749.png",intern=TRUE)) character(0) > try(system("convert tmp/65wtg1366983749.ps tmp/65wtg1366983749.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.012 0.863 4.854