R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" 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(96.86,96.77,96.5,96.01,96.07,95.93,95.93,95.83,96.24,96.25,96.59,96.62,96.62,96.81,96.71,96.45,96.63,96.56,96.56,96.65,97.04,97.14,97.2,97.26,97.26,97.24,97.35,97.36,97.28,97.31,97.31,97.31,97.23,97.78,97.64,97.68,97.68,97.81,97.75,97.63,97.6,97.65,97.65,97.65,97.86,98.41,98.79,98.75,98.74,98.55,98.65,98.86,98.94,99.05,99.05,99.05,99.17,98.99,98.91,98.89,98.89,98.72,98.89,98.97,99.16,99.54,99.54,99.55,100.01,99.52,99.44,99.39,99.39,99.4,100.43,100.62,101.05,100.95,100.95,100.91,101.13,100.81,100.47,100.56) > 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,] 96.86 96.62 97.26 97.68 98.74 98.89 99.39 NA [2,] 96.77 96.81 97.24 97.81 98.55 98.72 99.40 NA [3,] 96.50 96.71 97.35 97.75 98.65 98.89 100.43 NA [4,] 96.01 96.45 97.36 97.63 98.86 98.97 100.62 NA [5,] 96.07 96.63 97.28 97.60 98.94 99.16 101.05 NA [6,] 95.93 96.56 97.31 97.65 99.05 99.54 100.95 NA [7,] 95.93 96.56 97.31 97.65 99.05 99.54 100.95 NA [8,] 95.83 96.65 97.31 97.65 99.05 99.55 100.91 NA [9,] 96.24 97.04 97.23 97.86 99.17 100.01 101.13 NA [10,] 96.25 97.14 97.78 98.41 98.99 99.52 100.81 NA [11,] 96.59 97.20 97.64 98.79 98.91 99.44 100.47 NA [12,] 96.62 97.26 97.68 98.75 98.89 99.39 100.56 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/13twl1386063721.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/2nwxl1386063721.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/3yg001386063721.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/4z5cd1386063721.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] [1,] 96.620 96.770 96.50 96.010 96.070 95.930 95.930 95.83 96.240 [2,] 97.060 97.025 97.03 96.905 96.955 96.935 96.935 96.98 97.135 [3,] 97.680 97.810 97.75 97.630 97.600 97.650 97.650 97.65 97.860 [4,] 98.815 98.635 98.77 98.915 99.050 99.295 99.295 99.30 99.590 [5,] 99.390 99.400 100.43 100.620 101.050 100.950 100.950 100.91 101.130 [,10] [,11] [,12] [1,] 96.250 96.590 96.62 [2,] 97.460 97.420 97.47 [3,] 98.410 98.790 98.75 [4,] 99.255 99.175 99.14 [5,] 100.810 100.470 100.56 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.63194 96.84853 96.7109 96.42966 96.3489 96.24065 96.24065 96.26453 [2,] 98.72806 98.77147 98.7891 98.83034 98.8511 99.05935 99.05935 99.03547 [,9] [,10] [,11] [,12] [1,] 96.39391 97.33805 97.74194 97.7527 [2,] 99.32609 99.48195 99.83806 99.7473 $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(96.62, 97.06, 97.68, 98.815, 99.39, 96.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xpe31386063721.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,] 95.830 96.45 97.23 97.600 98.550 98.720 100.430 NA [2,] 95.970 96.59 97.27 97.650 98.800 98.930 100.450 NA [3,] 96.245 96.68 97.31 97.715 98.925 99.415 100.715 NA [4,] 96.605 97.09 97.50 98.135 99.050 99.540 100.950 NA [5,] 96.860 97.26 97.78 98.790 99.170 100.010 101.130 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.95537 96.45195 97.2051 97.49379 98.81097 99.13677 100.4869 NA [2,] 96.53463 96.90805 97.4149 97.93621 99.03903 99.69323 100.9431 NA $out [1] 99.39 99.40 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(95.83, 95.97, 96.245, 96.605, 96.86, 96.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ozeo1386063721.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,] 1.020915 2.630 1.6100 [2,] 1.355276 3.905 1.7475 [3,] 1.566273 4.585 1.9025 [4,] 1.774484 5.000 2.3400 [5,] 1.779217 5.080 2.4550 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.375069 4.085563 1.632257 [2,] 1.757476 5.084437 2.172743 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.0209146226138, 1.35527628286309, 1.56627257602225, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13twl1386063721.ps tmp/13twl1386063721.png",intern=TRUE)) character(0) > try(system("convert tmp/2nwxl1386063721.ps tmp/2nwxl1386063721.png",intern=TRUE)) character(0) > try(system("convert tmp/3yg001386063721.ps tmp/3yg001386063721.png",intern=TRUE)) character(0) > try(system("convert tmp/4z5cd1386063721.ps tmp/4z5cd1386063721.png",intern=TRUE)) character(0) > try(system("convert tmp/5xpe31386063721.ps tmp/5xpe31386063721.png",intern=TRUE)) character(0) > try(system("convert tmp/6ozeo1386063721.ps tmp/6ozeo1386063721.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.279 0.855 5.112