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(100.57,100.27,100.27,100.18,100.16,100.18,100.18,100.59,100.69,101.06,101.15,101.16,101.16,100.81,100.94,101.13,101.29,101.34,101.35,101.7,102.05,102.48,102.66,102.72,102.73,102.18,102.22,102.37,102.53,102.61,102.62,103,103.17,103.52,103.69,103.73,99.57,99.09,99.14,99.36,99.6,99.65,99.8,100.15,100.45,100.89,101.13,101.17,101.21,101.1,101.17,101.11,101.2,101.15,100.92,101.1,101.22,101.25,101.39,101.43,101.95,101.92,102.05,102.07,102.1,102.16,101.63,101.43,101.4,101.6,101.72,101.73,102.67,102.59,102.69,102.93,103.02,103.06,102.47,102.4,102.42,102.51,102.61,102.78) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.57 101.16 102.73 99.57 101.21 101.95 102.67 NA [2,] 100.27 100.81 102.18 99.09 101.10 101.92 102.59 NA [3,] 100.27 100.94 102.22 99.14 101.17 102.05 102.69 NA [4,] 100.18 101.13 102.37 99.36 101.11 102.07 102.93 NA [5,] 100.16 101.29 102.53 99.60 101.20 102.10 103.02 NA [6,] 100.18 101.34 102.61 99.65 101.15 102.16 103.06 NA [7,] 100.18 101.35 102.62 99.80 100.92 101.63 102.47 NA [8,] 100.59 101.70 103.00 100.15 101.10 101.43 102.40 NA [9,] 100.69 102.05 103.17 100.45 101.22 101.40 102.42 NA [10,] 101.06 102.48 103.52 100.89 101.25 101.60 102.51 NA [11,] 101.15 102.66 103.69 101.13 101.39 101.72 102.61 NA [12,] 101.16 102.72 103.73 101.17 101.43 101.73 102.78 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/1f2r21492776765.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/2dq6d1492776765.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/3nugu1492776765.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/4haxr1492776765.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] [1,] 99.570 99.09 99.140 99.360 99.600 99.650 99.80 100.150 100.450 [2,] 100.865 100.54 100.605 100.645 100.680 100.665 100.55 100.845 100.955 [3,] 101.210 101.10 101.170 101.130 101.290 101.340 101.35 101.430 101.400 [4,] 102.310 102.05 102.135 102.220 102.315 102.385 102.05 102.050 102.235 [5,] 102.730 102.59 102.690 102.930 103.020 103.060 102.62 103.000 103.170 [,10] [,11] [,12] [1,] 100.890 101.130 101.16 [2,] 101.155 101.270 101.30 [3,] 101.600 101.720 101.73 [4,] 102.495 102.635 102.75 [5,] 103.520 103.690 103.73 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.3471 100.1983 100.2563 100.1894 100.3136 100.3128 100.4542 100.7104 [2,] 102.0729 102.0017 102.0837 102.0706 102.2664 102.3672 102.2458 102.1496 [,9] [,10] [,11] [,12] [1,] 100.6356 100.7998 100.9048 100.8641 [2,] 102.1644 102.4002 102.5352 102.5959 $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(99.57, 100.865, 101.21, 102.31, 102.73, 99.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eief1492776765.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] [,8] [1,] 100.160 100.810 102.180 99.090 100.920 101.400 102.400 NA [2,] 100.180 101.145 102.450 99.465 101.105 101.615 102.490 NA [3,] 100.420 101.345 102.675 99.725 101.185 101.825 102.640 NA [4,] 100.875 102.265 103.345 100.670 101.235 102.060 102.855 NA [5,] 101.160 102.720 103.730 101.170 101.430 102.160 103.060 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.103 100.8342 102.2668 99.17539 101.1257 101.622 102.4735 NA [2,] 100.737 101.8558 103.0832 100.27461 101.2443 102.028 102.8065 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(100.16, 100.18, 100.42, 100.875, 101.16, 100.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68di21492776765.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.9635945 2.560 1.2050 [2,] 0.9792178 2.675 1.3525 [3,] 1.1056338 3.005 1.4750 [4,] 1.2375583 3.460 1.5525 [5,] 1.2568043 3.570 1.7200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.9878029 2.646956 1.383779 [2,] 1.2234647 3.363044 1.566221 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.963594461230597, 0.979217760707592, 1.10563380289184, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1f2r21492776765.ps tmp/1f2r21492776765.png",intern=TRUE)) character(0) > try(system("convert tmp/2dq6d1492776765.ps tmp/2dq6d1492776765.png",intern=TRUE)) character(0) > try(system("convert tmp/3nugu1492776765.ps tmp/3nugu1492776765.png",intern=TRUE)) character(0) > try(system("convert tmp/4haxr1492776765.ps tmp/4haxr1492776765.png",intern=TRUE)) character(0) > try(system("convert tmp/5eief1492776765.ps tmp/5eief1492776765.png",intern=TRUE)) character(0) > try(system("convert tmp/68di21492776765.ps tmp/68di21492776765.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.568 0.289 2.924