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(93.65,92.68,92.70,92.73,92.80,92.86,93.02,93.02,93.04,93.09,93.11,93.11,93.20,93.21,93.22,93.23,93.29,93.42,93.43,93.45,93.45,93.49,93.50,93.56,93.68,93.70,94.01,94.07,94.33,94.43,94.47,95.35,95.37,95.46,95.83,96.00,96.85,97.84,98.38,98.90,99.51,99.93,99.95,101.40,101.56,101.65,101.70,101.91,101.91,102.29,102.33,102.44,102.57,102.59,102.84,102.88,103.04,103.16,103.20,103.23,103.27,103.31,103.59,104.35,104.55,104.60,104.67,104.93,105.08,105.15,109.25,109.82) > 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,] 93.65 93.20 93.68 96.85 101.91 103.27 NA [2,] 92.68 93.21 93.70 97.84 102.29 103.31 NA [3,] 92.70 93.22 94.01 98.38 102.33 103.59 NA [4,] 92.73 93.23 94.07 98.90 102.44 104.35 NA [5,] 92.80 93.29 94.33 99.51 102.57 104.55 NA [6,] 92.86 93.42 94.43 99.93 102.59 104.60 NA [7,] 93.02 93.43 94.47 99.95 102.84 104.67 NA [8,] 93.02 93.45 95.35 101.40 102.88 104.93 NA [9,] 93.04 93.45 95.37 101.56 103.04 105.08 NA [10,] 93.09 93.49 95.46 101.65 103.16 105.15 NA [11,] 93.11 93.50 95.83 101.70 103.20 109.25 NA [12,] 93.11 93.56 96.00 101.91 103.23 109.82 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/12xa31493651911.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/2gvm01493651911.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/3hciw1493651911.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/49j6d1493651911.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,] 93.200 92.68 92.700 92.730 92.80 92.86 93.02 93.020 93.040 [2,] 93.650 93.21 93.220 93.230 93.29 93.42 93.43 93.450 93.450 [3,] 95.265 95.77 96.195 96.485 96.92 97.18 97.21 98.375 98.465 [4,] 101.910 102.29 102.330 102.440 102.57 102.59 102.84 102.880 103.040 [5,] 103.270 103.31 103.590 104.350 104.55 104.60 104.67 104.930 105.080 [,10] [,11] [,12] [1,] 93.090 93.110 93.110 [2,] 93.490 93.500 93.560 [3,] 98.555 98.765 98.955 [4,] 103.160 103.200 103.230 [5,] 105.150 109.250 109.820 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.93703 89.91311 90.31876 90.54425 90.9341 91.26505 91.14025 [2,] 100.59297 101.62689 102.07124 102.42575 102.9059 103.09495 103.27975 [,8] [,9] [,10] [,11] [,12] [1,] 92.29235 92.27914 92.31754 92.50819 92.71754 [2,] 104.45765 104.65086 104.79246 105.02181 105.19246 $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(93.2, 93.65, 95.265, 101.91, 103.27, 92.68, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59nae1493651911.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,] 92.680 93.200 93.680 96.850 101.910 103.270 NA [2,] 92.765 93.225 94.040 98.640 102.385 103.970 NA [3,] 93.020 93.425 94.450 99.940 102.715 104.635 NA [4,] 93.100 93.470 95.415 101.605 103.100 105.115 NA [5,] 93.110 93.560 96.000 101.910 103.230 105.150 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.8672 93.31325 93.82285 98.58764 102.3889 104.1128 NA [2,] 93.1728 93.53675 95.07715 101.29236 103.0411 105.1572 NA $out [1] 93.65 109.25 109.82 $group [1] 1 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(92.68, 92.765, 93.02, 93.1, 93.11, 93.2, 93.225, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6irfk1493651911.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.473838 10.070 6.98750 [2,] 4.903552 11.255 8.02000 [3,] 5.083776 11.745 8.34125 [4,] 5.269126 12.050 8.73500 [5,] 5.278328 12.060 8.80000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.917035 11.3824 8.015134 [2,] 5.250516 12.1076 8.667366 $out [1] 6.385381 6.550160 16.140000 16.710000 $group [1] 1 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.47383802418758, 4.90355245307598, 5.08377571769082, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12xa31493651911.ps tmp/12xa31493651911.png",intern=TRUE)) character(0) > try(system("convert tmp/2gvm01493651911.ps tmp/2gvm01493651911.png",intern=TRUE)) character(0) > try(system("convert tmp/3hciw1493651911.ps tmp/3hciw1493651911.png",intern=TRUE)) character(0) > try(system("convert tmp/49j6d1493651911.ps tmp/49j6d1493651911.png",intern=TRUE)) character(0) > try(system("convert tmp/59nae1493651911.ps tmp/59nae1493651911.png",intern=TRUE)) character(0) > try(system("convert tmp/6irfk1493651911.ps tmp/6irfk1493651911.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.716 0.399 4.444