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(90.75,92.82,97.78,99.32,98.33,98.66,98.13,97.8,99.36,100.37,103.22,101.68,104.39,103.99,106.71,106.06,103.5,100.17,101.1,105.93,108.09,107.27,104.9,102.7,102.06,103.05,102.08,100.13,97.56,97.38,99.66,99.58,102.7,98.92,97.85,99.01,97.71,97.95,97.24,96.69,96.41,96.99,98.36,97.8,96.79,94.73,92.67,87.15,79.54,82.35,86.38,84.75,87.54,86.73,84.74,80.75,79.28,78.52,78.54,77.33) > 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,] 90.75 104.39 102.06 97.71 79.54 NA [2,] 92.82 103.99 103.05 97.95 82.35 NA [3,] 97.78 106.71 102.08 97.24 86.38 NA [4,] 99.32 106.06 100.13 96.69 84.75 NA [5,] 98.33 103.50 97.56 96.41 87.54 NA [6,] 98.66 100.17 97.38 96.99 86.73 NA [7,] 98.13 101.10 99.66 98.36 84.74 NA [8,] 97.80 105.93 99.58 97.80 80.75 NA [9,] 99.36 108.09 102.70 96.79 79.28 NA [10,] 100.37 107.27 98.92 94.73 78.52 NA [11,] 103.22 104.90 97.85 92.67 78.54 NA [12,] 101.68 102.70 99.01 87.15 77.33 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/1ngrh1458412835.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/26b3o1458412835.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/3nweh1458412835.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/41u5e1458412835.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] [,11] [1,] 79.54 82.35 97.24 96.69 96.41 96.99 98.13 97.80 96.79 94.73 78.54 [2,] 90.75 92.82 97.24 96.69 96.41 96.99 98.13 97.80 96.79 94.73 92.67 [3,] 97.71 97.95 97.78 99.32 97.56 97.38 98.36 97.80 99.36 98.92 97.85 [4,] 102.06 103.05 102.08 100.13 98.33 98.66 99.66 99.58 102.70 100.37 103.22 [5,] 104.39 103.99 106.71 100.13 98.33 100.17 101.10 99.58 108.09 107.27 104.90 [,12] [1,] 77.33 [2,] 87.15 [3,] 99.01 [4,] 101.68 [5,] 102.70 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.71838 90.72151 94.36007 96.8893 96.20333 96.19998 97.27891 96.54226 [2,] 105.70162 105.17849 101.19993 101.7507 98.91667 98.56002 99.44109 99.05774 [,9] [,10] [,11] [,12] [1,] 95.18401 94.93479 90.3954 88.74314 [2,] 103.53599 102.90521 105.3046 109.27686 $out [1] 86.38 106.06 84.75 103.50 87.54 86.73 84.74 105.93 80.75 79.28 [11] 78.52 $group [1] 3 4 4 5 5 6 7 8 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(79.54, 90.75, 97.71, 102.06, 104.39, 82.35, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u3k71458412835.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,] 97.780 100.170 97.380 92.670 77.330 NA [2,] 97.790 103.100 98.385 95.570 78.910 NA [3,] 98.495 104.645 99.620 96.890 81.550 NA [4,] 99.865 106.385 102.070 97.755 85.565 NA [5,] 101.680 108.090 103.050 98.360 87.540 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 97.54858 103.1467 97.93925 95.89341 78.51461 NA [2,] 99.44142 106.1433 101.30075 97.88659 84.58539 NA $out [1] 90.75 92.82 103.22 87.15 $group [1] 1 1 1 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.78, 97.79, 98.495, 99.865, 101.68, 100.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m39i1458412835.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,] 5.321675 13.440 1.53 [2,] 7.088172 18.345 1.85 [3,] 9.103970 23.245 5.24 [4,] 10.670397 25.865 10.39 [5,] 10.996323 28.810 14.53 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.470093 19.81508 1.344849 [2,] 10.737847 26.67492 9.135151 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.32167548803946, 7.08817200646781, 9.10397026402966, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ngrh1458412835.ps tmp/1ngrh1458412835.png",intern=TRUE)) character(0) > try(system("convert tmp/26b3o1458412835.ps tmp/26b3o1458412835.png",intern=TRUE)) character(0) > try(system("convert tmp/3nweh1458412835.ps tmp/3nweh1458412835.png",intern=TRUE)) character(0) > try(system("convert tmp/41u5e1458412835.ps tmp/41u5e1458412835.png",intern=TRUE)) character(0) > try(system("convert tmp/5u3k71458412835.ps tmp/5u3k71458412835.png",intern=TRUE)) character(0) > try(system("convert tmp/6m39i1458412835.ps tmp/6m39i1458412835.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.208 0.382 2.612