R version 3.2.4 (2016-03-10) -- "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(110.27,110.91,110.27,109.41,111.47,110.77,110.83,110.52,110.44,109.99,110.55,109.99,111.2,111.81,110.36,111.24,112.6,111.75,112.49,111.94,113.22,112.85,114.37,113.68,118,118.27,119.2,117.98,117.59,117.41,118.31,118.4,117.92,118.94,118.81,117.44,120.21,119.74,118.79,118.19,119.16,118.88,119.59,119.44,119.84,119.31,118.15,118.23,119.89,118.83,118.95,119.86,119.07,119.52,119.92,119.68,119.81,120.09,119.98,118.96) > 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,] 110.27 111.20 118.00 120.21 119.89 NA [2,] 110.91 111.81 118.27 119.74 118.83 NA [3,] 110.27 110.36 119.20 118.79 118.95 NA [4,] 109.41 111.24 117.98 118.19 119.86 NA [5,] 111.47 112.60 117.59 119.16 119.07 NA [6,] 110.77 111.75 117.41 118.88 119.52 NA [7,] 110.83 112.49 118.31 119.59 119.92 NA [8,] 110.52 111.94 118.40 119.44 119.68 NA [9,] 110.44 113.22 117.92 119.84 119.81 NA [10,] 109.99 112.85 118.94 119.31 120.09 NA [11,] 110.55 114.37 118.81 118.15 119.98 NA [12,] 109.99 113.68 117.44 118.23 118.96 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/1qx771458419532.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/23izz1458419532.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/3f2at1458419532.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/4t55e1458419532.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,] 110.27 110.91 110.27 109.41 111.47 110.77 110.83 110.52 110.44 109.99 [2,] 111.20 111.81 110.36 111.24 112.60 111.75 112.49 111.94 113.22 112.85 [3,] 118.00 118.27 118.79 117.98 117.59 117.41 118.31 118.40 117.92 118.94 [4,] 119.89 118.83 118.95 118.19 119.07 118.88 119.59 119.44 119.81 119.31 [5,] 120.21 119.74 119.20 119.86 119.16 119.52 119.92 119.68 119.84 120.09 [,11] [,12] [1,] 110.55 109.99 [2,] 114.37 113.68 [3,] 118.15 117.44 [4,] 118.81 118.23 [5,] 119.98 118.96 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 111.8597 113.3097 112.7203 113.0691 113.0183 112.372 113.2932 113.1005 [2,] 124.1403 123.2303 124.8597 122.8909 122.1617 122.448 123.3268 123.6995 [,9] [,10] [,11] [,12] [1,] 113.2635 114.3754 115.0127 114.225 [2,] 122.5765 123.5046 121.2873 120.655 $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(110.27, 111.2, 118, 119.89, 120.21, 110.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/502mf1458419532.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,] 109.41 110.360 117.410 118.150 118.830 NA [2,] 110.13 111.495 117.755 118.510 119.015 NA [3,] 110.48 112.215 118.135 119.235 119.745 NA [4,] 110.80 113.035 118.605 119.665 119.905 NA [5,] 111.47 114.370 119.200 120.210 120.090 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 110.1744 111.5126 117.7473 118.7082 119.3391 NA [2,] 110.7856 112.9174 118.5227 119.7618 120.1509 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(109.41, 110.13, 110.48, 110.8, 111.47, 110.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/621tv1458419532.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,] 3.674816 7.690 6.460 [2,] 3.991343 8.880 6.465 [3,] 4.237705 9.125 6.985 [4,] 4.603615 9.685 7.315 [5,] 4.813837 10.450 7.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.958443 8.757834 6.597309 [2,] 4.516966 9.492166 7.372691 $out [1] 8.69 8.59 4.44 4.55 $group [1] 3 3 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.67481564163428, 3.99134283030956, 4.23770463099178, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qx771458419532.ps tmp/1qx771458419532.png",intern=TRUE)) character(0) > try(system("convert tmp/23izz1458419532.ps tmp/23izz1458419532.png",intern=TRUE)) character(0) > try(system("convert tmp/3f2at1458419532.ps tmp/3f2at1458419532.png",intern=TRUE)) character(0) > try(system("convert tmp/4t55e1458419532.ps tmp/4t55e1458419532.png",intern=TRUE)) character(0) > try(system("convert tmp/502mf1458419532.ps tmp/502mf1458419532.png",intern=TRUE)) character(0) > try(system("convert tmp/621tv1458419532.ps tmp/621tv1458419532.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.076 0.409 2.500