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(219,231,247,259,278,289,252,224,242,303,305,283,259,224,252,273,252,265,285,224,283,279,296,269,252,226,259,301,260,282,311,263,276,296,310,290,273,267,302,322,314,300,316,299,295,340,333,316,294,309,354,335,313,338,357,324,296,378,343,301,309,271,308,326,336,310,335,298,288,319,328,315) > 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,] 219 259 252 273 294 309 NA [2,] 231 224 226 267 309 271 NA [3,] 247 252 259 302 354 308 NA [4,] 259 273 301 322 335 326 NA [5,] 278 252 260 314 313 336 NA [6,] 289 265 282 300 338 310 NA [7,] 252 285 311 316 357 335 NA [8,] 224 224 263 299 324 298 NA [9,] 242 283 276 295 296 288 NA [10,] 303 279 296 340 378 319 NA [11,] 305 296 310 333 343 328 NA [12,] 283 269 290 316 301 315 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/1yj431416487004.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/27gty1416487004.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/3xgzc1416487004.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/4o3001416487004.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,] 219 224 247.0 259.0 252.0 265.0 252.0 224.0 276.0 279 296 269.0 [2,] 252 226 252.0 273.0 260.0 282.0 285.0 224.0 276.0 296 305 283.0 [3,] 266 249 280.5 311.5 295.5 294.5 313.5 280.5 285.5 311 319 295.5 [4,] 294 271 308.0 326.0 314.0 310.0 335.0 299.0 295.0 340 333 315.0 [5,] 309 309 354.0 335.0 336.0 338.0 357.0 324.0 296.0 378 343 316.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 238.9086 219.9735 244.3782 277.3133 260.6683 276.4391 281.2484 232.1226 [2,] 293.0914 278.0265 316.6218 345.6867 330.3317 312.5609 345.7516 328.8774 [,9] [,10] [,11] [,12] [1,] 273.2444 282.6186 300.9391 274.859 [2,] 297.7556 339.3814 337.0609 316.141 $out [1] 242 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(219, 252, 266, 294, 309, 224, 226, 249, 271, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qmpx1416487004.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,] 219.0 224 226.0 267 294.0 271.0 NA [2,] 236.5 252 259.5 297 305.0 303.0 NA [3,] 255.5 267 279.0 308 329.5 312.5 NA [4,] 286.0 281 298.5 319 348.5 327.0 NA [5,] 305.0 296 311.0 340 378.0 336.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 232.9227 253.7729 261.2118 297.9657 309.6594 301.5534 NA [2,] 278.0773 280.2271 296.7882 318.0343 349.3406 323.4466 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(219, 236.5, 255.5, 286, 305, 224, 252, 267, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rf2n1416487004.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,] 18.21446 47.0 15.500 [2,] 22.62726 63.5 26.125 [3,] 32.85249 84.5 37.875 [4,] 36.27452 99.5 47.125 [5,] 41.94759 107.0 65.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26.62789 68.08016 28.29676 [2,] 39.07710 100.91984 47.45324 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(18.2144631177168, 22.6272646686745, 32.8524940313297, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yj431416487004.ps tmp/1yj431416487004.png",intern=TRUE)) character(0) > try(system("convert tmp/27gty1416487004.ps tmp/27gty1416487004.png",intern=TRUE)) character(0) > try(system("convert tmp/3xgzc1416487004.ps tmp/3xgzc1416487004.png",intern=TRUE)) character(0) > try(system("convert tmp/4o3001416487004.ps tmp/4o3001416487004.png",intern=TRUE)) character(0) > try(system("convert tmp/5qmpx1416487004.ps tmp/5qmpx1416487004.png",intern=TRUE)) character(0) > try(system("convert tmp/6rf2n1416487004.ps tmp/6rf2n1416487004.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.126 0.396 2.540