R version 3.2.4 (2016-03-10) -- "Very Secure Dishes" Copyright (C) 2016 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(93.41,93,96.61,99.69,101.05,98,97.32,97.83,99.57,97.63,96.68,96.28,99.81,101.43,105.59,108.86,104.01,101.95,101.52,105.61,108.43,105.54,100.11,99.93,99.88,102.71,101.89,101.93,99.49,99.87,100.33,101.5,102.29,97.04,95.71,97.37,96.51,96.33,96.88,97.59,98.96,99.93,101.34,98.04,98.56,96.73,92.36,87.88,79.84,82.91,87.78,89.36,91.86,92.48,93.4,89.97,83.96,82.76,82.97,81.07) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 93.41 99.81 99.88 96.51 79.84 NA [2,] 93.00 101.43 102.71 96.33 82.91 NA [3,] 96.61 105.59 101.89 96.88 87.78 NA [4,] 99.69 108.86 101.93 97.59 89.36 NA [5,] 101.05 104.01 99.49 98.96 91.86 NA [6,] 98.00 101.95 99.87 99.93 92.48 NA [7,] 97.32 101.52 100.33 101.34 93.40 NA [8,] 97.83 105.61 101.50 98.04 89.97 NA [9,] 99.57 108.43 102.29 98.56 83.96 NA [10,] 97.63 105.54 97.04 96.73 82.76 NA [11,] 96.68 100.11 95.71 92.36 82.97 NA [12,] 96.28 99.93 97.37 87.88 81.07 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/187bs1458225230.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/2q1rj1458225230.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/30o291458225230.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/42ma51458225230.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,] 93.41 82.91 96.61 97.59 98.96 98.00 93.40 97.83 98.56 96.73 92.36 [2,] 93.41 93.00 96.61 97.59 98.96 98.00 97.32 97.83 98.56 96.73 92.36 [3,] 96.51 96.33 96.88 99.69 99.49 99.87 100.33 98.04 99.57 97.04 95.71 [4,] 99.81 101.43 101.89 101.93 101.05 99.93 101.34 101.50 102.29 97.63 96.68 [5,] 99.88 102.71 105.59 101.93 104.01 101.95 101.52 105.61 102.29 97.63 100.11 [,12] [1,] 81.07 [2,] 87.88 [3,] 96.28 [4,] 97.37 [5,] 99.93 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.98778 90.37338 93.14917 96.62337 98.01321 98.50627 97.48948 [2,] 101.03222 102.28662 100.61083 102.75663 100.96679 101.23373 103.17052 [,8] [,9] [,10] [,11] [,12] [1,] 95.44679 96.93439 96.40406 92.6575 89.57439 [2,] 100.63321 102.20561 97.67594 98.7625 102.98561 $out [1] 79.84 87.78 108.86 89.36 91.86 92.48 89.97 108.43 83.96 105.54 [11] 82.76 82.97 $group [1] 1 3 4 4 5 6 8 9 9 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.41, 93.41, 96.51, 99.81, 99.88, 82.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58fpv1458225230.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] [1,] 93.000 99.81 95.710 96.330 79.840 NA [2,] 96.445 100.77 98.430 96.420 82.835 NA [3,] 97.475 102.98 100.105 97.235 85.870 NA [4,] 98.785 105.60 101.910 98.760 90.915 NA [5,] 101.050 108.86 102.710 101.340 93.400 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 96.40771 100.777 98.51775 96.16771 82.18466 NA [2,] 98.54229 105.183 101.69225 98.30229 89.55534 NA $out [1] 92.36 87.88 $group [1] 4 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(93, 96.445, 97.475, 98.785, 101.05, 99.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/680oj1458225230.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,] 3.447451 8.120 0.90 [2,] 5.125411 13.895 2.88 [3,] 6.890372 18.335 4.17 [4,] 8.083540 19.920 5.84 [5,] 9.020946 24.470 9.49 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.541149 15.58696 2.819924 [2,] 8.239595 21.08304 5.520076 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.44745123243245, 5.12541067447439, 6.8903721478497, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/187bs1458225230.ps tmp/187bs1458225230.png",intern=TRUE)) character(0) > try(system("convert tmp/2q1rj1458225230.ps tmp/2q1rj1458225230.png",intern=TRUE)) character(0) > try(system("convert tmp/30o291458225230.ps tmp/30o291458225230.png",intern=TRUE)) character(0) > try(system("convert tmp/42ma51458225230.ps tmp/42ma51458225230.png",intern=TRUE)) character(0) > try(system("convert tmp/58fpv1458225230.ps tmp/58fpv1458225230.png",intern=TRUE)) character(0) > try(system("convert tmp/680oj1458225230.ps tmp/680oj1458225230.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.186 0.415 2.619