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(47.43,47.43,47.51,47.96,47.99,48.05,48.05,48.01,48,48.06,48.23,48.4,48.4,48.5,48.41,48.35,48.53,48.52,48.52,48.49,48.45,48.65,48.74,48.74,48.74,48.79,48.82,48.82,49.2,49.3,49.3,49.34,49.47,49.65,49.7,49.75,49.75,49.7,50.09,50.19,50.53,50.55,50.55,50.55,50.58,50.61,50.94,51.01,51.01,51.04,51.15,51.31,51.31,51.34,51.34,51.34,51.47,51.95,51.97,51.92,51.92,51.91,51.97,52.14,52.33,52.4,52.4,52.41,52.71,53.17,53.33,53.32,53.32,53.3,53.31,53.72,53.87,53.91,53.91,53.96,54.02,54.33,54.48,54.54) > 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,] 47.43 48.40 48.74 49.75 51.01 51.92 53.32 NA [2,] 47.43 48.50 48.79 49.70 51.04 51.91 53.30 NA [3,] 47.51 48.41 48.82 50.09 51.15 51.97 53.31 NA [4,] 47.96 48.35 48.82 50.19 51.31 52.14 53.72 NA [5,] 47.99 48.53 49.20 50.53 51.31 52.33 53.87 NA [6,] 48.05 48.52 49.30 50.55 51.34 52.40 53.91 NA [7,] 48.05 48.52 49.30 50.55 51.34 52.40 53.91 NA [8,] 48.01 48.49 49.34 50.55 51.34 52.41 53.96 NA [9,] 48.00 48.45 49.47 50.58 51.47 52.71 54.02 NA [10,] 48.06 48.65 49.65 50.61 51.95 53.17 54.33 NA [11,] 48.23 48.74 49.70 50.94 51.97 53.33 54.48 NA [12,] 48.40 48.74 49.75 51.01 51.92 53.32 54.54 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/1pshe1386197976.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/2kz4k1386197976.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/3wq2u1386197976.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/4mloj1386197977.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] [1,] 47.430 47.430 47.510 47.960 47.990 48.05 48.05 48.010 48.00 48.06 48.23 [2,] 48.570 48.645 48.615 48.585 48.865 48.91 48.91 48.915 48.96 49.15 49.22 [3,] 49.750 49.700 50.090 50.190 50.530 50.55 50.55 50.550 50.58 50.61 50.94 [4,] 51.465 51.475 51.560 51.725 51.820 51.87 51.87 51.875 52.09 52.56 52.65 [5,] 53.320 53.300 53.310 53.720 53.870 53.91 53.91 53.960 54.02 54.33 54.48 [,12] [1,] 48.400 [2,] 49.245 [3,] 51.010 [4,] 52.620 [5,] 54.540 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 48.02115 48.00997 48.33129 48.31484 48.76532 48.78234 48.78234 48.78234 [2,] 51.47885 51.39003 51.84871 52.06516 52.29468 52.31766 52.31766 52.31766 [,9] [,10] [,11] [,12] [1,] 48.71081 48.5736 48.89166 48.9945 [2,] 52.44919 52.6464 52.98834 53.0255 $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(47.43, 48.57, 49.75, 51.465, 53.32, 47.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pzlv1386197977.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,] 47.430 48.35 48.74 49.700 51.010 51.910 53.300 NA [2,] 47.735 48.43 48.82 50.140 51.230 52.055 53.520 NA [3,] 48.005 48.51 49.30 50.550 51.340 52.400 53.910 NA [4,] 48.055 48.59 49.56 50.595 51.695 52.940 54.175 NA [5,] 48.400 48.74 49.75 51.010 51.970 53.330 54.540 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 47.85905 48.43702 48.96248 50.34247 51.12791 51.99635 53.61125 NA [2,] 48.15095 48.58298 49.63752 50.75753 51.55209 52.80365 54.20875 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(47.43, 47.735, 48.005, 48.055, 48.4, 48.35, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ot4a1386197977.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,] 2.080247 5.760 2.8300 [2,] 2.115797 5.860 2.9500 [3,] 2.137429 5.885 2.9600 [4,] 2.266177 6.080 3.2575 [5,] 2.342811 6.270 3.4300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.068840 5.784657 2.819747 [2,] 2.206019 5.985343 3.100253 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.08024723805334, 2.11579715485067, 2.13742936355113, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pshe1386197976.ps tmp/1pshe1386197976.png",intern=TRUE)) character(0) > try(system("convert tmp/2kz4k1386197976.ps tmp/2kz4k1386197976.png",intern=TRUE)) character(0) > try(system("convert tmp/3wq2u1386197976.ps tmp/3wq2u1386197976.png",intern=TRUE)) character(0) > try(system("convert tmp/4mloj1386197977.ps tmp/4mloj1386197977.png",intern=TRUE)) character(0) > try(system("convert tmp/5pzlv1386197977.ps tmp/5pzlv1386197977.png",intern=TRUE)) character(0) > try(system("convert tmp/6ot4a1386197977.ps tmp/6ot4a1386197977.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.576 1.194 6.741