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.43,93.59,95.28,94.95,94.49,94.45,94.35,95.52,96.89,97.54,97.65,97.35,98.2,99.46,100.35,99.72,99.69,99.62,99.77,100.19,100.82,100.36,101.08,100.73,101.51,102.12,102.88,103.47,103.53,103.67,103.68,103.76,103.67,103.01,103.39,103.43,103.4,104.8,105.53,107.45,108.73,109.04,108.75,108.75,108.76,108.41,110.15,109.93,110.6,112.17,113.47,113.35,114.12,115,114.01,113.86,113.83,112.7,111.79,113.77) > 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.43 98.20 101.51 103.40 110.60 NA [2,] 93.59 99.46 102.12 104.80 112.17 NA [3,] 95.28 100.35 102.88 105.53 113.47 NA [4,] 94.95 99.72 103.47 107.45 113.35 NA [5,] 94.49 99.69 103.53 108.73 114.12 NA [6,] 94.45 99.62 103.67 109.04 115.00 NA [7,] 94.35 99.77 103.68 108.75 114.01 NA [8,] 95.52 100.19 103.76 108.75 113.86 NA [9,] 96.89 100.82 103.67 108.76 113.83 NA [10,] 97.54 100.36 103.01 108.41 112.70 NA [11,] 97.65 101.08 103.39 110.15 111.79 NA [12,] 97.35 100.73 103.43 109.93 113.77 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/16ku41493123626.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/26o2o1493123626.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/36mz71493123626.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/468901493123626.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.43 93.59 95.28 94.95 94.49 94.45 94.35 95.52 96.89 97.54 [2,] 98.20 99.46 100.35 99.72 99.69 99.62 99.77 100.19 100.82 100.36 [3,] 101.51 102.12 102.88 103.47 103.53 103.67 103.68 103.76 103.67 103.01 [4,] 103.40 104.80 105.53 107.45 108.73 109.04 108.75 108.75 108.76 108.41 [5,] 110.60 112.17 105.53 113.35 114.12 115.00 114.01 113.86 113.83 112.70 [,11] [,12] [1,] 97.65 97.35 [2,] 101.08 100.73 [3,] 103.39 103.43 [4,] 110.15 109.93 [5,] 111.79 113.77 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.83569 98.34677 99.21983 98.008 97.14236 97.01385 97.33475 [2,] 105.18431 105.89323 106.54017 108.932 109.91764 110.32615 110.02525 [,8] [,9] [,10] [,11] [,12] [1,] 97.71153 98.05962 97.32189 96.98116 96.9293 [2,] 109.80847 109.28038 108.69811 109.79884 109.9307 $out [1] 113.47 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.43, 98.2, 101.51, 103.4, 110.6, 93.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dtvo1493123626.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.430 99.460 102.120 103.40 110.600 NA [2,] 94.400 99.655 102.945 106.49 112.435 NA [3,] 95.115 99.980 103.450 108.74 113.620 NA [4,] 97.120 100.545 103.670 108.90 113.935 NA [5,] 97.650 101.080 103.760 110.15 115.000 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 93.87439 99.57407 103.1193 107.6408 112.9358 NA [2,] 96.35561 100.38593 103.7807 109.8392 114.3042 NA $out [1] 98.20 101.51 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(93.43, 94.4, 95.115, 97.12, 97.65, 99.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jlc41493123626.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,] 6.008970 14.140 5.180 [2,] 6.511162 16.680 6.535 [3,] 6.790789 18.265 8.305 [4,] 7.405728 19.105 9.055 [5,] 8.004120 20.550 9.420 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.382771 17.15894 7.155611 [2,] 7.198807 19.37106 9.454389 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.008969961649, 6.51116206448659, 6.79078906811522, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16ku41493123626.ps tmp/16ku41493123626.png",intern=TRUE)) character(0) > try(system("convert tmp/26o2o1493123626.ps tmp/26o2o1493123626.png",intern=TRUE)) character(0) > try(system("convert tmp/36mz71493123626.ps tmp/36mz71493123626.png",intern=TRUE)) character(0) > try(system("convert tmp/468901493123626.ps tmp/468901493123626.png",intern=TRUE)) character(0) > try(system("convert tmp/5dtvo1493123626.ps tmp/5dtvo1493123626.png",intern=TRUE)) character(0) > try(system("convert tmp/6jlc41493123626.ps tmp/6jlc41493123626.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.515 0.296 2.880