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(73.97,73.97,73.97,73.97,73.97,73.97,73.96,74.44,75.43,75.77,75.82,75.85,75.85,75.85,77.95,82.07,84.82,85.08,85.34,85.65,85.65,85.72,85.73,85.73,85.73,85.73,85.74,86.32,87.59,87.81,87.87,87.94,87.96,88.01,88.01,88.01,88.01,88.01,88.59,89.43,89.63,89.73,89.88,89.89,89.9,89.91,89.86,90.07,90.17,90.17,90.28,90.87,92.05,92.1,92.16,92.22,92.25,92.29,92.29,92.29,92.29,92.29,91.95,91.82,92.16,92.31,92.33,92.4,92.54,92.49,92.54,92.58,92.58,92.39,92.33,93.59,95.51,95.99,96.22,97.2,98.54,99.64,100.23,100.17,100.28,100.44,100.54,100.64,103.27,104.31,104.97,106.42,108.17,108.68,109.15,109.19) > 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,] 73.97 75.85 85.73 88.01 90.17 92.29 92.58 100.28 NA [2,] 73.97 75.85 85.73 88.01 90.17 92.29 92.39 100.44 NA [3,] 73.97 77.95 85.74 88.59 90.28 91.95 92.33 100.54 NA [4,] 73.97 82.07 86.32 89.43 90.87 91.82 93.59 100.64 NA [5,] 73.97 84.82 87.59 89.63 92.05 92.16 95.51 103.27 NA [6,] 73.97 85.08 87.81 89.73 92.10 92.31 95.99 104.31 NA [7,] 73.96 85.34 87.87 89.88 92.16 92.33 96.22 104.97 NA [8,] 74.44 85.65 87.94 89.89 92.22 92.40 97.20 106.42 NA [9,] 75.43 85.65 87.96 89.90 92.25 92.54 98.54 108.17 NA [10,] 75.77 85.72 88.01 89.91 92.29 92.49 99.64 108.68 NA [11,] 75.82 85.73 88.01 89.86 92.29 92.54 100.23 109.15 NA [12,] 75.85 85.73 88.01 90.07 92.29 92.58 100.17 109.19 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/12git1426089164.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/23sbi1426089164.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/3drht1426089164.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/48vpc1426089164.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,] 73.970 73.97 73.970 73.970 84.820 85.080 85.340 85.650 75.430 [2,] 80.790 80.79 81.845 84.195 86.205 86.445 86.605 86.795 86.805 [3,] 89.090 89.09 89.435 90.150 90.840 90.915 91.020 91.055 91.075 [4,] 92.435 92.34 92.140 92.705 93.835 94.150 94.275 94.800 95.540 [5,] 100.280 100.44 100.540 100.640 103.270 104.310 104.970 106.420 108.170 [,10] [,11] [,12] [1,] 75.770 75.820 75.850 [2,] 86.865 86.870 86.870 [3,] 91.100 91.075 91.180 [4,] 96.065 96.385 96.375 [5,] 108.680 109.150 109.190 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82.58494 82.638 83.68407 85.39619 86.57777 86.61088 86.73543 86.58329 [2,] 95.59506 95.542 95.18593 94.90381 95.10223 95.21912 95.30457 95.52671 [,9] [,10] [,11] [,12] [1,] 86.1955 85.96075 85.75978 85.87037 [2,] 95.9545 96.23925 96.39022 96.48963 $out [1] 73.97 73.97 73.96 74.44 $group [1] 5 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(73.97, 80.79, 89.09, 92.435, 100.28, 73.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/545cd1426089164.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,] 73.96 75.850 85.730 88.010 90.170 91.820 92.330 100.280 NA [2,] 73.97 80.010 86.030 89.010 90.575 92.225 93.085 100.590 NA [3,] 73.97 85.210 87.840 89.795 92.130 92.320 96.105 104.640 NA [4,] 75.60 85.685 87.985 89.895 92.270 92.515 99.090 108.425 NA [5,] 75.85 85.730 88.010 90.070 92.290 92.580 100.230 109.190 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.22655 82.62159 86.94831 89.39135 91.3569 92.18773 93.36608 101.0664 [2,] 74.71345 87.79841 88.73169 90.19865 92.9031 92.45227 98.84392 108.2136 [,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(73.96, 73.97, 73.97, 75.6, 75.85, 75.85, 80.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nqfl1426089164.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,] 7.999528 26.310 6.0650 [2,] 8.622755 26.620 6.1675 [3,] 8.859649 30.675 6.9225 [4,] 9.616903 32.825 7.6450 [5,] 9.878794 33.340 9.1025 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.406211 27.84486 6.248602 [2,] 9.313087 33.50514 7.596398 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.9995275530139, 8.62275462784045, 8.85964922649495, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12git1426089164.ps tmp/12git1426089164.png",intern=TRUE)) character(0) > try(system("convert tmp/23sbi1426089164.ps tmp/23sbi1426089164.png",intern=TRUE)) character(0) > try(system("convert tmp/3drht1426089164.ps tmp/3drht1426089164.png",intern=TRUE)) character(0) > try(system("convert tmp/48vpc1426089164.ps tmp/48vpc1426089164.png",intern=TRUE)) character(0) > try(system("convert tmp/545cd1426089164.ps tmp/545cd1426089164.png",intern=TRUE)) character(0) > try(system("convert tmp/6nqfl1426089164.ps tmp/6nqfl1426089164.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.062 0.362 2.459