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(95.2,95.34,95.32,96.04,99.65,100.85,108.18,108.18,103.14,99.71,99.39,98.99,98.83,99.52,99.5,99.5,99.39,101.79,106.03,105.41,104.32,101.17,99.79,100.08,100.27,101.63,101.74,103.73,103.29,105.71,107.42,107.57,105.13,103.61,102.35,102.14,104.32,104.69,106.02,104.78,106.36,109.27,113.46,113.46,110.61,104.37,103.82,104.1) > 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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 95.20 98.83 100.27 104.32 NA [2,] 95.34 99.52 101.63 104.69 NA [3,] 95.32 99.50 101.74 106.02 NA [4,] 96.04 99.50 103.73 104.78 NA [5,] 99.65 99.39 103.29 106.36 NA [6,] 100.85 101.79 105.71 109.27 NA [7,] 108.18 106.03 107.42 113.46 NA [8,] 108.18 105.41 107.57 113.46 NA [9,] 103.14 104.32 105.13 110.61 NA [10,] 99.71 101.17 103.61 104.37 NA [11,] 99.39 99.79 102.35 103.82 NA [12,] 98.99 100.08 102.14 104.10 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/19x5f1493130566.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/20q4y1493130566.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/3mtbk1493130566.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/4mgld1493130566.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,] 95.200 95.340 95.32 96.040 99.390 100.85 106.030 105.410 103.140 [2,] 97.015 97.430 97.41 97.770 99.520 101.32 106.725 106.490 103.730 [3,] 99.550 100.575 100.62 101.615 101.470 103.75 107.800 107.875 104.725 [4,] 102.295 103.160 103.88 104.255 104.825 107.49 110.820 110.820 107.870 [5,] 104.320 104.690 106.02 104.780 106.360 109.27 113.460 113.460 110.610 [,10] [,11] [,12] [1,] 99.71 99.390 98.990 [2,] 100.44 99.590 99.535 [3,] 102.39 101.070 101.110 [4,] 103.99 103.085 103.120 [5,] 104.37 103.820 104.100 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.3788 96.0483 95.5087 96.49185 97.27905 98.8757 104.5650 104.4543 [2,] 103.7212 105.1017 105.7313 106.73815 105.66095 108.6243 111.0351 111.2957 [,9] [,10] [,11] [,12] [1,] 101.4544 99.5855 98.30895 98.27785 [2,] 107.9956 105.1945 103.83105 103.94215 $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(95.2, 97.015, 99.55, 102.295, 104.32, 95.34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55sep1493130566.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] [1,] 95.200 98.830 100.27 103.820 NA [2,] 95.690 99.500 101.94 104.345 NA [3,] 99.520 99.935 103.45 105.400 NA [4,] 101.995 103.055 105.42 109.940 NA [5,] 108.180 106.030 107.57 113.460 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 96.64425 98.31354 101.8627 102.8481 NA [2,] 102.39575 101.55646 105.0373 107.9519 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(95.2, 95.69, 99.52, 101.995, 108.18, 98.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62xlx1493130566.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,] 2.111514 4.43 2.42750 [2,] 2.756292 6.04 2.64875 [3,] 3.363863 7.76 3.19375 [4,] 3.896430 8.93 4.41375 [5,] 4.463045 10.70 5.35750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.843839 6.441852 2.388722 [2,] 3.883887 9.078148 3.998778 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.11151406972974, 2.75629224343092, 3.36386294662861, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19x5f1493130566.ps tmp/19x5f1493130566.png",intern=TRUE)) character(0) > try(system("convert tmp/20q4y1493130566.ps tmp/20q4y1493130566.png",intern=TRUE)) character(0) > try(system("convert tmp/3mtbk1493130566.ps tmp/3mtbk1493130566.png",intern=TRUE)) character(0) > try(system("convert tmp/4mgld1493130566.ps tmp/4mgld1493130566.png",intern=TRUE)) character(0) > try(system("convert tmp/55sep1493130566.ps tmp/55sep1493130566.png",intern=TRUE)) character(0) > try(system("convert tmp/62xlx1493130566.ps tmp/62xlx1493130566.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.865 0.442 4.559