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(507,233,346,159,225,146,253,169,246,129,318,378,580,336,468,229,189,181,210,270,229,319,377,275,365,269,377,194,337,212,278,197,305,343,588,382,266,305,345,249,253,167,149,286,260,375,339,322,396,421,254,279,347,264,324,243,324,420,295,731,576,391,229,347,262,317,249,211,303,337,383,588,456,375,507,405,363,394,166,217,299,549,395,730) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 507 580 365 266 396 576 456 NA [2,] 233 336 269 305 421 391 375 NA [3,] 346 468 377 345 254 229 507 NA [4,] 159 229 194 249 279 347 405 NA [5,] 225 189 337 253 347 262 363 NA [6,] 146 181 212 167 264 317 394 NA [7,] 253 210 278 149 324 249 166 NA [8,] 169 270 197 286 243 211 217 NA [9,] 246 229 305 260 324 303 299 NA [10,] 129 319 343 375 420 337 549 NA [11,] 318 377 588 339 295 383 395 NA [12,] 378 275 382 322 731 588 730 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/14w7x1426093189.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/2ivi61426093189.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/35g9r1426093189.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/4nsfz1426093189.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,] 266.0 233 229.0 159.0 189 146.0 149.0 169.0 229 319.0 295.0 275 [2,] 380.5 287 299.5 211.5 239 174.0 188.0 204.0 253 328.0 328.5 350 [3,] 456.0 336 346.0 249.0 262 212.0 249.0 217.0 299 343.0 377.0 382 [4,] 541.5 383 422.5 313.0 342 290.5 265.5 256.5 304 397.5 389.0 659 [5,] 580.0 421 507.0 405.0 363 394.0 324.0 286.0 324 420.0 395.0 731 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 359.8534 278.6703 272.5464 188.3858 200.4901 142.4281 202.7183 185.6478 [2,] 552.1466 393.3297 419.4536 309.6142 323.5099 281.5719 295.2817 248.3522 [,9] [,10] [,11] [,12] [1,] 268.5436 301.4957 340.8704 197.4702 [2,] 329.4564 384.5043 413.1296 566.5298 $out [1] 129 549 588 $group [1] 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(266, 380.5, 456, 541.5, 580, 233, 287, 336, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59w5j1426093189.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] [1,] 129.0 181.0 194.0 149.0 243.0 211.0 166.0 NA [2,] 164.0 219.5 240.5 251.0 271.5 255.5 331.0 NA [3,] 239.5 272.5 321.0 276.0 324.0 327.0 394.5 NA [4,] 332.0 356.5 371.0 330.5 408.0 387.0 481.5 NA [5,] 507.0 468.0 382.0 375.0 421.0 576.0 549.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 162.8741 210.0134 261.4781 239.7395 261.7414 267.022 325.8559 NA [2,] 316.1259 334.9866 380.5219 312.2605 386.2586 386.978 463.1441 NA $out [1] 580 588 731 588 730 $group [1] 2 3 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(129, 164, 239.5, 332, 507, 181, 219.5, 272.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6p5hx1426093189.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,] 35.59695 95.0 51.00 [2,] 64.49039 174.5 65.00 [3,] 88.00706 247.0 98.75 [4,] 108.73505 303.5 119.75 [5,] 125.88146 456.0 161.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 67.82678 188.1622 73.77816 [2,] 108.18735 305.8378 123.72184 $out [1] 193.1578 309.0000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(35.5969501101268, 64.4903863299339, 88.0070627924243, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14w7x1426093189.ps tmp/14w7x1426093189.png",intern=TRUE)) character(0) > try(system("convert tmp/2ivi61426093189.ps tmp/2ivi61426093189.png",intern=TRUE)) character(0) > try(system("convert tmp/35g9r1426093189.ps tmp/35g9r1426093189.png",intern=TRUE)) character(0) > try(system("convert tmp/4nsfz1426093189.ps tmp/4nsfz1426093189.png",intern=TRUE)) character(0) > try(system("convert tmp/59w5j1426093189.ps tmp/59w5j1426093189.png",intern=TRUE)) character(0) > try(system("convert tmp/6p5hx1426093189.ps tmp/6p5hx1426093189.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.129 0.388 2.529