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(0.69,0.69,0.68,0.66,0.65,0.65,0.65,0.65,0.65,0.66,0.68,0.72,0.73,0.75,0.69,0.65,0.64,0.64,0.64,0.64,0.65,0.65,0.67,0.7,0.69,0.7,0.71,0.69,0.69,0.69,0.69,0.69,0.7,0.7,0.7,0.74,0.72,0.74,0.69,0.66,0.66,0.66,0.66,0.66,0.66,0.67,0.7,0.72,0.71,0.7,0.71,0.67,0.7,0.69,0.69,0.69,0.69,0.69,0.71,0.75,0.74,0.75,0.72,0.64,0.65,0.64,0.64,0.64,0.64,0.65,0.66,0.7,0.68,0.69,0.68,0.67,0.68,0.68,0.68,0.68,0.68,0.7,0.69,0.75) > 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,] 0.69 0.73 0.69 0.72 0.71 0.74 0.68 NA [2,] 0.69 0.75 0.70 0.74 0.70 0.75 0.69 NA [3,] 0.68 0.69 0.71 0.69 0.71 0.72 0.68 NA [4,] 0.66 0.65 0.69 0.66 0.67 0.64 0.67 NA [5,] 0.65 0.64 0.69 0.66 0.70 0.65 0.68 NA [6,] 0.65 0.64 0.69 0.66 0.69 0.64 0.68 NA [7,] 0.65 0.64 0.69 0.66 0.69 0.64 0.68 NA [8,] 0.65 0.64 0.69 0.66 0.69 0.64 0.68 NA [9,] 0.65 0.65 0.70 0.66 0.69 0.64 0.68 NA [10,] 0.66 0.65 0.70 0.67 0.69 0.65 0.70 NA [11,] 0.68 0.67 0.70 0.70 0.71 0.66 0.69 NA [12,] 0.72 0.70 0.74 0.72 0.75 0.70 0.75 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/fisher/rcomp/tmp/1fpq51386527926.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/fisher/rcomp/tmp/2v1hf1386527926.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/fisher/rcomp/tmp/3dynl1386527926.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/fisher/rcomp/tmp/4h7xd1386527926.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,] 0.680 0.690 0.680 0.640 0.640 0.640 0.640 0.640 0.640 0.650 0.660 0.700 [2,] 0.690 0.695 0.685 0.655 0.650 0.645 0.645 0.645 0.650 0.655 0.675 0.710 [3,] 0.710 0.700 0.690 0.660 0.660 0.660 0.660 0.660 0.660 0.670 0.690 0.720 [4,] 0.725 0.745 0.710 0.670 0.685 0.685 0.685 0.685 0.685 0.695 0.700 0.745 [5,] 0.740 0.750 0.720 0.690 0.700 0.690 0.690 0.690 0.700 0.700 0.710 0.750 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6890986 0.6701408 0.6750704 0.6510422 0.6390986 0.6361126 0.6361126 [2,] 0.7309014 0.7298592 0.7049296 0.6689578 0.6809014 0.6838874 0.6838874 [,8] [,9] [,10] [,11] [,12] [1,] 0.6361126 0.6390986 0.6461126 0.6750704 0.6990986 [2,] 0.6838874 0.6809014 0.6938874 0.7049296 0.7409014 $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(0.68, 0.69, 0.71, 0.725, 0.74, 0.69, 0.695, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5rme51386527926.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,] 0.650 0.640 0.690 0.660 0.670 0.64 0.67 NA [2,] 0.650 0.640 0.690 0.660 0.690 0.64 0.68 NA [3,] 0.660 0.650 0.695 0.665 0.695 0.65 0.68 NA [4,] 0.685 0.695 0.700 0.710 0.710 0.71 0.69 NA [5,] 0.720 0.750 0.710 0.740 0.710 0.75 0.70 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.6440363 0.6249141 0.6904389 0.6421947 0.6858779 0.6180725 0.6754389 NA [2,] 0.6759637 0.6750859 0.6995611 0.6878053 0.7041221 0.6819275 0.6845611 NA $out [1] 0.74 0.75 0.75 $group [1] 3 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(0.65, 0.65, 0.66, 0.685, 0.72, 0.64, 0.64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/62fun1386527926.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.01603567 0.04 0.015 [2,] 0.01974334 0.05 0.030 [3,] 0.02225395 0.05 0.035 [4,] 0.02278238 0.06 0.040 [5,] 0.02288689 0.06 0.050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.02086782 0.04543893 0.03043893 [2,] 0.02364007 0.05456107 0.03956107 $out [1] 0.02811541 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0160356745147454, 0.0197433389621356, 0.0222539456105674, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fpq51386527926.ps tmp/1fpq51386527926.png",intern=TRUE)) character(0) > try(system("convert tmp/2v1hf1386527926.ps tmp/2v1hf1386527926.png",intern=TRUE)) character(0) > try(system("convert tmp/3dynl1386527926.ps tmp/3dynl1386527926.png",intern=TRUE)) character(0) > try(system("convert tmp/4h7xd1386527926.ps tmp/4h7xd1386527926.png",intern=TRUE)) character(0) > try(system("convert tmp/5rme51386527926.ps tmp/5rme51386527926.png",intern=TRUE)) character(0) > try(system("convert tmp/62fun1386527926.ps tmp/62fun1386527926.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.366 1.237 6.580