R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(94.46,96.91,101.92,104.53,105.85,106.39,106.08,106.42,106.51,106.59,105.71,104.41,103.04,100.99,100.93,99.31,99.79,99.57,99.11,98.96,97.72,99.35,98.15,97.64,97.49,97.94,98.03,98.05,97.54,98.71,99.33,99.16,98.41,98.43,97.02,97.89,97.92,97.37,97.42,96.12,96.72,96.64,95.28,95.3,95.02,95.57,94.78,95.27,96.14,96.16,95.08,94.39,94.15,94.58,94.16,95.02,94.86,94.49,94.81,94.16,94.83,96.02,95.97,95.88,95.97,97.55,97.49,98.4,98.2,97.16,96.96,96.37,96.34,96.86,96.32,95.44,92.85,92.56,91.74,92.44,93.19,92.62,94.04,93.8,96.73,98.99,100.38,101.07,99.92,101.78,100.91,100.49,101.17,100.25,98.94,99.4,100.02,99.91,99.22,98.84,98.42,97.59,97.07,96.59,95.96,94.22,94.48,93.14,93.73,94.24,98.52,99.09,99.84,99.13,100.88,100.83,101.6,101.8,102.77,103.14) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 94.46 103.04 97.49 97.92 96.14 94.83 96.34 96.73 100.02 93.73 NA [2,] 96.91 100.99 97.94 97.37 96.16 96.02 96.86 98.99 99.91 94.24 NA [3,] 101.92 100.93 98.03 97.42 95.08 95.97 96.32 100.38 99.22 98.52 NA [4,] 104.53 99.31 98.05 96.12 94.39 95.88 95.44 101.07 98.84 99.09 NA [5,] 105.85 99.79 97.54 96.72 94.15 95.97 92.85 99.92 98.42 99.84 NA [6,] 106.39 99.57 98.71 96.64 94.58 97.55 92.56 101.78 97.59 99.13 NA [7,] 106.08 99.11 99.33 95.28 94.16 97.49 91.74 100.91 97.07 100.88 NA [8,] 106.42 98.96 99.16 95.30 95.02 98.40 92.44 100.49 96.59 100.83 NA [9,] 106.51 97.72 98.41 95.02 94.86 98.20 93.19 101.17 95.96 101.60 NA [10,] 106.59 99.35 98.43 95.57 94.49 97.16 92.62 100.25 94.22 101.80 NA [11,] 105.71 98.15 97.02 94.78 94.81 96.96 94.04 98.94 94.48 102.77 NA [12,] 104.41 97.64 97.89 95.27 94.16 96.37 93.80 99.40 93.14 103.14 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/1039y1483956068.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/2g4nd1483956068.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/3zoph1483956068.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/4pvk11483956068.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,] 93.730 94.24 95.080 94.390 92.85 92.56 91.74 92.44 93.19 92.620 [2,] 94.830 96.16 96.320 95.880 95.97 96.64 95.28 95.30 95.02 94.490 [3,] 96.535 97.14 98.275 98.445 97.98 98.15 98.30 98.68 97.96 97.795 [4,] 97.920 98.99 100.380 99.310 99.84 99.57 100.88 100.49 101.17 100.250 [5,] 100.020 100.99 101.920 101.070 99.92 101.78 106.08 106.42 106.51 106.590 [,11] [,12] [1,] 94.04 93.140 [2,] 94.78 94.160 [3,] 96.99 97.005 [4,] 98.94 99.400 [5,] 102.77 104.410 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.99111 95.72602 96.24646 96.73124 96.04639 96.68606 95.50202 [2,] 98.07889 98.55398 100.30354 100.15876 99.91361 99.61394 101.09798 [,8] [,9] [,10] [,11] [,12] [1,] 96.08687 94.88721 94.91707 94.9115 94.38689 [2,] 101.27313 101.03279 100.67293 99.0685 99.62311 $out [1] 103.04 104.53 105.85 106.39 105.71 $group [1] 1 4 5 6 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.73, 94.83, 96.535, 97.92, 100.02, 94.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jj6v1483956068.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] [,9] [,10] [1,] 101.920 97.640 97.020 94.780 94.150 94.830 91.740 96.730 93.14 98.520 [2,] 103.165 98.555 97.715 95.275 94.275 95.970 92.590 99.195 95.22 98.805 [3,] 105.780 99.330 98.040 95.845 94.695 96.665 93.495 100.315 97.33 100.335 [4,] 106.405 100.360 98.570 97.045 95.050 97.520 95.880 100.990 99.03 101.700 [5,] 106.590 103.040 99.330 97.920 96.160 98.400 96.860 101.780 100.02 103.140 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.3022 98.50673 97.65003 95.03769 94.34152 95.95803 91.99441 99.49629 [2,] 107.2578 100.15327 98.42997 96.65231 95.04848 97.37197 94.99559 101.13371 [,9] [,10] [,11] [1,] 95.59223 99.01457 NA [2,] 99.06777 101.65543 NA $out [1] 94.46 96.91 93.73 94.24 $group [1] 1 1 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(101.92, 103.165, 105.78, 106.405, 106.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69otj1483956068.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,] 1.993737 6.750 2.3925 [2,] 2.906160 9.725 2.9850 [3,] 3.826938 12.335 3.8125 [4,] 3.918104 13.900 4.6750 [5,] 4.182481 14.340 5.2650 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.365384 10.43075 3.04168 [2,] 4.288493 14.23925 4.58332 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.99373713858617, 2.9061604419112, 3.82693808590998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1039y1483956068.ps tmp/1039y1483956068.png",intern=TRUE)) character(0) > try(system("convert tmp/2g4nd1483956068.ps tmp/2g4nd1483956068.png",intern=TRUE)) character(0) > try(system("convert tmp/3zoph1483956068.ps tmp/3zoph1483956068.png",intern=TRUE)) character(0) > try(system("convert tmp/4pvk11483956068.ps tmp/4pvk11483956068.png",intern=TRUE)) character(0) > try(system("convert tmp/5jj6v1483956068.ps tmp/5jj6v1483956068.png",intern=TRUE)) character(0) > try(system("convert tmp/69otj1483956068.ps tmp/69otj1483956068.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.235 0.205 2.506