R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(91.04,91.37,91.36,91.4,91.54,91.57,91.57,91.47,91.55,91.71,91.71,92.12,93.28,94.02,94.26,94.19,94.34,94.62,94.9,96.08,96.85,96.61,96.47,96.68,96.43,96.35,96.14,95.39,95.08,94.86,94.8,95.62,96.35,96.77,96.97,96.78,97.71,98.04,98.41,100.05,100.9,100.61,100.71,100.06,100.57,101.03,100.93,100.98,100.46,101.52,101.29,101.84,102.03,101.72,102.23,102.38,102.5,101.5,101.96,101.61) > 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,] 91.04 93.28 96.43 97.71 100.46 NA [2,] 91.37 94.02 96.35 98.04 101.52 NA [3,] 91.36 94.26 96.14 98.41 101.29 NA [4,] 91.40 94.19 95.39 100.05 101.84 NA [5,] 91.54 94.34 95.08 100.90 102.03 NA [6,] 91.57 94.62 94.86 100.61 101.72 NA [7,] 91.57 94.90 94.80 100.71 102.23 NA [8,] 91.47 96.08 95.62 100.06 102.38 NA [9,] 91.55 96.85 96.35 100.57 102.50 NA [10,] 91.71 96.61 96.77 101.03 101.50 NA [11,] 91.71 96.47 96.97 100.93 101.96 NA [12,] 92.12 96.68 96.78 100.98 101.61 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/1ksvu1447789225.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/2q8re1447789225.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/371qn1447789225.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/4bnb91447789225.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,] 91.04 91.37 91.36 91.40 91.54 91.57 91.57 91.47 91.55 91.71 [2,] 93.28 94.02 94.26 94.19 94.34 94.62 94.80 95.62 96.35 96.61 [3,] 96.43 96.35 96.14 95.39 95.08 94.86 94.90 96.08 96.85 96.77 [4,] 97.71 98.04 98.41 100.05 100.90 100.61 100.71 100.06 100.57 101.03 [5,] 100.46 101.52 101.29 101.84 102.03 101.72 102.23 102.38 102.50 101.50 [,11] [,12] [1,] 91.71 92.12 [2,] 96.47 96.68 [3,] 96.97 96.78 [4,] 100.93 100.98 [5,] 101.96 101.61 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 93.29977 93.50948 93.20762 91.24934 90.44472 90.62748 90.72401 92.94271 [2,] 99.56023 99.19052 99.07238 99.53066 99.71528 99.09252 99.07599 99.21729 [,9] [,10] [,11] [,12] [1,] 93.86816 93.64684 93.81858 93.74163 [2,] 99.83184 99.89316 100.12142 99.81837 $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(91.04, 93.28, 96.43, 97.71, 100.46, 91.37, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5h85m1447789225.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,] 91.040 93.280 94.800 97.710 101.29 NA [2,] 91.385 94.225 95.235 99.230 101.51 NA [3,] 91.545 94.760 96.245 100.590 101.78 NA [4,] 91.640 96.540 96.600 100.915 102.13 NA [5,] 91.710 96.850 96.970 101.030 102.50 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.42869 93.70411 95.62241 99.82146 101.4972 NA [2,] 91.66131 95.81589 96.86759 101.35854 102.0628 NA $out [1] 92.12 100.46 $group [1] 1 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(91.04, 91.385, 91.545, 91.64, 91.71, 93.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62b8q1447789225.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.700247 9.420 4.020 [2,] 3.853904 9.860 4.260 [3,] 4.152847 10.200 4.435 [4,] 4.303810 10.575 5.885 [5,] 4.495500 10.950 6.560 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.947642 9.873884 3.693827 [2,] 4.358052 10.526116 5.176173 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.70024728903353, 3.85390404966686, 4.15284683015548, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ksvu1447789225.ps tmp/1ksvu1447789225.png",intern=TRUE)) character(0) > try(system("convert tmp/2q8re1447789225.ps tmp/2q8re1447789225.png",intern=TRUE)) character(0) > try(system("convert tmp/371qn1447789225.ps tmp/371qn1447789225.png",intern=TRUE)) character(0) > try(system("convert tmp/4bnb91447789225.ps tmp/4bnb91447789225.png",intern=TRUE)) character(0) > try(system("convert tmp/5h85m1447789225.ps tmp/5h85m1447789225.png",intern=TRUE)) character(0) > try(system("convert tmp/62b8q1447789225.ps tmp/62b8q1447789225.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.479 0.469 2.977