R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(82,80,76,73,70,68,67,64,69,69,67,57,67,69,67,66,65,56,57,53,58,59,60,59,65,62,61,62,57,51,45,46,48,49,48,43,51,54,57,60,58,61,62,62,64,68,70,73,79,84,82,78,78,76,73,71,71,70,74,72,80,80,80,79,82,71,75,74,76,82,85,82,92,93,93,99,98,89,96,94,99,108,113,115,126,131,134,134,137,139,139,134,133,135,130,133) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 82 67 65 51 79 80 92 126 NA [2,] 80 69 62 54 84 80 93 131 NA [3,] 76 67 61 57 82 80 93 134 NA [4,] 73 66 62 60 78 79 99 134 NA [5,] 70 65 57 58 78 82 98 137 NA [6,] 68 56 51 61 76 71 89 139 NA [7,] 67 57 45 62 73 75 96 139 NA [8,] 64 53 46 62 71 74 94 134 NA [9,] 69 58 48 64 71 76 99 133 NA [10,] 69 59 49 68 70 82 108 135 NA [11,] 67 60 48 70 74 85 113 130 NA [12,] 57 59 43 73 72 82 115 133 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/157f31416479173.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/27zjt1416479173.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/3vdcs1416479173.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/49saa1416479173.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,] 51.0 54.0 57.0 60.0 57.0 51.0 45.0 46.0 48.0 49.0 48.0 43.0 [2,] 66.0 65.5 64.0 64.0 61.5 58.5 59.5 57.5 61.0 63.5 63.5 58.0 [3,] 79.5 80.0 78.0 75.5 74.0 69.5 70.0 67.5 70.0 69.5 72.0 72.5 [4,] 87.0 88.5 87.5 89.0 90.0 82.5 85.5 84.0 87.5 95.0 99.0 98.5 [5,] 92.0 93.0 93.0 99.0 98.0 89.0 96.0 94.0 99.0 135.0 130.0 133.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 67.7691 67.15187 64.87256 61.53464 58.07949 56.09326 55.47603 52.69672 [2,] 91.2309 92.84813 91.12744 89.46536 89.92051 82.90674 84.52397 82.30328 [,9] [,10] [,11] [,12] [1,] 55.19672 51.90365 52.16919 49.87612 [2,] 84.80328 87.09635 91.83081 95.12388 $out [1] 126 131 134 134 137 139 139 134 133 $group [1] 1 2 3 4 5 6 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(51, 66, 79.5, 87, 92, 54, 65.5, 80, 88.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zmi71416479173.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] [1,] 57.0 53.0 43.0 51.0 70.0 71.0 89.0 126 NA [2,] 67.0 57.5 47.0 57.5 71.5 75.5 93.0 132 NA [3,] 69.0 59.5 50.0 61.5 75.0 80.0 97.0 134 NA [4,] 74.5 66.5 61.5 66.0 78.5 82.0 103.5 136 NA [5,] 82.0 69.0 65.0 73.0 84.0 85.0 115.0 139 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 65.5792 55.39504 43.38645 57.62309 71.80725 77.03531 92.21088 132.1756 [2,] 72.4208 63.60496 56.61355 65.37691 78.19275 82.96469 101.78912 135.8244 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(57, 67, 69, 74.5, 82, 53, 57.5, 59.5, 66.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hpgd1416479173.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,] 22.35908 74.0 18.000 [2,] 24.47617 77.0 19.125 [3,] 27.29067 83.5 19.375 [4,] 28.10139 88.0 22.750 [5,] 30.43846 94.0 26.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 25.63719 78.48283 17.72161 [2,] 28.94416 88.51717 21.02839 $out [1] 31.75 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(22.3590825265388, 24.4761732485715, 27.2906726729135, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/157f31416479173.ps tmp/157f31416479173.png",intern=TRUE)) character(0) > try(system("convert tmp/27zjt1416479173.ps tmp/27zjt1416479173.png",intern=TRUE)) character(0) > try(system("convert tmp/3vdcs1416479173.ps tmp/3vdcs1416479173.png",intern=TRUE)) character(0) > try(system("convert tmp/49saa1416479173.ps tmp/49saa1416479173.png",intern=TRUE)) character(0) > try(system("convert tmp/5zmi71416479173.ps tmp/5zmi71416479173.png",intern=TRUE)) character(0) > try(system("convert tmp/6hpgd1416479173.ps tmp/6hpgd1416479173.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.075 0.348 2.448