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(93.09,93.02,93.23,92.7,92.68,93.11,93.02,93.29,93.2,92.86,93.04,92.8,93.11,93.42,94.01,94.47,94.07,94.33,94.43,95.37,95.83,95.46,96,95.35,96.85,97.84,98.38,98.9,99.51,99.95,99.93,101.4,101.7,101.65,102.33,101.56,101.91,102.29,102.44,102.84,103.2,103.23,103.16,103.31,103.04,102.57,102.88,101.91,102.59,103.27,103.59,104.35,104.6,105.08,104.93,105.15,104.67,104.55,109.82,109.25) > 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.09 93.11 96.85 101.91 102.59 NA [2,] 93.02 93.42 97.84 102.29 103.27 NA [3,] 93.23 94.01 98.38 102.44 103.59 NA [4,] 92.70 94.47 98.90 102.84 104.35 NA [5,] 92.68 94.07 99.51 103.20 104.60 NA [6,] 93.11 94.33 99.95 103.23 105.08 NA [7,] 93.02 94.43 99.93 103.16 104.93 NA [8,] 93.29 95.37 101.40 103.31 105.15 NA [9,] 93.20 95.83 101.70 103.04 104.67 NA [10,] 92.86 95.46 101.65 102.57 104.55 NA [11,] 93.04 96.00 102.33 102.88 109.82 NA [12,] 92.80 95.35 101.56 101.91 109.25 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/1r3qf1493146385.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/2vxyt1493146385.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/3z6cl1493146385.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/4if9i1493146385.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,] 93.09 93.02 93.23 92.70 92.68 93.11 93.02 93.29 93.20 92.86 [2,] 93.11 93.42 94.01 94.47 94.07 94.33 94.43 95.37 95.83 95.46 [3,] 96.85 97.84 98.38 98.90 99.51 99.95 99.93 101.40 101.70 101.65 [4,] 101.91 102.29 102.44 102.84 103.20 103.23 103.16 103.31 103.04 102.57 [5,] 102.59 103.27 103.59 104.35 104.60 105.08 104.93 105.15 104.67 104.55 [,11] [,12] [1,] 93.04 92.80 [2,] 96.00 95.35 [3,] 102.33 101.56 [4,] 102.88 101.91 [5,] 109.82 109.25 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.63194 91.57248 92.42338 92.98578 93.05876 93.66128 93.7614 [2,] 103.06806 104.10752 104.33662 104.81422 105.96124 106.23872 106.0986 [,8] [,9] [,10] [,11] [,12] [1,] 95.78962 96.60543 96.62609 97.46861 96.92472 [2,] 107.01038 106.79457 106.67391 107.19139 106.19528 $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(93.09, 93.11, 96.85, 101.91, 102.59, 93.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z00o1493146385.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,] 92.680 93.110 96.850 101.910 102.590 NA [2,] 92.830 94.040 98.640 102.365 103.970 NA [3,] 93.030 94.450 99.940 102.860 104.635 NA [4,] 93.155 95.415 101.605 103.180 105.115 NA [5,] 93.290 96.000 102.330 103.310 105.150 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.88177 93.82285 98.58764 102.4883 104.1128 NA [2,] 93.17823 95.07715 101.29236 103.2317 105.1572 NA $out [1] 109.82 109.25 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.68, 92.83, 93.03, 93.155, 93.29, 93.11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6scgd1493146385.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.596151 9.500 6.560 [2,] 4.860844 10.915 7.160 [3,] 5.104381 11.775 8.400 [4,] 5.309119 11.945 8.835 [5,] 5.322844 11.970 9.130 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.899920 11.30521 7.636021 [2,] 5.308842 12.24479 9.163979 $out [1] 6.543782 6.421747 16.780000 16.450000 $group [1] 1 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.59615056324311, 4.86084413850068, 5.10438089865759, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r3qf1493146385.ps tmp/1r3qf1493146385.png",intern=TRUE)) character(0) > try(system("convert tmp/2vxyt1493146385.ps tmp/2vxyt1493146385.png",intern=TRUE)) character(0) > try(system("convert tmp/3z6cl1493146385.ps tmp/3z6cl1493146385.png",intern=TRUE)) character(0) > try(system("convert tmp/4if9i1493146385.ps tmp/4if9i1493146385.png",intern=TRUE)) character(0) > try(system("convert tmp/5z00o1493146385.ps tmp/5z00o1493146385.png",intern=TRUE)) character(0) > try(system("convert tmp/6scgd1493146385.ps tmp/6scgd1493146385.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.768 0.475 4.746