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.31,1.32,1.32,1.33,1.33,1.33,1.34,1.33,1.32,1.31,1.31,1.33,1.34,1.33,1.33,1.34,1.34,1.34,1.35,1.35,1.35,1.34,1.35,1.36,1.35,1.36,1.36,1.36,1.37,1.39,1.39,1.38,1.37,1.39,1.38,1.4,1.41,1.4,1.42,1.43,1.44,1.44,1.44,1.46,1.46,1.49,1.49,1.48,1.49,1.5,1.5,1.5,1.47,1.49,1.49,1.5,1.52,1.52,1.52,1.52,1.53,1.54,1.51,1.49,1.49,1.49,1.48,1.49,1.49,1.47,1.49,1.49) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.31 1.34 1.35 1.41 1.49 1.53 NA [2,] 1.32 1.33 1.36 1.40 1.50 1.54 NA [3,] 1.32 1.33 1.36 1.42 1.50 1.51 NA [4,] 1.33 1.34 1.36 1.43 1.50 1.49 NA [5,] 1.33 1.34 1.37 1.44 1.47 1.49 NA [6,] 1.33 1.34 1.39 1.44 1.49 1.49 NA [7,] 1.34 1.35 1.39 1.44 1.49 1.48 NA [8,] 1.33 1.35 1.38 1.46 1.50 1.49 NA [9,] 1.32 1.35 1.37 1.46 1.52 1.49 NA [10,] 1.31 1.34 1.39 1.49 1.52 1.47 NA [11,] 1.31 1.35 1.38 1.49 1.52 1.49 NA [12,] 1.33 1.36 1.40 1.48 1.52 1.49 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/1xavp1386265174.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/2yrp21386265174.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/3mi6e1386265174.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/4c0mm1386265174.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.31 1.32 1.32 1.330 1.330 1.330 1.340 1.33 1.320 1.31 1.310 1.33 [2,] 1.34 1.33 1.33 1.340 1.340 1.340 1.350 1.35 1.350 1.34 1.350 1.36 [3,] 1.38 1.38 1.39 1.395 1.405 1.415 1.415 1.42 1.415 1.43 1.435 1.44 [4,] 1.49 1.50 1.50 1.490 1.470 1.490 1.480 1.49 1.490 1.49 1.490 1.49 [5,] 1.53 1.54 1.51 1.500 1.490 1.490 1.490 1.50 1.520 1.52 1.520 1.52 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.283245 1.270345 1.280345 1.298245 1.321146 1.318245 1.331146 1.329695 [2,] 1.476755 1.489655 1.499655 1.491755 1.488854 1.511755 1.498854 1.510305 [,9] [,10] [,11] [,12] [1,] 1.324695 1.333245 1.344695 1.356146 [2,] 1.505305 1.526755 1.525305 1.523854 $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.31, 1.34, 1.38, 1.49, 1.53, 1.32, 1.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57m4l1386265174.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] [1,] 1.310 1.33 1.350 1.400 1.47 1.48 NA [2,] 1.315 1.34 1.360 1.425 1.49 1.49 NA [3,] 1.325 1.34 1.375 1.440 1.50 1.49 NA [4,] 1.330 1.35 1.390 1.470 1.52 1.50 NA [5,] 1.340 1.36 1.400 1.490 1.52 1.51 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.318158 1.335439 1.361317 1.419475 1.486317 1.485439 NA [2,] 1.331842 1.344561 1.388683 1.460525 1.513683 1.494561 NA $out [1] 1.53 1.54 1.47 $group [1] 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.31, 1.315, 1.325, 1.33, 1.34, 1.33, 1.34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69z7y1386265174.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.06473021 0.150 0.11000 [2,] 0.07266001 0.165 0.12125 [3,] 0.07989009 0.190 0.12750 [4,] 0.08667497 0.210 0.13250 [5,] 0.09174239 0.220 0.14250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.07349777 0.1694752 0.1223688 [2,] 0.08628241 0.2105248 0.1326312 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.064730209330729, 0.0726600149081673, 0.0798900893731671, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xavp1386265174.ps tmp/1xavp1386265174.png",intern=TRUE)) character(0) > try(system("convert tmp/2yrp21386265174.ps tmp/2yrp21386265174.png",intern=TRUE)) character(0) > try(system("convert tmp/3mi6e1386265174.ps tmp/3mi6e1386265174.png",intern=TRUE)) character(0) > try(system("convert tmp/4c0mm1386265174.ps tmp/4c0mm1386265174.png",intern=TRUE)) character(0) > try(system("convert tmp/57m4l1386265174.ps tmp/57m4l1386265174.png",intern=TRUE)) character(0) > try(system("convert tmp/69z7y1386265174.ps tmp/69z7y1386265174.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.366 1.441 7.805