R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(82.75,83.4,84.12,83.88,83.61,83.58,83.58,83.27,83.59,83.64,83.72,83.88,83.61,85.36,87.2,88.28,88.64,88.67,88.34,89.21,89.55,89.65,88.43,91.15,94.11,96.78,97.94,97.57,96.48,96.18,95,93.84,95.54,94.06,93.92,92.55,93.88,92.19,91.42,91.39,89.12,90.27,91.76,95.68,97.54,98.47,100.11,99.9,101.11,98.86,102.71,102.02,100.61,100.62,99.51,98.63,97.44,96.5,94.3,92.92,96.07,95,93.27,91.94,91.62,91.01,90.62,97.72,99.09,99.72,100.22,99.15,101.16,101.8,103.31,101.19,99.09,95.91,94.56,95.76,100.36,102.67,103.58,100.89,103.46,104.86,104.88,104.46,103.83,101,99.36,96.71,95.23,95.62,95.8,94.79,95.39,94.9,94.84,94.68,94.17,94.1,93.84,94.2,97.76,98.26,99.63,98.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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 82.75 83.61 94.11 93.88 101.11 96.07 101.16 103.46 95.39 NA [2,] 83.40 85.36 96.78 92.19 98.86 95.00 101.80 104.86 94.90 NA [3,] 84.12 87.20 97.94 91.42 102.71 93.27 103.31 104.88 94.84 NA [4,] 83.88 88.28 97.57 91.39 102.02 91.94 101.19 104.46 94.68 NA [5,] 83.61 88.64 96.48 89.12 100.61 91.62 99.09 103.83 94.17 NA [6,] 83.58 88.67 96.18 90.27 100.62 91.01 95.91 101.00 94.10 NA [7,] 83.58 88.34 95.00 91.76 99.51 90.62 94.56 99.36 93.84 NA [8,] 83.27 89.21 93.84 95.68 98.63 97.72 95.76 96.71 94.20 NA [9,] 83.59 89.55 95.54 97.54 97.44 99.09 100.36 95.23 97.76 NA [10,] 83.64 89.65 94.06 98.47 96.50 99.72 102.67 95.62 98.26 NA [11,] 83.72 88.43 93.92 100.11 94.30 100.22 103.58 95.80 99.63 NA [12,] 83.88 91.15 92.55 99.90 92.92 99.15 100.89 94.79 98.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/wessaorg/rcomp/tmp/1rg7b1447842794.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/2jfac1447842794.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/345ci1447842794.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/4fsvj1447842794.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,] 83.61 83.40 84.12 83.88 83.61 83.58 88.34 93.84 95.23 89.65 88.43 [2,] 93.88 92.19 91.42 91.39 89.12 90.27 90.62 93.84 95.23 94.06 93.92 [3,] 95.39 95.00 94.84 94.68 94.17 94.10 93.84 95.68 97.44 96.50 95.80 [4,] 101.11 98.86 102.71 101.19 99.09 96.18 95.00 96.71 97.76 98.47 100.11 [5,] 103.46 104.86 104.88 104.46 103.83 101.00 99.51 98.63 100.36 102.67 103.58 [,12] [1,] 83.88 [2,] 92.55 [3,] 94.79 [4,] 99.15 [5,] 100.89 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.5822 91.48713 88.89393 89.51867 88.91913 90.9874 91.5332 94.16847 [2,] 99.1978 98.51287 100.78607 99.84133 99.42087 97.2126 96.1468 97.19153 [,9] [,10] [,11] [,12] [1,] 96.10753 94.1774 92.53993 91.314 [2,] 98.77247 98.8226 99.06007 98.266 $out [1] 82.75 83.58 83.27 89.21 83.59 89.55 83.64 83.72 $group [1] 1 7 8 8 9 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(83.61, 93.88, 95.39, 101.11, 103.46, 83.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/522gx1447842794.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] [,9] [,10] [1,] 83.27 85.360 92.55 89.120 92.920 90.620 94.560 94.790 93.840 NA [2,] 83.49 87.740 93.99 91.405 96.970 91.780 97.500 95.710 94.185 NA [3,] 83.60 88.535 95.27 93.035 99.185 95.535 101.025 100.180 94.870 NA [4,] 83.80 89.380 96.63 98.005 100.865 99.120 102.235 104.145 98.010 NA [5,] 84.12 91.150 97.94 100.110 102.710 100.220 103.580 104.880 99.630 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 83.45861 87.78698 94.06588 90.0247 97.40846 92.18718 98.86533 96.33274 [2,] 83.74139 89.28302 96.47412 96.0453 100.96154 98.88282 103.18467 104.02726 [,9] [,10] [1,] 93.12539 NA [2,] 96.61461 NA $out [1] 82.75 83.61 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(83.27, 83.49, 83.6, 83.8, 84.12, 85.36, 87.74, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63pv11447842794.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,] 4.829276 15.360 2.530 [2,] 5.386381 16.890 4.395 [3,] 6.025338 19.445 6.395 [4,] 6.943421 20.645 8.515 [5,] 7.319983 21.460 11.290 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.315161 17.73232 4.51584 [2,] 6.735515 21.15768 8.27416 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.82927645834354, 5.38638077870552, 6.02533784128122, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rg7b1447842794.ps tmp/1rg7b1447842794.png",intern=TRUE)) character(0) > try(system("convert tmp/2jfac1447842794.ps tmp/2jfac1447842794.png",intern=TRUE)) character(0) > try(system("convert tmp/345ci1447842794.ps tmp/345ci1447842794.png",intern=TRUE)) character(0) > try(system("convert tmp/4fsvj1447842794.ps tmp/4fsvj1447842794.png",intern=TRUE)) character(0) > try(system("convert tmp/522gx1447842794.ps tmp/522gx1447842794.png",intern=TRUE)) character(0) > try(system("convert tmp/63pv11447842794.ps tmp/63pv11447842794.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.122 0.332 2.473