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(106,105,104,102,122,121,106,96,97,97,98,100,106,104,107,112,140,140,134,128,133,139,140,143,152,146,146,155,180,182,177,165,174,174,175,180,184,186,186,192,215,221,222,207,215,212,206,219,222,217,218,225,251,264,264,258,267,258,253,272,275,268,286,293,314,328,326,325,333,332,320,338,344,338,363,375,403,414,411,405,410,416,396,412,422,418,444,453,491,498,489,494,497,500,481,499,509,499,528,537,576,582,584,594,594,598,580,589,595,584,616,622,662,669,679,688,689,690,672,690) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 106 106 152 184 222 275 344 422 509 595 NA [2,] 105 104 146 186 217 268 338 418 499 584 NA [3,] 104 107 146 186 218 286 363 444 528 616 NA [4,] 102 112 155 192 225 293 375 453 537 622 NA [5,] 122 140 180 215 251 314 403 491 576 662 NA [6,] 121 140 182 221 264 328 414 498 582 669 NA [7,] 106 134 177 222 264 326 411 489 584 679 NA [8,] 96 128 165 207 258 325 405 494 594 688 NA [9,] 97 133 174 215 267 333 410 497 594 689 NA [10,] 97 139 174 212 258 332 416 500 598 690 NA [11,] 98 140 175 206 253 320 396 481 580 672 NA [12,] 100 143 180 219 272 338 412 499 589 690 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/141j31407923469.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/28jt71407923469.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/3kzn01407923469.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/4k90q1407923469.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,] 106.0 104.0 104 102 122.0 121 106 96.0 97 97 98.0 100 [2,] 152.0 146.0 146 155 180.0 182 177 165.0 174 174 175.0 180 [3,] 248.5 242.5 252 259 282.5 296 295 291.5 300 295 286.5 305 [4,] 422.0 418.0 444 453 491.0 498 489 494.0 497 500 481.0 499 [5,] 595.0 584.0 616 622 662.0 669 679 688.0 689 690 672.0 690 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 113.5972 106.598 103.1073 110.1073 127.112 138.1138 139.1124 127.1185 [2,] 383.4028 378.402 400.8927 407.8927 437.888 453.8862 450.8876 455.8815 [,9] [,10] [,11] [,12] [1,] 138.6163 132.1174 133.6102 145.6149 [2,] 461.3837 457.8826 439.3898 464.3851 $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(106, 152, 248.5, 422, 595, 104, 146, 242.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pdrw1407923469.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] [1,] 96.0 104.0 146.0 184.0 217.0 268.0 338.0 418.0 499.0 584.0 NA [2,] 97.5 109.5 153.5 189.0 223.5 289.5 369.0 448.5 532.5 619.0 NA [3,] 103.0 133.5 174.0 209.5 255.5 322.5 404.0 490.0 581.0 670.5 NA [4,] 106.0 140.0 178.5 217.0 264.0 330.0 411.5 497.5 591.5 688.5 NA [5,] 106.0 143.0 182.0 222.0 272.0 338.0 416.0 500.0 598.0 690.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 99.12309 119.5887 162.5973 196.729 237.0277 304.0277 384.6155 467.6508 [2,] 106.87691 147.4113 185.4027 222.271 273.9723 340.9723 423.3845 512.3492 [,9] [,10] [,11] [1,] 554.0897 638.8006 NA [2,] 607.9103 702.1994 NA $out [1] 122 121 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(96, 97.5, 103, 106, 106, 104, 109.5, 133.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ykp81407923469.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,] 168.2817 480.0 242.00 [2,] 182.1463 516.0 268.50 [3,] 193.2320 560.5 280.75 [4,] 200.3256 591.0 289.25 [5,] 203.6184 593.0 296.25 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 184.9403 526.292 271.2858 [2,] 201.5237 594.708 290.2142 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(168.281675241906, 182.146345403534, 193.231976517319, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/141j31407923469.ps tmp/141j31407923469.png",intern=TRUE)) character(0) > try(system("convert tmp/28jt71407923469.ps tmp/28jt71407923469.png",intern=TRUE)) character(0) > try(system("convert tmp/3kzn01407923469.ps tmp/3kzn01407923469.png",intern=TRUE)) character(0) > try(system("convert tmp/4k90q1407923469.ps tmp/4k90q1407923469.png",intern=TRUE)) character(0) > try(system("convert tmp/5pdrw1407923469.ps tmp/5pdrw1407923469.png",intern=TRUE)) character(0) > try(system("convert tmp/6ykp81407923469.ps tmp/6ykp81407923469.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.162 0.309 2.491