R version 3.2.4 Revised (2016-03-16 r70336) -- "Very Secure Dishes" 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(89.8,89.2,89.9,88.9,84,86.3,89.3,90.6,88.3,91.6,95.4,96.8,92.5,93.6,93.8,92.7,88.3,90.4,91.2,91.5,88.9,88.6,89.1,89.4,86.7,89.8,90.9,91.4,90.2,92.2,94,95.8,95.1,96.2,96.8,97.1,96.5,97.2,97.8,99.9,101.2,103.3,104.5,100.8,95,93.4,93.1,94.9,96.9,100.9,100.2,101.8,105.4,106.4,105.6,107.5,109.5,108.6,109.2,110.3,110.3,107.9,107.7,108.1,108,105.9,105.9,104.7) > 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] 68 > (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] 6 6 6 6 6 6 6 6 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 89.8 92.5 86.7 96.5 96.9 110.3 [2,] 89.2 93.6 89.8 97.2 100.9 107.9 [3,] 89.9 93.8 90.9 97.8 100.2 107.7 [4,] 88.9 92.7 91.4 99.9 101.8 108.1 [5,] 84.0 88.3 90.2 101.2 105.4 108.0 [6,] 86.3 90.4 92.2 103.3 106.4 105.9 [7,] 89.3 91.2 94.0 104.5 105.6 105.9 [8,] 90.6 91.5 95.8 100.8 107.5 104.7 [9,] 88.3 88.9 95.1 95.0 109.5 NA [10,] 91.6 88.6 96.2 93.4 108.6 NA [11,] 95.4 89.1 96.8 93.1 109.2 NA [12,] 96.8 89.4 97.1 94.9 110.3 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/116tz1458679852.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/22zfa1458679852.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/3ta9d1458679852.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/4sikd1458679852.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,] 86.7 89.2 89.9 88.9 84.0 86.30 89.30 90.6 88.3 88.6 89.1 94.9 [2,] 89.8 89.8 90.9 91.4 88.3 90.40 91.20 91.5 88.9 91.6 93.1 94.9 [3,] 94.5 95.4 95.8 96.3 95.7 97.75 99.25 98.3 95.0 93.4 95.4 96.8 [4,] 96.9 100.9 100.2 101.8 105.4 105.90 105.60 104.7 95.1 96.2 96.8 97.1 [5,] 96.9 107.9 107.7 108.1 108.0 106.40 105.90 107.5 95.1 96.2 96.8 97.1 $n [1] 6 6 6 6 6 6 6 6 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.92027 88.24014 89.8012 89.59166 84.66995 87.752 89.96153 [2,] 99.07973 102.55986 101.7988 103.00834 106.73005 107.748 108.53847 [,8] [,9] [,10] [,11] [,12] [1,] 89.78557 90.6191 90.14965 92.78559 95.24549 [2,] 106.81443 99.3809 96.65035 98.01441 98.35451 $out [1] 110.3 109.5 108.6 109.2 89.4 110.3 $group [1] 1 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(86.7, 89.8, 94.5, 96.9, 96.9, 89.2, 89.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ca331458679852.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,] 86.30 88.3 86.70 93.10 96.90 104.70 [2,] 88.60 89.0 90.55 94.95 101.35 105.90 [3,] 89.55 90.8 93.10 97.50 106.00 107.80 [4,] 91.10 92.6 96.00 101.00 108.90 108.05 [5,] 91.60 93.8 97.10 104.50 110.30 110.30 $n [1] 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 88.40973 89.15802 90.61422 94.74055 102.5564 106.599 [2,] 90.69027 92.44198 95.58578 100.25945 109.4436 109.001 $out [1] 84.0 95.4 96.8 $group [1] 1 1 1 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(86.3, 88.6, 89.55, 91.1, 91.6, 88.3, 89, 90.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z3v91458679852.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.674554 16.60 2.2000 [2,] 7.254642 18.25 5.4000 [3,] 7.712204 20.05 8.6000 [4,] 8.398545 21.05 12.2875 [5,] 9.961208 24.00 15.5750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.190462 18.7729 5.458565 [2,] 8.233945 21.3271 11.741435 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.67455366797411, 7.25464189445809, 7.71220376398531, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/116tz1458679852.ps tmp/116tz1458679852.png",intern=TRUE)) character(0) > try(system("convert tmp/22zfa1458679852.ps tmp/22zfa1458679852.png",intern=TRUE)) character(0) > try(system("convert tmp/3ta9d1458679852.ps tmp/3ta9d1458679852.png",intern=TRUE)) character(0) > try(system("convert tmp/4sikd1458679852.ps tmp/4sikd1458679852.png",intern=TRUE)) character(0) > try(system("convert tmp/5ca331458679852.ps tmp/5ca331458679852.png",intern=TRUE)) character(0) > try(system("convert tmp/6z3v91458679852.ps tmp/6z3v91458679852.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.169 0.418 2.612