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(98.91,98.15,98.59,98.6,98.7,98.33,98.33,98.6,98.52,99.17,99.49,98.83,98.83,97.39,99.28,98.78,98.75,98.47,98.47,97.82,97.79,97.96,98.21,98.34,98.34,98.49,98.14,98.05,97.77,97.59,97.59,97.67,97.67,97.36,97.31,97.24,97.24,96.89,96.48,96.47,97.13,97.21,97.43,97.98,97.97,98.2,98.67,98.75,98.77,98.72,99.23,99.67,99.76,99.57,99.57,100.21,100.62,101.05,101.42,101.42,101.52,101.87,101.53,101.77,101.76,102.04,102.05,101.9,102.17,102.14,102.09,102.27) > 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,] 98.91 98.83 98.34 97.24 98.77 101.52 NA [2,] 98.15 97.39 98.49 96.89 98.72 101.87 NA [3,] 98.59 99.28 98.14 96.48 99.23 101.53 NA [4,] 98.60 98.78 98.05 96.47 99.67 101.77 NA [5,] 98.70 98.75 97.77 97.13 99.76 101.76 NA [6,] 98.33 98.47 97.59 97.21 99.57 102.04 NA [7,] 98.33 98.47 97.59 97.43 99.57 102.05 NA [8,] 98.60 97.82 97.67 97.98 100.21 101.90 NA [9,] 98.52 97.79 97.67 97.97 100.62 102.17 NA [10,] 99.17 97.96 97.36 98.20 101.05 102.14 NA [11,] 99.49 98.21 97.31 98.67 101.42 102.09 NA [12,] 98.83 98.34 97.24 98.75 101.42 102.27 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/1t1vo1447858375.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/2s03n1447858376.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/3s9v11447858376.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/4qqds1447858376.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,] 98.34 96.89 96.48 96.47 97.130 97.21 97.43 97.67 97.670 97.360 [2,] 98.34 97.39 98.14 98.05 97.770 97.59 97.59 97.82 97.790 97.960 [3,] 98.80 98.32 98.91 98.69 98.725 98.40 98.40 98.29 98.245 98.685 [4,] 98.91 98.72 99.28 99.67 99.760 99.57 99.57 100.21 100.620 101.050 [5,] 98.91 98.72 99.28 101.77 101.760 102.04 102.05 101.90 102.170 102.140 [,11] [,12] [1,] 97.31 97.24 [2,] 98.21 98.34 [3,] 99.08 98.79 [4,] 101.42 101.42 [5,] 102.09 102.27 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.43233 97.46211 98.17466 97.64505 97.44139 97.12284 97.12284 96.74837 [2,] 99.16767 99.17789 99.64534 99.73495 100.00861 99.67716 99.67716 99.83163 [,9] [,10] [,11] [,12] [1,] 96.41956 96.69185 97.00945 96.8033 [2,] 100.07044 100.67815 101.15055 100.7767 $out [1] 97.24 101.52 101.87 101.53 $group [1] 1 1 2 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.34, 98.34, 98.8, 98.91, 98.91, 96.89, 97.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bbd41447858376.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,] 98.150 97.390 97.240 96.470 98.720 101.520 NA [2,] 98.425 97.890 97.475 97.010 99.400 101.765 NA [3,] 98.600 98.405 97.670 97.335 99.715 101.970 NA [4,] 98.870 98.765 98.095 98.090 100.835 102.115 NA [5,] 99.490 99.280 98.490 98.750 101.420 102.270 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.39703 98.00591 97.38721 96.8424 99.06049 101.8104 NA [2,] 98.80297 98.80409 97.95279 97.8276 100.36951 102.1296 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.15, 98.425, 98.6, 98.87, 99.49, 97.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dmiu1447858376.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.410542 4.230 0.44250 [2,] 1.671059 4.560 1.17125 [3,] 1.751947 4.780 1.52000 [4,] 1.861254 5.005 2.29500 [5,] 1.940111 5.300 2.61250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.665198 4.577033 1.00745 [2,] 1.838696 4.982967 2.03255 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.41054244884725, 1.67105949939761, 1.75194710584057, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1t1vo1447858375.ps tmp/1t1vo1447858375.png",intern=TRUE)) character(0) > try(system("convert tmp/2s03n1447858376.ps tmp/2s03n1447858376.png",intern=TRUE)) character(0) > try(system("convert tmp/3s9v11447858376.ps tmp/3s9v11447858376.png",intern=TRUE)) character(0) > try(system("convert tmp/4qqds1447858376.ps tmp/4qqds1447858376.png",intern=TRUE)) character(0) > try(system("convert tmp/5bbd41447858376.ps tmp/5bbd41447858376.png",intern=TRUE)) character(0) > try(system("convert tmp/6dmiu1447858376.ps tmp/6dmiu1447858376.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.082 0.386 2.483