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(94,94.45,94.34,94.39,94.68,94.76,94.96,95.01,95.1,95.23,95.26,95.34,95.71,96.07,96.19,96.11,96.31,96.46,96.68,96.69,96.72,96.92,97.04,97.18,97.83,98.25,98.24,98.28,98.53,98.62,98.84,98.94,98.94,99.1,99.15,99.26,99.01,99.43,99.62,99.43,99.81,99.99,100.24,100.32,100.32,100.47,100.62,100.72,100.92,101.13,101.26,101.36,101.52,101.59,101.86,101.74,101.78,101.9,101.83,101.98,102.19,102.59,102.35,102.67,102.61,102.93,103.12,103.2,103.05,103.45,103.66,103.74) > 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,] 94.00 95.71 97.83 99.01 100.92 102.19 NA [2,] 94.45 96.07 98.25 99.43 101.13 102.59 NA [3,] 94.34 96.19 98.24 99.62 101.26 102.35 NA [4,] 94.39 96.11 98.28 99.43 101.36 102.67 NA [5,] 94.68 96.31 98.53 99.81 101.52 102.61 NA [6,] 94.76 96.46 98.62 99.99 101.59 102.93 NA [7,] 94.96 96.68 98.84 100.24 101.86 103.12 NA [8,] 95.01 96.69 98.94 100.32 101.74 103.20 NA [9,] 95.10 96.72 98.94 100.32 101.78 103.05 NA [10,] 95.23 96.92 99.10 100.47 101.90 103.45 NA [11,] 95.26 97.04 99.15 100.62 101.83 103.66 NA [12,] 95.34 97.18 99.26 100.72 101.98 103.74 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/1ywtv1493143612.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/29ks91493143612.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/3gjfi1493143612.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/45jo81493143612.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,] 94.00 94.45 94.34 94.390 94.68 94.760 94.96 95.01 95.10 95.230 [2,] 95.71 96.07 96.19 96.110 96.31 96.460 96.68 96.69 96.72 96.920 [3,] 98.42 98.84 98.93 98.855 99.17 99.305 99.54 99.63 99.63 99.785 [4,] 100.92 101.13 101.26 101.360 101.52 101.590 101.86 101.74 101.78 101.900 [5,] 102.19 102.59 102.35 102.670 102.61 102.930 103.12 103.20 103.05 103.450 [,11] [,12] [1,] 95.260 95.34 [2,] 97.040 97.18 [3,] 99.885 99.99 [4,] 101.830 101.98 [5,] 103.660 103.74 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.05938 95.57614 95.65969 95.46858 95.80938 95.99598 96.19873 [2,] 101.78062 102.10386 102.20031 102.24142 102.53062 102.61402 102.88127 [,8] [,9] [,10] [,11] [,12] [1,] 96.37259 96.36614 96.57274 96.7953 96.89384 [2,] 102.88741 102.89386 102.99726 102.9747 103.08616 $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(94, 95.71, 98.42, 100.92, 102.19, 94.45, 96.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5okm41493143612.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,] 94.000 95.71 97.830 99.010 100.920 102.190 NA [2,] 94.420 96.15 98.265 99.525 101.310 102.600 NA [3,] 94.860 96.57 98.730 100.115 101.665 102.990 NA [4,] 95.165 96.82 99.020 100.395 101.845 103.325 NA [5,] 95.340 97.18 99.260 100.720 101.980 103.740 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.5202 96.26441 98.38564 99.71819 101.421 102.6593 NA [2,] 95.1998 96.87559 99.07436 100.51181 101.909 103.3207 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(94, 94.42, 94.86, 95.165, 95.34, 95.71, 96.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6sf8u1493143612.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.022492 7.930 3.96000 [2,] 3.049183 8.075 4.08375 [3,] 3.086007 8.180 4.14375 [4,] 3.098835 8.250 4.21375 [5,] 3.125051 8.400 4.23500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.063360 8.100181 4.084456 [2,] 3.108653 8.259819 4.203044 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.02249179761777, 3.04918333550508, 3.08600658724947, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ywtv1493143612.ps tmp/1ywtv1493143612.png",intern=TRUE)) character(0) > try(system("convert tmp/29ks91493143612.ps tmp/29ks91493143612.png",intern=TRUE)) character(0) > try(system("convert tmp/3gjfi1493143612.ps tmp/3gjfi1493143612.png",intern=TRUE)) character(0) > try(system("convert tmp/45jo81493143612.ps tmp/45jo81493143612.png",intern=TRUE)) character(0) > try(system("convert tmp/5okm41493143612.ps tmp/5okm41493143612.png",intern=TRUE)) character(0) > try(system("convert tmp/6sf8u1493143612.ps tmp/6sf8u1493143612.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.082 0.635 8.194