R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(323898,323268,322574,321304,334352,333712,323898,317374,318014,318014,318646,319980,319980,314086,311490,314086,323268,321934,309526,299020,297054,293126,295784,299020,297748,295090,289900,295090,299712,298380,283312,276788,270264,265010,264380,268300,263046,261082,259118,270264,271536,265010,247340,239490,227082,221820,224416,228344,228344,225118,224416,234930,243420,239490,226380,219864,206122,197634,204158,210682,210682,202194,201562,212638,219864,217260,204158,195670,177304,170150,172744,183892,184522,168184,174078,188452,194976,191046,173384,160968,146594,135448,140008,149820,147226,132852,137412,151786,159642,155082,137412,129564,117786,105368,107332,117146,118416,106638,108604,125004,128924,122346,98150,85742,69342,53004,58258,65412,64150,51670,58888,76560,84408,80488,64782,52372,39262,24186,26854,31414) > 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] [1,] 323898 319980 297748 263046 228344 210682 184522 147226 118416 64150 [2,] 323268 314086 295090 261082 225118 202194 168184 132852 106638 51670 [3,] 322574 311490 289900 259118 224416 201562 174078 137412 108604 58888 [4,] 321304 314086 295090 270264 234930 212638 188452 151786 125004 76560 [5,] 334352 323268 299712 271536 243420 219864 194976 159642 128924 84408 [6,] 333712 321934 298380 265010 239490 217260 191046 155082 122346 80488 [7,] 323898 309526 283312 247340 226380 204158 173384 137412 98150 64782 [8,] 317374 299020 276788 239490 219864 195670 160968 129564 85742 52372 [9,] 318014 297054 270264 227082 206122 177304 146594 117786 69342 39262 [10,] 318014 293126 265010 221820 197634 170150 135448 105368 53004 24186 [11,] 318646 295784 264380 224416 204158 172744 140008 107332 58258 26854 [12,] 319980 299020 268300 228344 210682 183892 149820 117146 65412 31414 [,11] [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/1bdur1374831696.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/2z1a51374831696.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/3pk0i1374831696.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/4skv91374831696.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] [1,] 64150 51670 58888 76560 84408 80488 64782 52372 39262 24186 [2,] 147226 132852 137412 151786 159642 155082 137412 129564 117786 105368 [3,] 219513 213656 212989 223784 231642 228375 215269 207767 191713 183892 [4,] 297748 295090 289900 295090 299712 298380 283312 276788 270264 265010 [5,] 323898 323268 322574 321304 334352 333712 323898 317374 318014 318014 [,11] [,12] [1,] 26854 31414 [2,] 107332 117146 [3,] 188451 197287 [4,] 264380 268300 [5,] 318646 319980 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 144306.2 132595.4 136799.9 152183.6 161657.4 156777.6 142371.5 134208 [2,] 294719.8 294716.6 289178.1 295384.4 301626.6 299972.4 288166.5 281326 [,9] [,10] [,11] [,12] [1,] 115528.9 104128.5 109983.6 121764.4 [2,] 267897.1 263655.5 266918.4 272809.6 $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(64150, 147226, 219513, 297748, 323898, 51670, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nlz91374831696.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,] 317374 293126 264380 221820 197634 170150 135448 105368 53004 24186 NA [2,] 318330 298037 269282 227713 208402 180598 148207 117466 67377 35338 NA [3,] 321939 310508 286606 253229 224767 201878 170784 135132 102394 55630 NA [4,] 323898 317033 296419 264028 231637 211660 186487 149506 120381 70671 NA [5,] 323898 323268 299712 271536 243420 219864 194976 159642 128924 84408 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 319399.4 301843.8 274228.6 236665.5 214169.4 187710.4 153324.2 120518.3 [2,] 324478.6 319172.2 298983.4 269792.5 235364.6 216045.6 188243.8 149745.7 [,9] [,10] [,11] [1,] 78218.52 39514.38 NA [2,] 126569.48 71745.62 NA $out [1] 334352 333712 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(317374, 318330, 321939, 323898, 323898, 293126, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6li3w1374831696.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,] 83529.56 244744 124192.5 [2,] 86817.81 256170 127922.5 [3,] 89578.92 264344 132759.5 [4,] 95660.57 283659 137257.0 [5,] 99534.12 293828 144903.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 85545.68 251806.1 128502 [2,] 93612.16 276881.9 137017 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(83529.5582868723, 86817.8094080591, 89578.9179042896, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bdur1374831696.ps tmp/1bdur1374831696.png",intern=TRUE)) character(0) > try(system("convert tmp/2z1a51374831696.ps tmp/2z1a51374831696.png",intern=TRUE)) character(0) > try(system("convert tmp/3pk0i1374831696.ps tmp/3pk0i1374831696.png",intern=TRUE)) character(0) > try(system("convert tmp/4skv91374831696.ps tmp/4skv91374831696.png",intern=TRUE)) character(0) > try(system("convert tmp/5nlz91374831696.ps tmp/5nlz91374831696.png",intern=TRUE)) character(0) > try(system("convert tmp/6li3w1374831696.ps tmp/6li3w1374831696.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.279 0.987 5.256