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(1.58,1.59,1.55,1.52,1.51,1.5,1.56,1.59,1.59,1.59,1.6,1.57,1.55,1.54,1.58,1.57,1.56,1.62,1.59,1.61,1.63,1.74,1.77,1.82,1.78,1.75,1.76,1.72,1.78,1.82,1.91,1.82,1.91,1.81,1.59,1.48,1.47,1.56,1.5,1.47,1.49,1.57,1.57,1.63,1.67,1.61,1.66,1.66,1.72,1.73,1.75,1.74,1.75,1.75,1.71,1.7,1.77,1.81,1.91,1.98,1.96,1.89,1.98,2.02,2.01,1.91,1.94,1.93,1.98,2.01,1.97,1.96,2.11,2.13,2.17,2.17,2.05,1.84,1.87,2.03,2.17,2.17,2.2,2.13) > 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,] 1.58 1.55 1.78 1.47 1.72 1.96 2.11 NA [2,] 1.59 1.54 1.75 1.56 1.73 1.89 2.13 NA [3,] 1.55 1.58 1.76 1.50 1.75 1.98 2.17 NA [4,] 1.52 1.57 1.72 1.47 1.74 2.02 2.17 NA [5,] 1.51 1.56 1.78 1.49 1.75 2.01 2.05 NA [6,] 1.50 1.62 1.82 1.57 1.75 1.91 1.84 NA [7,] 1.56 1.59 1.91 1.57 1.71 1.94 1.87 NA [8,] 1.59 1.61 1.82 1.63 1.70 1.93 2.03 NA [9,] 1.59 1.63 1.91 1.67 1.77 1.98 2.17 NA [10,] 1.59 1.74 1.81 1.61 1.81 2.01 2.17 NA [11,] 1.60 1.77 1.59 1.66 1.91 1.97 2.20 NA [12,] 1.57 1.82 1.48 1.66 1.98 1.96 2.13 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/1nyqc1386239401.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/26f8x1386239401.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/3rquq1386239402.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/429771386239402.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] [,10] [,11] [,12] [1,] 1.470 1.540 1.500 1.470 1.490 1.500 1.56 1.590 1.590 1.590 1.59 1.480 [2,] 1.565 1.575 1.565 1.545 1.535 1.595 1.58 1.620 1.650 1.675 1.63 1.615 [3,] 1.720 1.730 1.750 1.720 1.750 1.750 1.71 1.700 1.770 1.810 1.77 1.820 [4,] 1.870 1.820 1.870 1.880 1.895 1.830 1.89 1.875 1.945 1.910 1.94 1.970 [5,] 2.110 2.130 2.170 2.170 2.050 1.910 1.94 2.030 2.170 2.170 2.20 2.130 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.537859 1.58369 1.567859 1.519943 1.535014 1.609662 1.524873 1.547718 [2,] 1.902141 1.87631 1.932141 1.920057 1.964986 1.890338 1.895127 1.852282 [,9] [,10] [,11] [,12] [1,] 1.593831 1.669662 1.584873 1.608 [2,] 1.946169 1.950338 1.955127 2.032 $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(1.47, 1.565, 1.72, 1.87, 2.11, 1.54, 1.575, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ik9v1386239402.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,] 1.500 1.540 1.720 1.470 1.700 1.890 1.87 NA [2,] 1.535 1.565 1.735 1.495 1.725 1.935 2.04 NA [3,] 1.575 1.600 1.780 1.570 1.750 1.965 2.13 NA [4,] 1.590 1.685 1.820 1.645 1.790 1.995 2.17 NA [5,] 1.600 1.820 1.910 1.670 1.810 2.020 2.20 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.549914 1.545267 1.741231 1.501584 1.720353 1.937634 2.070706 NA [2,] 1.600086 1.654733 1.818769 1.638416 1.779647 1.992366 2.189294 NA $out [1] 1.59 1.48 1.91 1.98 1.84 $group [1] 3 3 5 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.5, 1.535, 1.575, 1.59, 1.6, 1.54, 1.565, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63e061386239402.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,] 0.1539326 0.380 0.2350 [2,] 0.1904698 0.500 0.2500 [3,] 0.2186721 0.585 0.3050 [4,] 0.2352180 0.645 0.3225 [5,] 0.2626060 0.700 0.3600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1982621 0.5188645 0.2719323 [2,] 0.2390820 0.6511355 0.3380677 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.15393257645878, 0.190469829243489, 0.218672088537704, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nyqc1386239401.ps tmp/1nyqc1386239401.png",intern=TRUE)) character(0) > try(system("convert tmp/26f8x1386239401.ps tmp/26f8x1386239401.png",intern=TRUE)) character(0) > try(system("convert tmp/3rquq1386239402.ps tmp/3rquq1386239402.png",intern=TRUE)) character(0) > try(system("convert tmp/429771386239402.ps tmp/429771386239402.png",intern=TRUE)) character(0) > try(system("convert tmp/5ik9v1386239402.ps tmp/5ik9v1386239402.png",intern=TRUE)) character(0) > try(system("convert tmp/63e061386239402.ps tmp/63e061386239402.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.514 1.280 7.790