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(82.81,83.42,83.45,83.71,84.8,85.95,86.22,86.75,87.06,87.17,87.63,87.78,88.4,89.35,89.53,90.66,90.81,91.55,91.58,91.76,91.78,91.71,91.57,91.95,92.16,92.26,92.44,93.12,93.55,93.63,93.74,94.08,94.24,94.66,94.69,94.69,94.69,94.72,95.15,95.28,96.12,96.5,96.67,96.83,97.4,97.75,97.46,97.46,97.56,97.97,98.89,99.1,99.3,100,99.73,99.34,99.78,99.5,99.6,99.52,99.63,99.61,99.73,100.53,100.87,100.9,101.08,102.95,102.58,102.6,102.45,102.41,102.38,102.65,103.33,103.68,104.13,104.3,104.11,104.17,104.23,104.47,104.86,104.9) > 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,] 82.81 88.40 92.16 94.69 97.56 99.63 102.38 NA [2,] 83.42 89.35 92.26 94.72 97.97 99.61 102.65 NA [3,] 83.45 89.53 92.44 95.15 98.89 99.73 103.33 NA [4,] 83.71 90.66 93.12 95.28 99.10 100.53 103.68 NA [5,] 84.80 90.81 93.55 96.12 99.30 100.87 104.13 NA [6,] 85.95 91.55 93.63 96.50 100.00 100.90 104.30 NA [7,] 86.22 91.58 93.74 96.67 99.73 101.08 104.11 NA [8,] 86.75 91.76 94.08 96.83 99.34 102.95 104.17 NA [9,] 87.06 91.78 94.24 97.40 99.78 102.58 104.23 NA [10,] 87.17 91.71 94.66 97.75 99.50 102.60 104.47 NA [11,] 87.63 91.57 94.69 97.46 99.60 102.45 104.86 NA [12,] 87.78 91.95 94.69 97.46 99.52 102.41 104.90 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/12ybq1386236272.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/2bgut1386236272.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/3orcn1386236272.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/4vl9a1386236272.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,] 82.810 83.420 83.450 83.710 84.800 85.95 86.220 86.750 87.06 [2,] 90.280 90.805 90.985 91.890 92.180 92.59 92.660 92.920 93.01 [3,] 94.690 94.720 95.150 95.280 96.120 96.50 96.670 96.830 97.40 [4,] 98.595 98.790 99.310 99.815 100.085 100.45 100.405 101.145 101.18 [5,] 102.380 102.650 103.330 103.680 104.130 104.30 104.110 104.170 104.23 [,10] [,11] [,12] [1,] 87.170 87.630 87.780 [2,] 93.185 93.130 93.320 [3,] 97.750 97.460 97.460 [4,] 101.050 101.025 100.965 [5,] 104.470 104.860 104.900 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.72442 89.95149 90.17844 90.54732 91.39926 91.80613 92.04481 [2,] 99.65558 99.48851 100.12156 100.01268 100.84074 101.19387 101.29519 [,8] [,9] [,10] [,11] [,12] [1,] 91.91816 92.52101 93.05315 92.74523 92.89453 [2,] 101.74184 102.27899 102.44685 102.17477 102.02547 $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(82.81, 90.28, 94.69, 98.595, 102.38, 83.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/549sz1386236272.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,] 82.810 88.400 92.160 94.690 98.890 99.610 102.380 NA [2,] 83.580 90.095 92.780 95.215 98.995 100.130 103.505 NA [3,] 86.085 91.560 93.685 96.585 99.420 100.990 104.150 NA [4,] 87.115 91.735 94.450 97.430 99.665 102.515 104.385 NA [5,] 87.780 91.950 94.690 97.750 100.000 102.950 104.900 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 84.47266 90.81198 92.9233 95.57472 99.11441 99.90219 103.7486 NA [2,] 87.69734 92.30802 94.4467 97.59528 99.72559 102.07781 104.5514 NA $out [1] 97.56 97.97 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(82.81, 83.58, 86.085, 87.115, 87.78, 88.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6p72i1386236272.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,] 5.973205 17.120 7.6450 [2,] 6.112224 17.265 7.8625 [3,] 6.241252 18.120 7.9150 [4,] 6.651997 19.450 8.1975 [5,] 6.781283 19.970 8.3250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.995057 17.12341 7.762204 [2,] 6.487446 19.11659 8.067796 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.97320524947711, 6.11222368249421, 6.24125187136701, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12ybq1386236272.ps tmp/12ybq1386236272.png",intern=TRUE)) character(0) > try(system("convert tmp/2bgut1386236272.ps tmp/2bgut1386236272.png",intern=TRUE)) character(0) > try(system("convert tmp/3orcn1386236272.ps tmp/3orcn1386236272.png",intern=TRUE)) character(0) > try(system("convert tmp/4vl9a1386236272.ps tmp/4vl9a1386236272.png",intern=TRUE)) character(0) > try(system("convert tmp/549sz1386236272.ps tmp/549sz1386236272.png",intern=TRUE)) character(0) > try(system("convert tmp/6p72i1386236272.ps tmp/6p72i1386236272.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.067 1.226 6.285