R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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(125,123,117,114,111,112,144,150,149,134,123,116,117,111,105,102,95,93,124,130,124,115,106,105,105,101,95,93,84,87,116,120,117,109,105,107,109,109,108,107,99,103,131,137,135,124,118,121,121,118,113,107,100,102,130,136,133,120,112,109,110,106,102,98,92,92,120,127,124,114,108,106) > 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] 72 > (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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 125 117 105 109 121 110 NA [2,] 123 111 101 109 118 106 NA [3,] 117 105 95 108 113 102 NA [4,] 114 102 93 107 107 98 NA [5,] 111 95 84 99 100 92 NA [6,] 112 93 87 103 102 92 NA [7,] 144 124 116 131 130 120 NA [8,] 150 130 120 137 136 127 NA [9,] 149 124 117 135 133 124 NA [10,] 134 115 109 124 120 114 NA [11,] 123 106 105 118 112 108 NA [12,] 116 105 107 121 109 106 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/1udqo1353946782.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/2fdwf1353946782.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/30ud61353946782.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/4mn6l1353946782.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,] 105.0 101 95.0 93.0 84 87.0 116 120 117.0 109.0 105 105 [2,] 109.0 106 102.0 98.0 92 92.0 120 127 124.0 114.0 106 106 [3,] 113.5 110 106.5 104.5 97 97.5 127 133 128.5 117.5 110 108 [4,] 121.0 118 113.0 107.0 100 103.0 131 137 135.0 124.0 118 116 [5,] 125.0 123 117.0 114.0 111 112.0 144 150 149.0 134.0 123 121 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 105.7596 102.2596 99.40464 98.69471 91.83974 90.40464 119.9046 [2,] 121.2404 117.7404 113.59536 110.30529 102.16026 104.59536 134.0954 [,8] [,9] [,10] [,11] [,12] [1,] 126.5497 121.4046 111.0497 102.2596 101.5497 [2,] 139.4503 135.5954 123.9503 117.7404 114.4503 $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(105, 109, 113.5, 121, 125, 101, 106, 110, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5nqve1353946782.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,] 111 93.0 84.0 99.0 100.0 92 NA [2,] 115 103.5 94.0 107.5 108.0 100 NA [3,] 123 108.5 105.0 113.5 115.5 107 NA [4,] 139 120.5 112.5 127.5 125.5 117 NA [5,] 150 130.0 120.0 137.0 136.0 127 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 112.0534 100.7462 96.56203 104.3779 107.5181 99.24619 NA [2,] 133.9466 116.2538 113.43797 122.6221 123.4819 114.75381 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(111, 115, 123, 139, 150, 93, 103.5, 108.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/65z9w1353946782.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,] 6.408328 16.0 7.000 [2,] 7.594671 20.5 8.375 [3,] 8.431747 23.5 9.250 [4,] 9.533524 27.5 10.250 [5,] 11.272385 32.0 10.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.547423 20.30725 8.3948 [2,] 9.316071 26.69275 10.1052 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.40832791503889, 7.5946706206157, 8.43174717682428, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1udqo1353946782.ps tmp/1udqo1353946782.png",intern=TRUE)) character(0) > try(system("convert tmp/2fdwf1353946782.ps tmp/2fdwf1353946782.png",intern=TRUE)) character(0) > try(system("convert tmp/30ud61353946782.ps tmp/30ud61353946782.png",intern=TRUE)) character(0) > try(system("convert tmp/4mn6l1353946782.ps tmp/4mn6l1353946782.png",intern=TRUE)) character(0) > try(system("convert tmp/5nqve1353946782.ps tmp/5nqve1353946782.png",intern=TRUE)) character(0) > try(system("convert tmp/65z9w1353946782.ps tmp/65z9w1353946782.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.136 0.762 3.892