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(92.42,92.64,94.44,93.59,93.39,93.33,93.72,95.43,97.06,97.7,97.59,96.97,97.75,99.27,100.63,99.8,99.5,99.72,99.77,100.18,101.11,100.67,101.13,100.46,101.6,102.3,103.26,104.56,104.61,104.62,105.03,104.93,104.73,104.33,104.6,104.41,104.63,105.55,106.12,106.62,106.72,106.52,106.79,106.95,106.92,106.74,108.13,107.86,108.6,110.97,111.8,111,113.41,114.32,111.89,112.48,112.32,110.35,109.77,111.25) > 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,] 92.42 97.75 101.60 104.63 108.60 NA [2,] 92.64 99.27 102.30 105.55 110.97 NA [3,] 94.44 100.63 103.26 106.12 111.80 NA [4,] 93.59 99.80 104.56 106.62 111.00 NA [5,] 93.39 99.50 104.61 106.72 113.41 NA [6,] 93.33 99.72 104.62 106.52 114.32 NA [7,] 93.72 99.77 105.03 106.79 111.89 NA [8,] 95.43 100.18 104.93 106.95 112.48 NA [9,] 97.06 101.11 104.73 106.92 112.32 NA [10,] 97.70 100.67 104.33 106.74 110.35 NA [11,] 97.59 101.13 104.60 108.13 109.77 NA [12,] 96.97 100.46 104.41 107.86 111.25 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/1jn6i1493141285.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/273461493141285.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/3o2il1493141285.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/4g5bb1493141285.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,] 92.42 92.64 94.44 93.59 93.39 93.33 93.72 95.43 97.06 97.70 [2,] 97.75 99.27 100.63 99.80 99.50 99.72 99.77 100.18 101.11 100.67 [3,] 101.60 102.30 103.26 104.56 104.61 104.62 105.03 104.93 104.73 104.33 [4,] 104.63 105.55 106.12 106.62 106.72 106.52 106.79 106.95 106.92 106.74 [5,] 108.60 110.97 111.80 111.00 113.41 114.32 111.89 112.48 112.32 110.35 [,11] [,12] [1,] 97.59 96.97 [2,] 101.13 100.46 [3,] 104.60 104.41 [4,] 108.13 107.86 [5,] 109.77 111.25 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.73861 97.86257 99.38078 99.74101 99.50837 99.81514 100.0697 [2,] 106.46139 106.73743 107.13922 109.37899 109.71163 109.42486 109.9903 [,8] [,9] [,10] [,11] [,12] [1,] 100.1463 100.6247 100.041 99.65382 99.18118 [2,] 109.7137 108.8353 108.619 109.54618 109.63882 $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(92.42, 97.75, 101.6, 104.63, 108.6, 92.64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k2pm1493141285.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,] 92.420 99.27 103.260 105.550 108.600 NA [2,] 93.360 99.61 103.795 106.320 110.660 NA [3,] 94.080 99.99 104.580 106.730 111.525 NA [4,] 97.015 100.65 104.675 106.935 112.400 NA [5,] 97.700 101.13 105.030 106.950 114.320 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.41293 99.51565 104.1786 106.4495 110.7314 NA [2,] 95.74707 100.46435 104.9814 107.0105 112.3186 NA $out [1] 97.75 101.60 102.30 104.63 108.13 107.86 $group [1] 2 3 3 4 4 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.42, 93.36, 94.08, 97.015, 97.7, 99.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l0bv1493141285.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,] 4.967622 12.180 5.490 [2,] 5.736556 14.770 6.175 [3,] 6.474225 17.205 6.810 [4,] 6.902838 18.250 7.010 [5,] 7.825607 20.990 7.400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.942276 15.61775 6.429151 [2,] 7.006174 18.79225 7.190849 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.96762216759688, 5.73655631646418, 6.47422525754422, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jn6i1493141285.ps tmp/1jn6i1493141285.png",intern=TRUE)) character(0) > try(system("convert tmp/273461493141285.ps tmp/273461493141285.png",intern=TRUE)) character(0) > try(system("convert tmp/3o2il1493141285.ps tmp/3o2il1493141285.png",intern=TRUE)) character(0) > try(system("convert tmp/4g5bb1493141285.ps tmp/4g5bb1493141285.png",intern=TRUE)) character(0) > try(system("convert tmp/5k2pm1493141285.ps tmp/5k2pm1493141285.png",intern=TRUE)) character(0) > try(system("convert tmp/6l0bv1493141285.ps tmp/6l0bv1493141285.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.906 0.509 5.062