R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(6.3,6.2,6.2,6.3,6.5,6.5,6.2,6.2,6.2,6.1,6.1,6.2,6.1,6.1,6.2,6.2,6.4,6.2,5.7,5.7,5.7,5.9,6,6.3,6.4,6.5,6.8,7,7.3,7.4,6.9,6.9,7,7.1,7.2,7.1,6.8,6.5,6.4,6.5,6.7,6.6,6.2,6.2,6.5,6.8,6.8,6.5,5.9,5.5,5.6,6,6.3,6.2,5.6,5.4,5.7,5.9,6.2,6.3,6.1,5.9,5.9,5.7,5.9,6.1,6.1,6.5,6.8,6.8,6.9,6.9,6.8,6.6,6.5,6.5) > 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] 76 > (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] 7 7 7 7 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6.3 6.1 6.4 6.8 5.9 6.1 6.8 [2,] 6.2 6.1 6.5 6.5 5.5 5.9 6.6 [3,] 6.2 6.2 6.8 6.4 5.6 5.9 6.5 [4,] 6.3 6.2 7.0 6.5 6.0 5.7 6.5 [5,] 6.5 6.4 7.3 6.7 6.3 5.9 NA [6,] 6.5 6.2 7.4 6.6 6.2 6.1 NA [7,] 6.2 5.7 6.9 6.2 5.6 6.1 NA [8,] 6.2 5.7 6.9 6.2 5.4 6.5 NA [9,] 6.2 5.7 7.0 6.5 5.7 6.8 NA [10,] 6.1 5.9 7.1 6.8 5.9 6.8 NA [11,] 6.1 6.0 7.2 6.8 6.2 6.9 NA [12,] 6.2 6.3 7.1 6.5 6.3 6.9 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/fisher/rcomp/tmp/1lsqe1367672405.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/fisher/rcomp/tmp/24o6w1367672405.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/fisher/rcomp/tmp/3k0rr1367672405.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/fisher/rcomp/tmp/4n73q1367672405.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,] 5.9 5.5 5.60 5.7 5.90 6.10 5.60 5.4 5.70 5.90 6.0 6.2 [2,] 6.1 6.0 6.05 6.1 6.30 6.20 5.70 5.7 5.70 5.90 6.1 6.3 [3,] 6.3 6.2 6.20 6.3 6.45 6.35 6.15 6.2 6.35 6.45 6.5 6.4 [4,] 6.6 6.5 6.45 6.5 6.70 6.60 6.20 6.5 6.80 6.80 6.9 6.9 [5,] 6.8 6.6 6.80 7.0 7.30 6.60 6.90 6.9 7.00 7.10 7.2 7.1 $n [1] 7 7 7 7 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6.001408 5.901408 5.961126 6.061126 6.191987 6.091987 5.827484 5.683974 [2,] 6.598592 6.498592 6.438874 6.538874 6.708013 6.608013 6.472516 6.716026 [,9] [,10] [,11] [,12] [1,] 5.640464 5.869471 5.983974 6.012981 [2,] 7.059536 7.030529 7.016026 6.787019 $out [1] 7.4 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5.9, 6.1, 6.3, 6.6, 6.8, 5.5, 6, 6.2, 6.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5bh8s1367672405.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,] 6.1 5.7 6.40 6.20 5.4 5.7 6.50 [2,] 6.2 5.8 6.85 6.45 5.6 5.9 6.50 [3,] 6.2 6.1 7.00 6.50 5.9 6.1 6.55 [4,] 6.3 6.2 7.15 6.75 6.2 6.8 6.70 [5,] 6.3 6.4 7.40 6.80 6.3 6.9 6.80 $n [1] 12 12 12 12 12 12 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6.154389 5.917557 6.863168 6.363168 5.626336 5.689504 6.392 [2,] 6.245611 6.282443 7.136832 6.636832 6.173664 6.510496 6.708 $out [1] 6.5 6.5 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(6.1, 6.2, 6.2, 6.3, 6.3, 5.7, 5.8, 6.1, 6.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6d1qp1367672405.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,] 0.3505098 1.10 0.325 [2,] 0.3940022 1.15 0.400 [3,] 0.4643943 1.25 0.500 [4,] 0.5122722 1.30 0.675 [5,] 0.5492419 1.50 0.900 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.4104505 1.181584 0.3745707 [2,] 0.5183380 1.318416 0.6254293 $out [1] 0.9 0.9 $group [1] 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.350509832753866, 0.39400219550212, 0.4643942611422, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lsqe1367672405.ps tmp/1lsqe1367672405.png",intern=TRUE)) character(0) > try(system("convert tmp/24o6w1367672405.ps tmp/24o6w1367672405.png",intern=TRUE)) character(0) > try(system("convert tmp/3k0rr1367672405.ps tmp/3k0rr1367672405.png",intern=TRUE)) character(0) > try(system("convert tmp/4n73q1367672405.ps tmp/4n73q1367672405.png",intern=TRUE)) character(0) > try(system("convert tmp/5bh8s1367672405.ps tmp/5bh8s1367672405.png",intern=TRUE)) character(0) > try(system("convert tmp/6d1qp1367672405.ps tmp/6d1qp1367672405.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.919 0.452 3.360