R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(369.82,373.1,374.55,375.01,374.81,375.31,375.31,375.39,375.59,376.26,377.18,377.26,377.26,381.87,387.09,387.14,388.78,389.16,389.16,389.42,389.49,388.97,388.97,389.09,389.09,391.76,390.96,391.76,392.8,393.06,393.06,393.26,393.87,394.47,394.57,394.57,394.57,399.57,406.13,407.03,409.46,409.9,409.9,410.14,410.54,410.69,410.79,410.97,410.97,413.8,423.31,423.85,426.6,426.26,426.26,426.32,427.14,427.55,428.29,428.8,428.8,434.87,435.66,440.75,440.99,441.04,441.04,441.88,441.92,442.48,442.81,442.81) > 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,] 369.82 377.26 389.09 394.57 410.97 428.80 NA [2,] 373.10 381.87 391.76 399.57 413.80 434.87 NA [3,] 374.55 387.09 390.96 406.13 423.31 435.66 NA [4,] 375.01 387.14 391.76 407.03 423.85 440.75 NA [5,] 374.81 388.78 392.80 409.46 426.60 440.99 NA [6,] 375.31 389.16 393.06 409.90 426.26 441.04 NA [7,] 375.31 389.16 393.06 409.90 426.26 441.04 NA [8,] 375.39 389.42 393.26 410.14 426.32 441.88 NA [9,] 375.59 389.49 393.87 410.54 427.14 441.92 NA [10,] 376.26 388.97 394.47 410.69 427.55 442.48 NA [11,] 377.18 388.97 394.57 410.79 428.29 442.81 NA [12,] 377.26 389.09 394.57 410.97 428.80 442.81 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/fisher/rcomp/tmp/1ztnk1366912715.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/fisher/rcomp/tmp/2ikto1366912715.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/fisher/rcomp/tmp/3tu9r1366912715.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/fisher/rcomp/tmp/4o1b51366912715.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,] 369.82 373.100 374.550 375.010 374.81 375.31 375.31 375.39 375.590 376.26 [2,] 377.26 381.870 387.090 387.140 388.78 389.16 389.16 389.42 389.490 388.97 [3,] 391.83 395.665 398.545 399.395 401.13 401.48 401.48 401.70 402.205 402.58 [4,] 410.97 413.800 423.310 423.850 426.60 426.26 426.26 426.32 427.140 427.55 [5,] 428.80 434.870 435.660 440.750 440.99 441.04 441.04 441.88 441.920 442.48 [,11] [,12] [1,] 377.18 377.26 [2,] 388.97 389.09 [3,] 402.68 402.77 [4,] 428.29 428.80 [5,] 442.81 442.81 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 370.086 375.0691 375.1819 375.7159 376.7349 377.5493 377.5493 377.8983 [2,] 413.574 416.2609 421.9081 423.0741 425.5251 425.4107 425.4107 425.5017 [,9] [,10] [,11] [,12] [1,] 377.9195 377.6947 377.3173 377.1558 [2,] 426.4905 427.4653 428.0427 428.3842 $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(369.82, 377.26, 391.83, 410.97, 428.8, 373.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/53ioh1366912715.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,] 373.100 387.090 389.09 406.130 423.310 434.870 NA [2,] 374.680 387.115 391.76 406.580 423.580 438.205 NA [3,] 375.310 388.970 393.06 409.900 426.290 441.040 NA [4,] 375.925 389.160 394.17 410.615 427.345 442.200 NA [5,] 377.260 389.490 394.57 410.970 428.800 442.810 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 374.7421 388.0373 391.9608 408.0596 424.5728 439.2179 NA [2,] 375.8779 389.9027 394.1592 411.7404 428.0072 442.8621 NA $out [1] 369.82 377.26 381.87 394.57 399.57 410.97 413.80 428.80 $group [1] 1 2 2 4 4 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(373.1, 374.68, 375.31, 375.925, 377.26, 387.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/63gkr1366912715.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,] 22.46121 61.11 30.95750 [2,] 23.91550 63.66 31.15375 [3,] 24.77417 65.73 32.03500 [4,] 24.94365 66.20 32.76000 [5,] 25.03087 66.49 33.88250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 24.30523 64.57149 31.30238 [2,] 25.24312 66.88851 32.76762 $out [1] 21.82334 58.98000 26.65250 25.90000 $group [1] 1 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(22.4612087089423, 23.9155024981108, 24.7741720946598, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ztnk1366912715.ps tmp/1ztnk1366912715.png",intern=TRUE)) character(0) > try(system("convert tmp/2ikto1366912715.ps tmp/2ikto1366912715.png",intern=TRUE)) character(0) > try(system("convert tmp/3tu9r1366912715.ps tmp/3tu9r1366912715.png",intern=TRUE)) character(0) > try(system("convert tmp/4o1b51366912715.ps tmp/4o1b51366912715.png",intern=TRUE)) character(0) > try(system("convert tmp/53ioh1366912715.ps tmp/53ioh1366912715.png",intern=TRUE)) character(0) > try(system("convert tmp/63gkr1366912715.ps tmp/63gkr1366912715.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.096 0.593 3.680