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(96.4,96.9,98.1,99.2,100,100.3,100.3,100.8,101.3,101.4,101.9,103.4,105.6,107.5,109,110.5,109.8,109.6,109.6,108.8,109.4,109.1,109,109.2,110.5,112.2,113.2,113.6,113.2,112.2,112.2,113.2,113.8,113.8,113.7,113.9,114,114.3,114.3,112.8,112.3,112.2,112.6,111.9,111.7,111,110.8,111.1,110.5,110.5,109.8,109,109,109.4,108.8,108.4,108.3,108.2,106.8,103.6,101.4,102.8,104.5,104.8,105.8,105.3,104.3,102.5,102.6,102.3,101.8,99.5) > 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,] 96.4 105.6 110.5 114.0 110.5 101.4 NA [2,] 96.9 107.5 112.2 114.3 110.5 102.8 NA [3,] 98.1 109.0 113.2 114.3 109.8 104.5 NA [4,] 99.2 110.5 113.6 112.8 109.0 104.8 NA [5,] 100.0 109.8 113.2 112.3 109.0 105.8 NA [6,] 100.3 109.6 112.2 112.2 109.4 105.3 NA [7,] 100.3 109.6 112.2 112.6 108.8 104.3 NA [8,] 100.8 108.8 113.2 111.9 108.4 102.5 NA [9,] 101.3 109.4 113.8 111.7 108.3 102.6 NA [10,] 101.4 109.1 113.8 111.0 108.2 102.3 NA [11,] 101.9 109.0 113.7 110.8 106.8 101.8 NA [12,] 103.4 109.2 113.9 111.1 103.6 99.5 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/12ca61492783753.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/2rr0c1492783753.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/3s0861492783753.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/4d04e1492783753.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,] 96.40 96.9 98.1 99.20 100.0 100.3 100.3 100.8 101.30 101.40 101.8 [2,] 101.40 102.8 104.5 104.80 105.8 105.3 104.3 102.5 102.60 102.30 101.9 [3,] 108.05 109.0 109.4 109.75 109.4 109.5 109.2 108.6 108.85 108.65 107.9 [4,] 110.50 112.2 113.2 112.80 112.3 112.2 112.2 111.9 111.70 111.00 110.8 [5,] 114.00 114.3 114.3 113.60 113.2 112.2 112.6 113.2 113.80 113.80 113.7 [,12] [1,] 99.5 [2,] 103.4 [3,] 106.4 [4,] 111.1 [5,] 113.9 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.1802 102.9367 103.7882 104.5897 105.2073 105.0493 104.1042 102.5367 [2,] 113.9198 115.0633 115.0118 114.9103 113.5927 113.9507 114.2958 114.6633 [,9] [,10] [,11] [,12] [1,] 102.9802 103.0382 102.1592 101.4333 [2,] 114.7198 114.2618 113.6408 111.3667 $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(96.4, 101.4, 108.05, 110.5, 114, 96.9, 102.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qc8a1492783753.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,] 96.40 108.80 110.50 110.80 106.80 99.50 NA [2,] 98.65 108.90 112.20 111.40 108.25 102.05 NA [3,] 100.30 109.15 113.20 112.25 108.90 102.70 NA [4,] 101.35 109.60 113.75 113.40 109.60 104.65 NA [5,] 103.40 110.50 113.90 114.30 110.50 105.80 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.06851 108.8307 112.493 111.3378 108.2843 101.5141 NA [2,] 101.53149 109.4693 113.907 113.1622 109.5157 103.8859 NA $out [1] 105.6 107.5 103.6 $group [1] 2 2 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(96.4, 98.65, 100.3, 101.35, 103.4, 108.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/604ty1492783753.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.608977 11.90 5.075 [2,] 4.833462 12.35 6.250 [3,] 4.974678 12.85 6.925 [4,] 5.745426 15.30 7.200 [5,] 6.588171 17.60 8.050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.558725 11.50449 6.491699 [2,] 5.390631 14.19551 7.358301 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.60897674833218, 4.83346166138714, 4.97467796727774, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12ca61492783753.ps tmp/12ca61492783753.png",intern=TRUE)) character(0) > try(system("convert tmp/2rr0c1492783753.ps tmp/2rr0c1492783753.png",intern=TRUE)) character(0) > try(system("convert tmp/3s0861492783753.ps tmp/3s0861492783753.png",intern=TRUE)) character(0) > try(system("convert tmp/4d04e1492783753.ps tmp/4d04e1492783753.png",intern=TRUE)) character(0) > try(system("convert tmp/5qc8a1492783753.ps tmp/5qc8a1492783753.png",intern=TRUE)) character(0) > try(system("convert tmp/604ty1492783753.ps tmp/604ty1492783753.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.452 0.442 3.994