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(94.94,95.11,95.53,95.89,95.99,95.42,95.42,95.45,95.99,95.99,95.97,95.97,95.97,96.22,95.8,96.02,96.04,96.15,96.15,95.99,96.08,96.29,96.3,96.44,96.44,96.83,96.7,97.06,97.64,97.61,97.61,97.61,97.55,97.58,97.79,97.79,97.79,97.79,98,98.37,98.68,98.89,98.89,98.89,98.88,98.97,99.05,99.05,99,99.03,99.2,100.3,100.79,100.75,100.75,100.17,99.98,99.93,100.04,100.04,100.49,100.71,100.7,101.27,101.07,101.17,100.71,100.59,100.52,100.65,100.62,100.62) > 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,] 94.94 95.97 96.44 97.79 99.00 100.49 NA [2,] 95.11 96.22 96.83 97.79 99.03 100.71 NA [3,] 95.53 95.80 96.70 98.00 99.20 100.70 NA [4,] 95.89 96.02 97.06 98.37 100.30 101.27 NA [5,] 95.99 96.04 97.64 98.68 100.79 101.07 NA [6,] 95.42 96.15 97.61 98.89 100.75 101.17 NA [7,] 95.42 96.15 97.61 98.89 100.75 100.71 NA [8,] 95.45 95.99 97.61 98.89 100.17 100.59 NA [9,] 95.99 96.08 97.55 98.88 99.98 100.52 NA [10,] 95.99 96.29 97.58 98.97 99.93 100.65 NA [11,] 95.97 96.30 97.79 99.05 100.04 100.62 NA [12,] 95.97 96.44 97.79 99.05 100.04 100.62 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/13r3q1447934452.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/2pg3i1447934452.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/32i8p1447934452.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/42ji81447934452.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,] 94.940 95.11 95.53 95.890 95.99 95.42 95.42 95.45 95.990 95.990 [2,] 95.970 96.22 95.80 96.020 96.04 96.15 96.15 95.99 96.080 96.290 [3,] 97.115 97.31 97.35 97.715 98.16 98.25 98.25 98.25 98.215 98.275 [4,] 99.000 99.03 99.20 100.300 100.79 100.75 100.71 100.17 99.980 99.930 [5,] 100.490 100.71 100.70 101.270 101.07 101.17 100.75 100.59 100.520 100.650 [,11] [,12] [1,] 95.97 95.97 [2,] 96.30 96.44 [3,] 98.42 98.42 [4,] 100.04 100.04 [5,] 100.62 100.62 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.16055 95.49746 95.15689 94.95426 95.0961 95.28285 95.30865 [2,] 99.06945 99.12254 99.54311 100.47574 101.2239 101.21715 101.19135 [,8] [,9] [,10] [,11] [,12] [1,] 95.55376 95.69937 95.92708 96.00758 96.09788 [2,] 100.94624 100.73063 100.62292 100.83242 100.74212 $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(94.94, 95.97, 97.115, 99, 100.49, 95.11, 96.22, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52hg01447934452.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,] 94.94 95.800 96.440 97.790 99.000 100.490 NA [2,] 95.42 96.005 96.945 98.185 99.565 100.605 NA [3,] 95.71 96.115 97.595 98.885 100.040 100.675 NA [4,] 95.98 96.255 97.625 98.930 100.525 100.890 NA [5,] 95.99 96.440 97.790 99.050 100.790 101.270 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.45458 96.00097 97.28485 98.5452 99.60214 100.545 NA [2,] 95.96542 96.22903 97.90515 99.2248 100.47786 100.805 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(94.94, 95.42, 95.71, 95.98, 95.99, 95.8, 96.005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6pwi61447934452.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,] 1.903632 4.530 2.34750 [2,] 1.935684 4.655 2.94500 [3,] 2.047289 5.155 3.18875 [4,] 2.238434 5.465 3.63875 [5,] 2.365353 5.750 3.82250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.909203 4.785554 2.872326 [2,] 2.185375 5.524446 3.505174 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.90363249254332, 1.93568439448945, 2.04728894585926, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13r3q1447934452.ps tmp/13r3q1447934452.png",intern=TRUE)) character(0) > try(system("convert tmp/2pg3i1447934452.ps tmp/2pg3i1447934452.png",intern=TRUE)) character(0) > try(system("convert tmp/32i8p1447934452.ps tmp/32i8p1447934452.png",intern=TRUE)) character(0) > try(system("convert tmp/42ji81447934452.ps tmp/42ji81447934452.png",intern=TRUE)) character(0) > try(system("convert tmp/52hg01447934452.ps tmp/52hg01447934452.png",intern=TRUE)) character(0) > try(system("convert tmp/6pwi61447934452.ps tmp/6pwi61447934452.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.069 0.362 2.449