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(86.86,86.79,82.52,86.87,81.62,82.66,89.87,92.04,79.74,77.75,79.12,76.37,75.01,77.6,77.81,81.7,76.47,74.72,84.43,86.72,70.99,75.43,74.14,73.3,71.97,69.27,74.13,76.4,72.26,72.1,87.82,91.62,82.69,85.76,86.87,93.09,83.73,84.49,87.37,89.13,83.2,83.77,93.68,93.09,88.59,87.88,87.89,89.38,89.13,89.58,90.22,91.44,91.04,92.1,97.54,99.12,100,99.68,100.08,99.9,99.63,99.45,99.63,99.46,96.91,97.65,102.1,103.57,104.59,104.79,101.31,104.8,104.56,104.15,102.73,101.86,101.9,102.33,105.71,106.1,102.81,103.23,102.35,104.11) > 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,] 86.86 75.01 71.97 83.73 89.13 99.63 104.56 NA [2,] 86.79 77.60 69.27 84.49 89.58 99.45 104.15 NA [3,] 82.52 77.81 74.13 87.37 90.22 99.63 102.73 NA [4,] 86.87 81.70 76.40 89.13 91.44 99.46 101.86 NA [5,] 81.62 76.47 72.26 83.20 91.04 96.91 101.90 NA [6,] 82.66 74.72 72.10 83.77 92.10 97.65 102.33 NA [7,] 89.87 84.43 87.82 93.68 97.54 102.10 105.71 NA [8,] 92.04 86.72 91.62 93.09 99.12 103.57 106.10 NA [9,] 79.74 70.99 82.69 88.59 100.00 104.59 102.81 NA [10,] 77.75 75.43 85.76 87.88 99.68 104.79 103.23 NA [11,] 79.12 74.14 86.87 87.89 100.08 101.31 102.35 NA [12,] 76.37 73.30 93.09 89.38 99.90 104.80 104.11 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/173lz1386099867.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/2u8lt1386099867.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/361ac1386099867.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/44hgt1386099867.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,] 71.97 69.270 74.130 76.400 72.260 72.100 84.430 86.720 70.990 [2,] 79.37 81.045 80.165 84.285 79.045 78.690 88.845 91.830 81.215 [3,] 86.86 86.790 87.370 89.130 83.200 83.770 93.680 93.090 88.590 [4,] 94.38 94.515 94.925 95.450 93.975 94.875 99.820 101.345 101.405 [5,] 104.56 104.150 102.730 101.860 101.900 102.330 105.710 106.100 104.590 [,10] [,11] [,12] [1,] 75.430 74.140 73.300 [2,] 81.755 82.995 82.875 [3,] 87.880 87.890 93.090 [4,] 101.455 100.695 102.005 [5,] 104.790 102.350 104.800 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 77.89627 78.74593 78.55557 82.46244 74.28404 74.10458 87.12591 87.4078 [2,] 95.82373 94.83407 96.18443 95.79756 92.11596 93.43542 100.23409 98.7722 [,9] [,10] [,11] [,12] [1,] 76.53286 76.11548 77.31985 81.66587 [2,] 100.64714 99.64452 98.46015 104.51413 $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(71.97, 79.37, 86.86, 94.38, 104.56, 69.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u0v01386099867.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,] 76.370 70.990 69.270 83.200 89.13 96.910 101.860 NA [2,] 79.430 74.430 72.180 84.130 90.63 99.455 102.340 NA [3,] 82.590 75.950 79.545 87.885 94.82 100.470 103.020 NA [4,] 86.865 79.755 87.345 89.255 99.79 104.080 104.355 NA [5,] 92.040 86.720 93.090 93.680 100.08 104.800 106.100 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.19885 73.52123 72.62814 85.54745 90.64206 98.36051 102.1009 NA [2,] 85.98115 78.37877 86.46186 90.22255 98.99794 102.57949 103.9391 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(76.37, 79.43, 82.59, 86.865, 92.04, 70.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62xge1386099867.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.053275 19.380 9.5150 [2,] 9.878828 26.835 12.3175 [3,] 11.329707 29.500 14.9700 [4,] 12.018871 32.045 18.4150 [5,] 12.903400 34.880 20.1900 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 10.35362 27.12368 12.18889 [2,] 12.30579 31.87632 17.75111 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.05327515954045, 9.87882796697571, 11.329706551334, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/173lz1386099867.ps tmp/173lz1386099867.png",intern=TRUE)) character(0) > try(system("convert tmp/2u8lt1386099867.ps tmp/2u8lt1386099867.png",intern=TRUE)) character(0) > try(system("convert tmp/361ac1386099867.ps tmp/361ac1386099867.png",intern=TRUE)) character(0) > try(system("convert tmp/44hgt1386099867.ps tmp/44hgt1386099867.png",intern=TRUE)) character(0) > try(system("convert tmp/5u0v01386099867.ps tmp/5u0v01386099867.png",intern=TRUE)) character(0) > try(system("convert tmp/62xge1386099867.ps tmp/62xge1386099867.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.473 0.880 5.327