R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(80,80,80,80,80,80,80,80,80,80,80,80,80,80,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,110,110,110,110,110,110,110,110,110,110,110,110,110,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,200,210) > 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] 153 > (np <- floor(n / par1)) [1] 12 > 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] 13 13 13 13 13 13 13 13 13 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 80 80 85 90 90 90 90 90 90 100 110 120 120 [2,] 80 80 85 90 90 90 90 90 90 100 110 120 120 [3,] 80 85 85 90 90 90 90 90 90 100 110 120 120 [4,] 80 85 85 90 90 90 90 90 90 100 110 120 120 [5,] 80 85 85 90 90 90 90 90 90 100 110 120 120 [6,] 80 85 85 90 90 90 90 90 90 100 110 120 120 [7,] 80 85 85 90 90 90 90 90 100 100 110 120 120 [8,] 80 85 85 90 90 90 90 90 100 100 110 120 200 [9,] 80 85 85 90 90 90 90 90 100 100 110 120 210 [10,] 80 85 85 90 90 90 90 90 100 110 110 120 NA [11,] 80 85 85 90 90 90 90 90 100 110 120 120 NA [12,] 80 85 85 90 90 90 90 90 100 110 120 120 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/1j2tx1389585613.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/243e51389585613.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/3y64r1389585613.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/4k7sh1389585613.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,] 80 80 80 80 80 80 80 80 80 80.0 80.0 80.0 [2,] 90 90 90 90 90 90 90 90 90 87.5 87.5 87.5 [3,] 90 90 90 90 90 90 90 90 90 90.0 90.0 90.0 [4,] 100 100 100 100 100 100 100 100 100 105.0 105.0 105.0 [5,] 110 110 110 110 110 110 110 110 110 120.0 120.0 120.0 $n [1] 13 13 13 13 13 13 13 13 13 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.61787 85.61787 85.61787 85.61787 85.61787 85.61787 85.61787 85.61787 [2,] 94.38213 94.38213 94.38213 94.38213 94.38213 94.38213 94.38213 94.38213 [,9] [,10] [,11] [,12] [1,] 85.61787 82.01813 82.01813 82.01813 [2,] 94.38213 97.98187 97.98187 97.98187 $out [1] 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 200 120 210 $group [1] 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(80, 90, 90, 100, 110, 80, 90, 90, 100, 110, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s92l1389585613.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] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 80 85 85 90 90 90 90 90 90 100 110 120 120 [2,] 80 85 85 90 90 90 90 90 90 100 110 120 120 [3,] 80 85 85 90 90 90 90 90 95 100 110 120 120 [4,] 80 85 85 90 90 90 90 90 100 105 110 120 120 [5,] 80 85 85 90 90 90 90 90 100 110 110 120 120 $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 80 85 85 90 90 90 90 90 90.43893 97.71947 110 120 [2,] 80 85 85 90 90 90 90 90 99.56107 102.28053 110 120 [,13] [1,] 120 [2,] 120 $out [1] 80 80 120 120 200 210 $group [1] 2 2 11 11 13 13 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(80, 80, 80, 80, 80, 85, 85, 85, 85, 85, 85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61u6i1389585613.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,] 13.09482 40 10.000 [2,] 13.14368 40 10.000 [3,] 13.34187 40 10.000 [4,] 13.62373 40 11.875 [5,] 13.62373 40 13.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 13.12292 40 9.1448 [2,] 13.56083 40 10.8552 $out [1] 31.33258 33.94471 12.24745 120.00000 130.00000 $group [1] 1 1 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(13.0948218382061, 13.1436832834792, 13.3418736456029, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1j2tx1389585613.ps tmp/1j2tx1389585613.png",intern=TRUE)) character(0) > try(system("convert tmp/243e51389585613.ps tmp/243e51389585613.png",intern=TRUE)) character(0) > try(system("convert tmp/3y64r1389585613.ps tmp/3y64r1389585613.png",intern=TRUE)) character(0) > try(system("convert tmp/4k7sh1389585613.ps tmp/4k7sh1389585613.png",intern=TRUE)) character(0) > try(system("convert tmp/5s92l1389585613.ps tmp/5s92l1389585613.png",intern=TRUE)) character(0) > try(system("convert tmp/61u6i1389585613.ps tmp/61u6i1389585613.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.427 1.626 9.029