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(96.86,96.89,96.9,96.94,96.88,96.89,96.89,96.95,97.03,97.29,97.37,97.41,97.41,97.32,97.33,97.38,97.47,97.5,97.5,97.58,97.7,97.9,97.98,98.03,98.03,97.94,98.12,98.19,98.34,98.42,98.43,98.45,98.77,99.24,99.46,99.54,99.55,99.24,99.43,99.47,99.57,99.62,99.64,99.75,99.85,100.28,100.52,100.57,100.57,100.27,100.27,100.18,100.16,100.18,100.18,100.59,100.69,101.06,101.15,101.16,101.16,100.81,100.94,101.13,101.29,101.34,101.35,101.7,102.05,102.48,102.66,102.72,102.73,102.18,102.22,102.37,102.53,102.61,102.62,103,103.17,103.52,103.69,103.73,99.57,99.09,99.14,99.36,99.6,99.65,99.8,100.15,100.45,100.89,101.13,101.17) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 96.86 97.41 98.03 99.55 100.57 101.16 102.73 99.57 NA [2,] 96.89 97.32 97.94 99.24 100.27 100.81 102.18 99.09 NA [3,] 96.90 97.33 98.12 99.43 100.27 100.94 102.22 99.14 NA [4,] 96.94 97.38 98.19 99.47 100.18 101.13 102.37 99.36 NA [5,] 96.88 97.47 98.34 99.57 100.16 101.29 102.53 99.60 NA [6,] 96.89 97.50 98.42 99.62 100.18 101.34 102.61 99.65 NA [7,] 96.89 97.50 98.43 99.64 100.18 101.35 102.62 99.80 NA [8,] 96.95 97.58 98.45 99.75 100.59 101.70 103.00 100.15 NA [9,] 97.03 97.70 98.77 99.85 100.69 102.05 103.17 100.45 NA [10,] 97.29 97.90 99.24 100.28 101.06 102.48 103.52 100.89 NA [11,] 97.37 97.98 99.46 100.52 101.15 102.66 103.69 101.13 NA [12,] 97.41 98.03 99.54 100.57 101.16 102.72 103.73 101.17 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/138s11426066290.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/2212s1426066290.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/3ou3n1426066290.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/4j82t1426066290.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.860 96.890 96.900 96.940 96.880 96.890 96.890 96.950 97.030 [2,] 97.720 97.630 97.725 97.785 97.905 97.960 97.965 98.015 98.235 [3,] 99.560 99.165 99.285 99.415 99.585 99.635 99.720 99.950 100.150 [4,] 100.865 100.540 100.605 100.655 100.725 100.760 100.765 101.145 101.370 [5,] 102.730 102.180 102.220 102.370 102.530 102.610 102.620 103.000 103.170 [,10] [,11] [,12] [1,] 97.290 97.370 97.410 [2,] 98.570 98.720 98.785 [3,] 100.585 100.825 100.865 [4,] 101.770 101.905 101.945 [5,] 103.520 103.690 103.730 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.80316 97.53943 97.67619 97.81178 98.00971 98.07088 98.15588 [2,] 101.31684 100.79057 100.89381 101.01822 101.16029 101.19912 101.28412 [,8] [,9] [,10] [,11] [,12] [1,] 98.20154 98.39874 98.79743 99.04581 99.09978 [2,] 101.69846 101.90126 102.37257 102.60419 102.63022 $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.86, 97.72, 99.56, 100.865, 102.73, 96.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gmmc1426066290.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] [1,] 96.86 97.320 97.940 99.240 100.160 100.810 102.180 99.090 NA [2,] 96.89 97.395 98.155 99.510 100.180 101.145 102.450 99.465 NA [3,] 96.92 97.500 98.425 99.630 100.420 101.345 102.675 99.725 NA [4,] 97.16 97.800 99.005 100.065 100.875 102.265 103.345 100.670 NA [5,] 97.41 98.030 99.540 100.570 101.160 102.720 103.730 101.170 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.79685 97.31528 98.03731 99.37686 100.103 100.8342 102.2668 99.17539 [2,] 97.04315 97.68472 98.81269 99.88314 100.737 101.8558 103.0832 100.27461 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(96.86, 96.89, 96.92, 97.16, 97.41, 97.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ud781426066290.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.816069 5.290 2.27500 [2,] 1.874211 5.540 2.35750 [3,] 1.954490 5.800 2.47375 [4,] 2.113560 6.185 2.57375 [5,] 2.167625 6.320 2.84250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.845321 5.505811 2.375117 [2,] 2.063659 6.094189 2.572383 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.81606914594603, 1.87421059320394, 1.95448970638921, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/138s11426066290.ps tmp/138s11426066290.png",intern=TRUE)) character(0) > try(system("convert tmp/2212s1426066290.ps tmp/2212s1426066290.png",intern=TRUE)) character(0) > try(system("convert tmp/3ou3n1426066290.ps tmp/3ou3n1426066290.png",intern=TRUE)) character(0) > try(system("convert tmp/4j82t1426066290.ps tmp/4j82t1426066290.png",intern=TRUE)) character(0) > try(system("convert tmp/5gmmc1426066290.ps tmp/5gmmc1426066290.png",intern=TRUE)) character(0) > try(system("convert tmp/6ud781426066290.ps tmp/6ud781426066290.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.095 0.309 2.424