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(90.65,90.93,91.42,91.52,91.76,91.47,91.37,91.35,91.74,91.78,91.88,91.99,92.55,92.94,92.81,93.35,93.72,93.94,94.03,93.66,93.78,94.1,94.85,94.83,95.06,95.87,95.97,95.96,96.3,96.17,96.18,96.55,96.76,97.63,97.86,97.82,98.62,99.24,99.63,100.27,100.84,101.05,100.38,100.02,99.97,99.95,100,100.04,100.51,100.29,100.22,101.29,100.29,100.26,100.39,99.3,98.9,98.76,99.12,99.28) > 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.65 92.55 95.06 98.62 100.51 NA [2,] 90.93 92.94 95.87 99.24 100.29 NA [3,] 91.42 92.81 95.97 99.63 100.22 NA [4,] 91.52 93.35 95.96 100.27 101.29 NA [5,] 91.76 93.72 96.30 100.84 100.29 NA [6,] 91.47 93.94 96.17 101.05 100.26 NA [7,] 91.37 94.03 96.18 100.38 100.39 NA [8,] 91.35 93.66 96.55 100.02 99.30 NA [9,] 91.74 93.78 96.76 99.97 98.90 NA [10,] 91.78 94.10 97.63 99.95 98.76 NA [11,] 91.88 94.85 97.86 100.00 99.12 NA [12,] 91.99 94.83 97.82 100.04 99.28 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/19k771448233833.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/2slot1448233833.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/32ztt1448233833.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/4mxpz1448233833.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,] 90.65 90.93 91.42 91.52 91.76 91.47 91.37 91.35 91.74 91.78 91.88 [2,] 92.55 92.94 92.81 93.35 93.72 93.94 94.03 93.66 93.78 94.10 94.85 [3,] 95.06 95.87 95.97 95.96 96.30 96.17 96.18 96.55 96.76 97.63 97.86 [4,] 98.62 99.24 99.63 100.27 100.29 100.26 100.38 99.30 98.90 98.76 99.12 [5,] 100.51 100.29 100.22 101.29 100.84 101.05 100.39 100.02 99.97 99.95 100.00 [,12] [1,] 91.99 [2,] 94.83 [3,] 97.82 [4,] 99.28 [5,] 100.04 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.77095 91.41844 91.15101 91.07035 91.65765 91.7043 91.69311 [2,] 99.34905 100.32156 100.78899 100.84965 100.94235 100.6357 100.66689 [,8] [,9] [,10] [,11] [,12] [1,] 92.56479 93.14222 94.33726 94.84283 94.67564 [2,] 100.53521 100.37778 100.92274 100.87717 100.96436 $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(90.65, 92.55, 95.06, 98.62, 100.51, 90.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p1c91448233833.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,] 90.930 92.550 95.060 99.240 98.76 NA [2,] 91.360 93.145 95.965 99.790 99.20 NA [3,] 91.495 93.750 96.240 100.010 100.24 NA [4,] 91.770 94.065 97.195 100.325 100.34 NA [5,] 91.990 94.850 97.860 101.050 101.29 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.308 93.33038 95.67899 99.76598 99.72004 NA [2,] 91.682 94.16962 96.80101 100.25402 100.75996 NA $out [1] 90.65 98.62 $group [1] 1 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(90.93, 91.36, 91.495, 91.77, 91.99, 92.55, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6s5cm1448233833.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.343093 8.05 4.270 [2,] 3.425375 8.20 4.890 [3,] 3.950313 8.91 6.185 [4,] 4.041002 9.47 6.460 [5,] 4.247619 9.86 6.920 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.669521 8.330744 5.468912 [2,] 4.231104 9.489256 6.901088 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.34309287935588, 3.42537509986648, 3.95031269318362, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19k771448233833.ps tmp/19k771448233833.png",intern=TRUE)) character(0) > try(system("convert tmp/2slot1448233833.ps tmp/2slot1448233833.png",intern=TRUE)) character(0) > try(system("convert tmp/32ztt1448233833.ps tmp/32ztt1448233833.png",intern=TRUE)) character(0) > try(system("convert tmp/4mxpz1448233833.ps tmp/4mxpz1448233833.png",intern=TRUE)) character(0) > try(system("convert tmp/5p1c91448233833.ps tmp/5p1c91448233833.png",intern=TRUE)) character(0) > try(system("convert tmp/6s5cm1448233833.ps tmp/6s5cm1448233833.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.142 0.409 2.575