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(88.83,89.01,88.21,87.78,87.93,88.11,88.2,88.12,88.38,87.65,88.24,87.83,87.75,87.88,87.61,88.05,87.77,87.79,88.34,88.48,88.75,87.95,89.09,88.73,89.24,89.77,89.84,90.97,91.53,92.2,92.27,92.42,92.07,91.73,92.1,91.68,92.63,93.02,92.66,93.23,93.79,93.92,94.04,94.23,94.37,94.29,94.38,94,94.11,93.98,93.42,93.3,93.32,93.75,93.82,94.06,94.09,93.64,93.9,93.18,93.54,93.55,93.8,93.39,93.27,93.58,93.47,93.75,93.3,92.65,92.96,92.84,93.29,93.57,93.54,94.38,93.98,94.48,94.63,95.45,95.59,94.76,95.66,95.03,96.45,97.15,97.5,98.54,99.54,100.33,100.28,101.81,101.91,101.92,102.68,101.9,102.14,102.3,102.06,102.4,102.99,102.99,102.83,103.01,102.6,102.18,102.6,101.44) > 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,] 88.83 87.75 89.24 92.63 94.11 93.54 93.29 96.45 102.14 NA [2,] 89.01 87.88 89.77 93.02 93.98 93.55 93.57 97.15 102.30 NA [3,] 88.21 87.61 89.84 92.66 93.42 93.80 93.54 97.50 102.06 NA [4,] 87.78 88.05 90.97 93.23 93.30 93.39 94.38 98.54 102.40 NA [5,] 87.93 87.77 91.53 93.79 93.32 93.27 93.98 99.54 102.99 NA [6,] 88.11 87.79 92.20 93.92 93.75 93.58 94.48 100.33 102.99 NA [7,] 88.20 88.34 92.27 94.04 93.82 93.47 94.63 100.28 102.83 NA [8,] 88.12 88.48 92.42 94.23 94.06 93.75 95.45 101.81 103.01 NA [9,] 88.38 88.75 92.07 94.37 94.09 93.30 95.59 101.91 102.60 NA [10,] 87.65 87.95 91.73 94.29 93.64 92.65 94.76 101.92 102.18 NA [11,] 88.24 89.09 92.10 94.38 93.90 92.96 95.66 102.68 102.60 NA [12,] 87.83 88.73 91.68 94.00 93.18 92.84 95.03 101.90 101.44 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/15b901448213242.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/2wi521448213242.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/3eszb1448213242.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/4dbjs1448213242.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,] 87.75 87.88 87.61 87.78 87.93 92.20 92.27 88.12 88.38 87.65 88.24 87.83 [2,] 89.24 89.77 89.84 90.97 91.53 92.20 92.27 92.42 92.07 91.73 92.10 91.68 [3,] 93.29 93.55 93.42 93.30 93.32 93.75 93.82 94.06 94.09 93.64 93.90 93.18 [4,] 94.11 93.98 93.80 94.38 93.98 94.48 94.63 95.45 95.59 94.76 95.66 95.03 [5,] 96.45 97.15 97.50 98.54 93.98 94.48 94.63 95.45 95.59 94.76 95.66 95.03 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 90.72513 91.33273 91.3344 91.50407 92.02967 92.5492 92.57707 92.4642 [2,] 95.85487 95.76727 95.5056 95.09593 94.61033 94.9508 95.06293 95.6558 [,9] [,10] [,11] [,12] [1,] 92.23613 92.0442 92.02507 91.41567 [2,] 95.94387 95.2358 95.77493 94.94433 $out [1] 102.14 102.30 102.06 102.40 87.77 99.54 102.99 88.11 87.79 100.33 [11] 102.99 88.20 88.34 100.28 102.83 101.81 103.01 101.91 102.60 101.92 [21] 102.18 102.68 102.60 101.90 101.44 $group [1] 1 2 3 4 5 5 5 6 6 6 6 7 7 7 7 8 8 9 9 10 10 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(87.75, 89.24, 93.29, 94.11, 96.45, 87.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5oof41448213242.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,] 87.65 87.610 89.240 92.630 93.180 92.650 93.290 96.450 101.44 NA [2,] 87.88 87.780 90.405 93.125 93.370 93.115 93.775 98.020 102.16 NA [3,] 88.16 88.000 91.705 93.960 93.785 93.430 94.555 100.305 102.50 NA [4,] 88.31 88.605 92.150 94.260 94.020 93.565 95.240 101.905 102.91 NA [5,] 88.83 89.090 92.420 94.380 94.110 93.800 95.660 102.680 103.01 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 87.96387 87.62371 90.90909 93.44232 93.48853 93.22475 93.8868 98.53303 [2,] 88.35613 88.37629 92.50091 94.47768 94.08147 93.63525 95.2232 102.07697 [,9] [,10] [1,] 102.1579 NA [2,] 102.8421 NA $out [1] 89.01 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(87.65, 87.88, 88.16, 88.31, 88.83, 87.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xdcg1448213242.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.418273 14.070 2.28 [2,] 4.606246 14.405 2.74 [3,] 4.911325 14.490 3.38 [4,] 5.052538 14.760 3.76 [5,] 5.175237 15.220 4.87 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.707768 14.32808 2.914771 [2,] 5.114881 14.65192 3.845229 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.41827297833793, 4.60624646725816, 4.91132468760472, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15b901448213242.ps tmp/15b901448213242.png",intern=TRUE)) character(0) > try(system("convert tmp/2wi521448213242.ps tmp/2wi521448213242.png",intern=TRUE)) character(0) > try(system("convert tmp/3eszb1448213242.ps tmp/3eszb1448213242.png",intern=TRUE)) character(0) > try(system("convert tmp/4dbjs1448213242.ps tmp/4dbjs1448213242.png",intern=TRUE)) character(0) > try(system("convert tmp/5oof41448213242.ps tmp/5oof41448213242.png",intern=TRUE)) character(0) > try(system("convert tmp/6xdcg1448213242.ps tmp/6xdcg1448213242.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.048 0.452 2.522