R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(254,200,165,123,162,145,145,161,155,173,160,47,232,143,161,159,243,192,157,143,221,227,132,41,273,182,188,162,140,186,178,236,202,184,119,16,340,151,240,235,174,309,174,207,209,171,117,10,339,139,186,155,153,222,102,107,188,162,185,24,394,209,248,254,202,258,215,309,240,258,276,48,455,345,311,346,310,297,300,274,292,304,186,14,321,206,160,217,204,246,234,175,364,328,158,40,556,193,221,278,230,253,240,252,228,306,206,48,557,279,399,364,306,471,293,333,316,329,265,61,679,428,394,352,387,590,177,199,203,255,261,115,537,172,425,244,313,335,222,223,179,335,286,154,443,165,275,304,303,342,322,291,300,491,266,176) > 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] 156 > (np <- floor(n / par1)) [1] 13 > 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] 13 13 13 13 13 13 13 13 13 13 13 13 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 254 232 273 340 339 394 455 321 556 557 679 537 443 [2,] 200 143 182 151 139 209 345 206 193 279 428 172 165 [3,] 165 161 188 240 186 248 311 160 221 399 394 425 275 [4,] 123 159 162 235 155 254 346 217 278 364 352 244 304 [5,] 162 243 140 174 153 202 310 204 230 306 387 313 303 [6,] 145 192 186 309 222 258 297 246 253 471 590 335 342 [7,] 145 157 178 174 102 215 300 234 240 293 177 222 322 [8,] 161 143 236 207 107 309 274 175 252 333 199 223 291 [9,] 155 221 202 209 188 240 292 364 228 316 203 179 300 [10,] 173 227 184 171 162 258 304 328 306 329 255 335 491 [11,] 160 132 119 117 185 276 186 158 206 265 261 286 266 [12,] 47 41 16 10 24 48 14 40 48 61 115 154 176 [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1o3c01447858519.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/2wyro1447858519.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/3dlit1447858519.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/4kgts1447858519.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,] 232 139 160 123 140 145 102 107 155 162 117 10 [2,] 321 165 186 162 174 222 174 175 202 184 158 24 [3,] 394 193 240 244 230 258 215 223 221 258 186 47 [4,] 537 209 311 304 306 335 240 274 292 328 265 61 [5,] 679 209 425 364 387 471 322 333 364 491 286 115 $n [1] 13 13 13 13 13 13 13 13 13 13 13 13 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 299.346 173.7186 185.2234 181.7737 172.1559 208.4819 186.0779 179.6169 [2,] 488.654 212.2814 294.7766 306.2263 287.8441 307.5181 243.9221 266.3831 [,9] [,10] [,11] [,12] [1,] 181.5608 194.8973 139.1112 30.78611 [2,] 260.4392 321.1027 232.8888 63.21389 $out [1] 345 279 428 590 154 176 $group [1] 2 2 2 6 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(232, 321, 394, 537, 679, 139, 165, 193, 209, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5r5ct1447858519.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] [,12] [,13] [1,] 123.0 41 119 117.0 102.0 202 274 40.0 193.0 265.0 115.0 154.0 266.0 [2,] 145.0 143 151 161.0 123.0 212 283 167.5 213.5 286.0 201.0 200.5 270.5 [3,] 160.5 160 183 190.5 158.5 251 302 211.5 235.0 322.5 306.5 265.0 301.5 [4,] 169.0 224 195 237.5 187.0 267 328 283.5 265.5 381.5 411.0 335.0 332.0 [5,] 200.0 243 236 340.0 222.0 309 346 364.0 306.0 471.0 679.0 425.0 342.0 [,14] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 149.5534 123.0554 162.9313 155.6078 129.3092 225.9141 281.4752 158.5916 [2,] 171.4466 196.9446 203.0687 225.3922 187.6908 276.0859 322.5248 264.4084 [,9] [,10] [,11] [,12] [,13] [,14] [1,] 211.2825 278.9418 210.7176 203.6536 273.4494 NA [2,] 258.7175 366.0582 402.2824 326.3464 329.5506 NA $out [1] 254 47 273 16 10 339 24 394 48 455 186 14 556 48 557 61 537 443 165 [20] 491 176 $group [1] 1 1 3 3 4 5 5 6 6 7 7 7 9 9 10 10 12 13 13 13 13 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" NA Warning message: In bxp(list(stats = c(123, 145, 160.5, 169, 200, 41, 143, 160, 224, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6f5mw1447858519.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,] 53.51707 166.0 37 [2,] 64.07320 214.5 78 [3,] 78.93349 244.0 110 [4,] 93.91268 309.0 137 [5,] 137.61168 447.0 216 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 65.32350 200.8979 83.0897 [2,] 92.54347 287.1021 136.9103 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(53.5170713238021, 64.0732023268023, 78.9334888763403, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o3c01447858519.ps tmp/1o3c01447858519.png",intern=TRUE)) character(0) > try(system("convert tmp/2wyro1447858519.ps tmp/2wyro1447858519.png",intern=TRUE)) character(0) > try(system("convert tmp/3dlit1447858519.ps tmp/3dlit1447858519.png",intern=TRUE)) character(0) > try(system("convert tmp/4kgts1447858519.ps tmp/4kgts1447858519.png",intern=TRUE)) character(0) > try(system("convert tmp/5r5ct1447858519.ps tmp/5r5ct1447858519.png",intern=TRUE)) character(0) > try(system("convert tmp/6f5mw1447858519.ps tmp/6f5mw1447858519.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.095 0.355 2.470