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(163.93,164.28,164.58,165.97,166.3,166.27,166.27,166.44,166.26,166.64,166.07,166.19,166.19,166.19,166.35,166.52,167.17,167.16,167.16,167.16,167.39,168.46,168.55,168.58,168.58,169.21,169.29,169.24,169.53,169.57,169.57,169.67,170.04,170.39,170.57,170.48,170.48,170.48,170.49,170.72,171.11,171.07,171.07,171.07,171.05,172.28,172.74,172.86,172.86,173.24,173.2,173.38,172.89,172.98,172.98,172.69,172.77,172.65,172.3,172.17,172.17,173.07,173.27,173.05,173.41,173.37,173.37,173.08,173.97,175.23,174.9,174.83) > 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,] 163.93 166.19 168.58 170.48 172.86 172.17 NA [2,] 164.28 166.19 169.21 170.48 173.24 173.07 NA [3,] 164.58 166.35 169.29 170.49 173.20 173.27 NA [4,] 165.97 166.52 169.24 170.72 173.38 173.05 NA [5,] 166.30 167.17 169.53 171.11 172.89 173.41 NA [6,] 166.27 167.16 169.57 171.07 172.98 173.37 NA [7,] 166.27 167.16 169.57 171.07 172.98 173.37 NA [8,] 166.44 167.16 169.67 171.07 172.69 173.08 NA [9,] 166.26 167.39 170.04 171.05 172.77 173.97 NA [10,] 166.64 168.46 170.39 172.28 172.65 175.23 NA [11,] 166.07 168.55 170.57 172.74 172.30 174.90 NA [12,] 166.19 168.58 170.48 172.86 172.17 174.83 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/10g801366645290.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/2ulko1366645290.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/3g17g1366645290.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/45cf41366645290.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] [1,] 163.93 164.280 164.58 165.97 166.30 166.27 166.27 166.44 166.260 166.640 [2,] 166.19 166.190 166.35 166.52 167.17 167.16 167.16 167.16 167.390 168.460 [3,] 169.53 169.845 169.89 169.98 170.32 170.32 170.32 170.37 170.545 171.335 [4,] 172.17 173.070 173.20 173.05 172.89 172.98 172.98 172.69 172.770 172.650 [5,] 172.86 173.240 173.27 173.38 173.41 173.37 173.37 173.08 173.970 175.230 [,11] [,12] [1,] 166.070 166.190 [2,] 168.550 168.580 [3,] 171.435 171.325 [4,] 172.740 172.860 [5,] 174.900 174.830 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 165.6727 165.4072 165.4715 165.7679 166.6304 166.5659 166.5659 166.803 [2,] 173.3873 174.2828 174.3085 174.1921 174.0096 174.0741 174.0741 173.937 [,9] [,10] [,11] [,12] [1,] 167.0747 168.6323 168.7323 168.5643 [2,] 174.0153 174.0377 174.1377 174.0857 $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(163.93, 166.19, 169.53, 172.17, 172.86, 164.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5o0i41366645290.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,] 163.930 166.190 168.580 170.480 172.170 172.170 NA [2,] 165.275 166.435 169.265 170.605 172.670 173.075 NA [3,] 166.225 167.160 169.570 171.070 172.875 173.370 NA [4,] 166.285 167.925 170.215 171.695 173.090 174.400 NA [5,] 166.640 168.580 170.570 172.860 173.380 175.230 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 165.7643 166.4804 169.1367 170.5728 172.6834 172.7657 NA [2,] 166.6857 167.8396 170.0033 171.5672 173.0666 173.9743 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(163.93, 165.275, 166.225, 166.285, 166.64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6sj081366645290.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,] 2.782570 6.640 3.57500 [2,] 2.950125 7.105 3.96000 [3,] 3.109568 8.150 4.71250 [4,] 3.330898 8.760 5.11375 [5,] 3.631382 8.960 5.47750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.935896 7.395143 4.186267 [2,] 3.283241 8.904857 5.238733 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.78257015485085, 2.95012542106263, 3.10956831767578, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10g801366645290.ps tmp/10g801366645290.png",intern=TRUE)) character(0) > try(system("convert tmp/2ulko1366645290.ps tmp/2ulko1366645290.png",intern=TRUE)) character(0) > try(system("convert tmp/3g17g1366645290.ps tmp/3g17g1366645290.png",intern=TRUE)) character(0) > try(system("convert tmp/45cf41366645290.ps tmp/45cf41366645290.png",intern=TRUE)) character(0) > try(system("convert tmp/5o0i41366645290.ps tmp/5o0i41366645290.png",intern=TRUE)) character(0) > try(system("convert tmp/6sj081366645290.ps tmp/6sj081366645290.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.603 0.450 3.046