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(103.71,103.07,103.93,102.9,101.54,102.13,101.08,101.33,101.24,100.58,99.87,99.1,98.98,98.77,98.05,97.94,97.65,97.2,97.39,97.35,98.01,97.81,97.56,98.05,97.82,99.05,98.86,97.64,97.77,98.07,98.36,100,99.52,98.82,98.98,98.6,98.8,99.62,99.35,99.87,99.53,99.88,99.26,99.51,100.64,100.85,101.44,101.26,101.67,102.93,103.81,106.19,106.94,108.51,108.41,108.97,109.25,109.97,108.92,109.01,108.86,107.36,107.99,107.94,108.54,108.37,108.77,107.15,108.61,109.02,109.16,109.55) > 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,] 103.71 98.98 97.82 98.80 101.67 108.86 NA [2,] 103.07 98.77 99.05 99.62 102.93 107.36 NA [3,] 103.93 98.05 98.86 99.35 103.81 107.99 NA [4,] 102.90 97.94 97.64 99.87 106.19 107.94 NA [5,] 101.54 97.65 97.77 99.53 106.94 108.54 NA [6,] 102.13 97.20 98.07 99.88 108.51 108.37 NA [7,] 101.08 97.39 98.36 99.26 108.41 108.77 NA [8,] 101.33 97.35 100.00 99.51 108.97 107.15 NA [9,] 101.24 98.01 99.52 100.64 109.25 108.61 NA [10,] 100.58 97.81 98.82 100.85 109.97 109.02 NA [11,] 99.87 97.56 98.98 101.44 108.92 109.16 NA [12,] 99.10 98.05 98.60 101.26 109.01 109.55 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/1hv091458141121.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/2x5k51458141121.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/38f7h1458141121.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/40e2b1458141121.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,] 97.820 98.770 98.05 97.640 97.650 97.200 97.39 97.350 98.01 [2,] 98.800 99.050 98.86 97.940 97.770 98.070 98.36 99.510 99.52 [3,] 100.325 101.275 101.58 101.385 100.535 101.005 100.17 100.665 100.94 [4,] 103.710 103.070 103.93 106.190 106.940 108.370 108.41 107.150 108.61 [5,] 108.860 107.360 107.99 107.940 108.540 108.510 108.77 108.970 109.25 [,10] [,11] [,12] [1,] 97.810 97.560 98.05 [2,] 98.820 98.980 98.60 [3,] 100.715 100.655 100.18 [4,] 109.020 108.920 109.01 [5,] 109.970 109.160 109.55 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.15789 98.68197 98.30969 96.06348 94.62005 94.36117 93.68743 [2,] 103.49211 103.86803 104.85031 106.70652 106.44995 107.64883 106.65257 [,8] [,9] [,10] [,11] [,12] [1,] 95.73695 95.07666 94.13567 94.24338 93.46521 [2,] 105.59305 106.80334 107.29433 107.06662 106.89479 $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(97.82, 98.8, 100.325, 103.71, 108.86, 98.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eg881458141121.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,] 99.100 97.200 97.640 98.800 101.67 107.150 NA [2,] 100.830 97.475 97.945 99.430 105.00 107.965 NA [3,] 101.435 97.875 98.710 99.745 108.46 108.575 NA [4,] 102.985 98.050 99.015 100.745 108.99 108.940 NA [5,] 103.930 98.770 100.000 101.440 109.97 109.550 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.4521 97.61274 98.22197 99.14522 106.6401 108.1303 NA [2,] 102.4179 98.13726 99.19803 100.34478 110.2799 109.0197 NA $out [1] 98.98 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(99.1, 100.83, 101.435, 102.985, 103.93, 97.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63xsz1458141121.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,] 3.325634 9.940 3.84250 [2,] 4.239234 10.595 5.49000 [3,] 4.758036 11.275 7.17375 [4,] 5.096761 11.550 7.92000 [5,] 5.294120 12.160 8.34750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.366912 10.83942 6.065411 [2,] 5.149159 11.71058 8.282089 $out [1] 8.59 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.32563377418501, 4.23923439893408, 4.75803553365422, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hv091458141121.ps tmp/1hv091458141121.png",intern=TRUE)) character(0) > try(system("convert tmp/2x5k51458141121.ps tmp/2x5k51458141121.png",intern=TRUE)) character(0) > try(system("convert tmp/38f7h1458141121.ps tmp/38f7h1458141121.png",intern=TRUE)) character(0) > try(system("convert tmp/40e2b1458141121.ps tmp/40e2b1458141121.png",intern=TRUE)) character(0) > try(system("convert tmp/5eg881458141121.ps tmp/5eg881458141121.png",intern=TRUE)) character(0) > try(system("convert tmp/63xsz1458141121.ps tmp/63xsz1458141121.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.732 0.475 3.216