R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(97.91,98.51,98.54,98.52,98.66,98.53,98.71,98.92,98.96,99.25,99.32,99.41,99.36,99.58,99.77,99.77,100.03,100.2,100.24,100.1,100.03,100.18,100.29,100.41,100.6,100.75,100.79,100.44,100.29,100.34,100.46,100.12,100.06,100.28,100.28,100.4,100.61,100.89,100.73,101.12,101.16,101.33,101.37,101.61,101.85,102.27,102.28,102.23,102.42,102.53,103.47,103.53,103.77,103.74,103.93,103.97,103.68,103.86,103.97,104.05) > 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,] 97.91 99.36 100.60 100.61 102.42 NA [2,] 98.51 99.58 100.75 100.89 102.53 NA [3,] 98.54 99.77 100.79 100.73 103.47 NA [4,] 98.52 99.77 100.44 101.12 103.53 NA [5,] 98.66 100.03 100.29 101.16 103.77 NA [6,] 98.53 100.20 100.34 101.33 103.74 NA [7,] 98.71 100.24 100.46 101.37 103.93 NA [8,] 98.92 100.10 100.12 101.61 103.97 NA [9,] 98.96 100.03 100.06 101.85 103.68 NA [10,] 99.25 100.18 100.28 102.27 103.86 NA [11,] 99.32 100.29 100.28 102.28 103.97 NA [12,] 99.41 100.41 100.40 102.23 104.05 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/1l4u81492865318.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/28sj91492865318.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/3zfqr1492865318.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/4zkg81492865318.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,] 97.91 98.51 98.54 98.52 98.66 98.53 98.71 98.92 98.96 99.25 [2,] 99.36 99.58 99.77 99.77 100.03 100.20 100.24 100.10 100.03 100.18 [3,] 100.60 100.75 100.73 100.44 100.29 100.34 100.46 100.12 100.06 100.28 [4,] 100.61 100.89 100.79 101.12 101.16 101.33 101.37 101.61 101.85 102.27 [5,] 102.42 102.53 100.79 101.12 101.16 101.33 101.37 101.61 103.68 103.86 [,11] [,12] [1,] 99.32 99.41 [2,] 100.28 100.40 [3,] 100.29 100.41 [4,] 102.28 102.23 [5,] 103.97 104.05 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.71675 99.82436 100.0093 99.48609 99.49154 99.54154 99.66154 [2,] 101.48325 101.67564 101.4507 101.39391 101.08846 101.13846 101.25846 [,8] [,9] [,10] [,11] [,12] [1,] 99.05304 98.77399 98.80321 98.87681 99.11693 [2,] 101.18696 101.34601 101.75679 101.70319 101.70307 $out [1] 103.47 103.53 103.77 103.74 103.93 103.97 $group [1] 3 4 5 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(97.91, 99.36, 100.6, 100.61, 102.42, 98.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sdkx1492865318.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,] 97.910 99.360 100.06 100.610 103.470 NA [2,] 98.525 99.770 100.28 101.005 103.500 NA [3,] 98.685 100.065 100.37 101.350 103.755 NA [4,] 99.105 100.220 100.53 102.040 103.950 NA [5,] 99.410 100.410 100.79 102.280 104.050 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 98.42046 99.85975 100.256 100.8779 103.5498 NA [2,] 98.94954 100.27025 100.484 101.8221 103.9602 NA $out [1] 102.42 102.53 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.91, 98.525, 98.685, 99.105, 99.41, 99.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6shqh1492865318.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.816893 4.020 1.020 [2,] 1.830455 4.625 1.130 [3,] 1.863196 4.825 1.330 [4,] 1.904795 5.080 1.825 [5,] 1.942171 5.220 2.090 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.829289 4.617471 1.013006 [2,] 1.897103 5.032529 1.646994 $out [1] 1.673634 1.510834 $group [1] 1 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.81689295226769, 1.8304551528826, 1.86319575714196, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1l4u81492865318.ps tmp/1l4u81492865318.png",intern=TRUE)) character(0) > try(system("convert tmp/28sj91492865318.ps tmp/28sj91492865318.png",intern=TRUE)) character(0) > try(system("convert tmp/3zfqr1492865318.ps tmp/3zfqr1492865318.png",intern=TRUE)) character(0) > try(system("convert tmp/4zkg81492865318.ps tmp/4zkg81492865318.png",intern=TRUE)) character(0) > try(system("convert tmp/5sdkx1492865318.ps tmp/5sdkx1492865318.png",intern=TRUE)) character(0) > try(system("convert tmp/6shqh1492865318.ps tmp/6shqh1492865318.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.355 0.228 2.623