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(94.9,95.8,98.8,100.6,100.6,100.1,99.4,99.9,101,100.4,101.6,106.8,109.3,112.6,118.8,121.9,118.3,117.9,119.2,116.3,119.2,118.7,120.3,120.5,124.3,128.3,131.4,130.3,126.6,121.8,125.1,128.5,129.5,128.5,127.2,126.2,125.9,127.3,125.7,122.5,121.3,121.5,123.4,121.6,121.8,118.9,118.7,119.8,118.5,118.9,117.4,116,115.5,116.5,114.9,113.9,114.3,112,108,97.7) > 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,] 94.9 109.3 124.3 125.9 118.5 NA [2,] 95.8 112.6 128.3 127.3 118.9 NA [3,] 98.8 118.8 131.4 125.7 117.4 NA [4,] 100.6 121.9 130.3 122.5 116.0 NA [5,] 100.6 118.3 126.6 121.3 115.5 NA [6,] 100.1 117.9 121.8 121.5 116.5 NA [7,] 99.4 119.2 125.1 123.4 114.9 NA [8,] 99.9 116.3 128.5 121.6 113.9 NA [9,] 101.0 119.2 129.5 121.8 114.3 NA [10,] 100.4 118.7 128.5 118.9 112.0 NA [11,] 101.6 120.3 127.2 118.7 108.0 NA [12,] 106.8 120.5 126.2 119.8 97.7 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/1iof51448214538.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/2p0pq1448214538.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/34z771448214538.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/4v2oi1448214538.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] [,12] [1,] 94.9 95.8 117.4 116.0 115.5 116.5 114.9 113.9 114.3 112.0 101.6 97.7 [2,] 109.3 112.6 117.4 116.0 115.5 116.5 114.9 113.9 114.3 112.0 108.0 106.8 [3,] 118.5 118.9 118.8 121.9 118.3 117.9 119.2 116.3 119.2 118.7 118.7 119.8 [4,] 124.3 127.3 125.7 122.5 121.3 121.5 123.4 121.6 121.8 118.9 120.3 120.5 [5,] 125.9 128.3 131.4 130.3 126.6 121.8 125.1 128.5 129.5 128.5 127.2 126.2 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.901 108.513 112.9352 117.3071 114.2017 114.367 113.1939 110.8592 [2,] 129.099 129.287 124.6648 126.4929 122.3983 121.433 125.2061 121.7408 [,9] [,10] [,11] [,12] [1,] 113.9005 113.8245 110.0089 110.1196 [2,] 124.4995 123.5755 127.3911 129.4804 $out [1] 98.8 100.6 100.6 100.1 99.4 99.9 101.0 100.4 $group [1] 3 4 5 6 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.9, 109.3, 118.5, 124.3, 125.9, 95.8, 112.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yfpf1448214538.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,] 98.80 116.30 121.80 118.70 108.00 NA [2,] 99.10 117.10 125.65 120.55 112.95 NA [3,] 100.25 118.75 127.75 121.70 115.20 NA [4,] 100.80 119.75 129.00 124.55 116.95 NA [5,] 101.60 121.90 131.40 127.30 118.90 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 99.47462 117.5413 126.222 119.8756 113.3756 NA [2,] 101.02538 119.9587 129.278 123.5244 117.0244 NA $out [1] 94.9 95.8 106.8 109.3 112.6 97.7 $group [1] 1 1 1 2 2 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(98.8, 99.1, 100.25, 100.8, 101.6, 116.3, 117.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fs591448214538.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,] 8.938568 21.70 5.0 [2,] 10.264169 25.85 6.7 [3,] 10.598346 28.50 8.0 [4,] 11.982972 30.35 13.0 [5,] 13.278818 32.60 15.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.814389 26.44752 5.126528 [2,] 11.382303 30.55248 10.873472 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.93856811799295, 10.2641692876911, 10.5983460030549, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1iof51448214538.ps tmp/1iof51448214538.png",intern=TRUE)) character(0) > try(system("convert tmp/2p0pq1448214538.ps tmp/2p0pq1448214538.png",intern=TRUE)) character(0) > try(system("convert tmp/34z771448214538.ps tmp/34z771448214538.png",intern=TRUE)) character(0) > try(system("convert tmp/4v2oi1448214538.ps tmp/4v2oi1448214538.png",intern=TRUE)) character(0) > try(system("convert tmp/5yfpf1448214538.ps tmp/5yfpf1448214538.png",intern=TRUE)) character(0) > try(system("convert tmp/6fs591448214538.ps tmp/6fs591448214538.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.166 0.416 2.601