R version 3.2.4 (2016-03-10) -- "Very Secure Dishes" 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(92.86,94.06,95.51,96.05,96.71,97.91,97.74,97.64,98.55,98.46,99.19,99.18,99.95,100.66,101.12,101.14,100.73,99.92,100.06,100.64,100.89,100.87,100.72,100.72,100.98,100.15,100.13,100.39,99.87,99.93,99.96,99.61,99.57,99.71,99.78,99.92,100.3,100.83,100.84,97.87,97.99,98.03,97.58,97.45,97.47,98.31,98.29,98.13,98.44,98.05,98.32,97.55,97.74,98.01,97.93,99.23,101.03,100.81,100.57,100.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] 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.86 99.95 100.98 100.30 98.44 NA [2,] 94.06 100.66 100.15 100.83 98.05 NA [3,] 95.51 101.12 100.13 100.84 98.32 NA [4,] 96.05 101.14 100.39 97.87 97.55 NA [5,] 96.71 100.73 99.87 97.99 97.74 NA [6,] 97.91 99.92 99.93 98.03 98.01 NA [7,] 97.74 100.06 99.96 97.58 97.93 NA [8,] 97.64 100.64 99.61 97.45 99.23 NA [9,] 98.55 100.89 99.57 97.47 101.03 NA [10,] 98.46 100.87 99.71 98.31 100.81 NA [11,] 99.19 100.72 99.78 98.29 100.57 NA [12,] 99.18 100.72 99.92 98.13 100.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/1f9ax1458635363.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/2jr221458635363.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/32qoq1458635363.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/4f2811458635363.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,] 98.44 98.05 95.51 96.05 96.71 97.91 97.58 97.45 97.47 98.31 [2,] 98.44 98.05 98.32 97.55 97.74 98.01 97.74 97.64 98.55 98.46 [3,] 99.95 100.15 100.13 97.87 97.99 98.03 97.93 99.23 99.57 99.71 [4,] 100.30 100.66 100.84 100.39 99.87 99.92 99.96 99.61 100.89 100.81 [5,] 100.98 100.83 101.12 101.14 100.73 99.93 100.06 100.64 101.03 100.87 [,11] [,12] [1,] 98.29 98.13 [2,] 99.19 99.18 [3,] 99.78 99.92 [4,] 100.57 100.10 [5,] 100.72 100.72 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.63573 98.30578 98.34937 95.86326 96.48495 96.6804 96.36135 97.838 [2,] 101.26427 101.99422 101.91063 99.87674 99.49505 99.3796 99.49865 100.622 [,9] [,10] [,11] [,12] [1,] 97.91656 98.0495 98.8049 99.26993 [2,] 101.22344 101.3705 100.7551 100.57007 $out [1] 92.86 94.06 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.44, 98.44, 99.95, 100.3, 100.98, 98.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ztrr1458635363.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.860 99.92 99.570 97.450 97.550 NA [2,] 95.780 100.35 99.745 97.725 97.970 NA [3,] 97.690 100.72 99.925 98.080 98.380 NA [4,] 98.505 100.88 100.140 99.305 100.335 NA [5,] 99.190 101.14 100.390 100.840 101.030 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 96.44711 100.4783 99.74484 97.35935 97.30131 NA [2,] 98.93289 100.9617 100.10516 98.80065 99.45869 NA $out [1] 100.98 $group [1] 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.86, 95.78, 97.69, 98.505, 99.19, 99.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6u4tl1458635363.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,] 0.992925 2.020 1.380 [2,] 1.147037 2.520 1.885 [3,] 1.439286 3.375 2.175 [4,] 2.217266 5.350 2.435 [5,] 3.290362 8.120 2.840 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.9511474 2.084218 1.924141 [2,] 1.9274253 4.665782 2.425859 $out [1] 0.92 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.992924971989324, 1.14703663071752, 1.43928638922617, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1f9ax1458635363.ps tmp/1f9ax1458635363.png",intern=TRUE)) character(0) > try(system("convert tmp/2jr221458635363.ps tmp/2jr221458635363.png",intern=TRUE)) character(0) > try(system("convert tmp/32qoq1458635363.ps tmp/32qoq1458635363.png",intern=TRUE)) character(0) > try(system("convert tmp/4f2811458635363.ps tmp/4f2811458635363.png",intern=TRUE)) character(0) > try(system("convert tmp/5ztrr1458635363.ps tmp/5ztrr1458635363.png",intern=TRUE)) character(0) > try(system("convert tmp/6u4tl1458635363.ps tmp/6u4tl1458635363.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.142 0.352 2.521