R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(-0.4,0,0.2,-0.6,0.5,-0.3,-1.2,0,0.9,0.5,-0.5,0.1,-0.9,1.1,-0.6,-0.2,0.1,-0.2,3.5,-0.9,-1.3,-0.3,-0.4,1.3,-0.7,0.5,-0.6,0.8,-0.2,0.3,3.8,-1.1,-1.7,0.1,-0.9,1.9,-1.4,1.4,-0.2,0.6,0.5,0.6,3.4,-1.4,-1.6,-1.2,-1.7,1.9,-0.8,1,-0.9,1.1,-0.6,0.6,4.1,-1.1,-2,-1.3,-1.7,1.6,-1.2,1.2,-0.8,0.7,1.2,-0.2,4.4,-1.1,-2.2,-0.7,-1.7,1.6) > 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,] -0.4 -0.9 -0.7 -1.4 -0.8 -1.2 NA [2,] 0.0 1.1 0.5 1.4 1.0 1.2 NA [3,] 0.2 -0.6 -0.6 -0.2 -0.9 -0.8 NA [4,] -0.6 -0.2 0.8 0.6 1.1 0.7 NA [5,] 0.5 0.1 -0.2 0.5 -0.6 1.2 NA [6,] -0.3 -0.2 0.3 0.6 0.6 -0.2 NA [7,] -1.2 3.5 3.8 3.4 4.1 4.4 NA [8,] 0.0 -0.9 -1.1 -1.4 -1.1 -1.1 NA [9,] 0.9 -1.3 -1.7 -1.6 -2.0 -2.2 NA [10,] 0.5 -0.3 0.1 -1.2 -1.3 -0.7 NA [11,] -0.5 -0.4 -0.9 -1.7 -1.7 -1.7 NA [12,] 0.1 1.3 1.9 1.9 1.6 1.6 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/1uy0n1483028604.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/24b6t1483028604.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/3df971483028604.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/4fv5g1483028604.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] [,12] [1,] -1.40 0.00 -0.9 -0.60 -0.6 -0.30 3.40 -1.4 -2.20 -1.3 -1.7 1.3 [2,] -1.20 0.50 -0.8 -0.20 -0.2 -0.20 3.40 -1.1 -2.00 -1.2 -1.7 1.3 [3,] -0.85 1.05 -0.6 0.65 0.3 0.05 3.65 -1.1 -1.65 -0.5 -1.3 1.6 [4,] -0.70 1.20 -0.2 0.80 0.5 0.60 4.10 -0.9 -1.30 0.1 -0.5 1.9 [5,] -0.40 1.40 0.2 1.10 1.2 0.60 4.40 -0.9 -1.30 0.5 -0.4 1.9 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.1725161 0.5984774 -0.9870194 0.004967701 -0.1515226 -0.4660258 3.198477 [2,] -0.5274839 1.5015226 -0.2129806 1.295032299 0.7515226 0.5660258 4.101523 [,8] [,9] [,10] [,11] [,12] [1,] -1.2290065 -2.101523 -1.338542 -2.0740388 1.212981 [2,] -0.9709935 -1.198477 0.338542 -0.5259612 1.987019 $out [1] -1.2 0.0 0.9 0.1 $group [1] 7 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.4, -1.2, -0.85, -0.7, -0.4, 0, 0.5, 1.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5haek1483028604.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,] -1.20 -1.30 -1.70 -1.70 -2.00 -2.20 NA [2,] -0.45 -0.75 -0.80 -1.40 -1.20 -1.15 NA [3,] 0.00 -0.25 -0.05 0.15 -0.70 -0.45 NA [4,] 0.35 0.60 0.65 1.00 1.05 1.20 NA [5,] 0.90 1.30 1.90 3.40 4.10 4.40 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.3648854 -0.8657441 -0.7113547 -0.9446561 -1.7262401 -1.5218508 NA [2,] 0.3648854 0.3657441 0.6113547 1.2446561 0.3262401 0.6218508 NA $out [1] 3.5 3.8 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(-1.2, -0.45, 0, 0.35, 0.9, -1.3, -0.75, -0.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nuea1483028604.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,] 0.3577709 0.90 0.150 [2,] 0.4511777 1.20 0.450 [3,] 0.6268951 1.55 0.575 [4,] 0.6959916 1.80 0.750 [5,] 0.7167054 1.80 1.100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5152339 1.276336 0.438168 [2,] 0.7385563 1.823664 0.711832 $out [1] 2.090933 1.130339 5.600000 3.100000 $group [1] 1 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.357770876399966, 0.451177735243232, 0.626895091266683, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1uy0n1483028604.ps tmp/1uy0n1483028604.png",intern=TRUE)) character(0) > try(system("convert tmp/24b6t1483028604.ps tmp/24b6t1483028604.png",intern=TRUE)) character(0) > try(system("convert tmp/3df971483028604.ps tmp/3df971483028604.png",intern=TRUE)) character(0) > try(system("convert tmp/4fv5g1483028604.ps tmp/4fv5g1483028604.png",intern=TRUE)) character(0) > try(system("convert tmp/5haek1483028604.ps tmp/5haek1483028604.png",intern=TRUE)) character(0) > try(system("convert tmp/6nuea1483028604.ps tmp/6nuea1483028604.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.192 0.178 2.410