R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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.68,0.68,0.69,0.69,0.7,0.7,0.7,0.7,0.7,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.76,0.77,0.78,0.85,0.89,0.9,0.91,0.91,0.91,0.9,0.89,0.88,0.87,0.86,0.87,0.87,0.87,0.85,0.84,0.84,0.84,0.84,0.84,0.82,0.87,0.92,0.92,0.92,0.93,0.94,0.87,0.84,0.83,0.81,0.81,0.81,0.8,0.8,0.8,0.8,0.8,0.8,0.79,0.8,0.8,0.8,0.81,0.83,0.83,0.83,0.83,0.82,0.82,0.82) > 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,] 0.68 0.71 0.91 0.84 0.87 0.79 NA [2,] 0.68 0.71 0.91 0.84 0.84 0.80 NA [3,] 0.69 0.71 0.91 0.84 0.83 0.80 NA [4,] 0.69 0.71 0.90 0.84 0.81 0.80 NA [5,] 0.70 0.71 0.89 0.84 0.81 0.81 NA [6,] 0.70 0.71 0.88 0.82 0.81 0.83 NA [7,] 0.70 0.76 0.87 0.87 0.80 0.83 NA [8,] 0.70 0.77 0.86 0.92 0.80 0.83 NA [9,] 0.70 0.78 0.87 0.92 0.80 0.83 NA [10,] 0.71 0.85 0.87 0.92 0.80 0.82 NA [11,] 0.71 0.89 0.87 0.93 0.80 0.82 NA [12,] 0.71 0.90 0.85 0.94 0.80 0.82 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/1fmvz1354111241.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/2evjo1354111241.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/33p221354111241.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/4t36y1354111241.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.68 0.690 0.690 0.70 0.700 0.700 0.700 0.700 0.710 0.710 0.710 [2,] 0.710 0.71 0.710 0.710 0.71 0.710 0.760 0.770 0.780 0.800 0.800 0.800 [3,] 0.815 0.82 0.815 0.805 0.81 0.815 0.815 0.815 0.815 0.835 0.845 0.835 [4,] 0.870 0.84 0.840 0.840 0.84 0.830 0.870 0.860 0.870 0.870 0.890 0.900 [5,] 0.910 0.91 0.910 0.900 0.89 0.880 0.870 0.920 0.920 0.920 0.930 0.940 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.7117948 0.7361458 0.7311458 0.7211458 0.7261458 0.7375961 0.7440464 [2,] 0.9182052 0.9038542 0.8988542 0.8888542 0.8938542 0.8924039 0.8859536 [,8] [,9] [,10] [,11] [,12] [1,] 0.7569471 0.7569471 0.7898477 0.7869471 0.7704968 [2,] 0.8730529 0.8730529 0.8801523 0.9030529 0.8995032 $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.71, 0.815, 0.87, 0.91, 0.68, 0.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tzjj1354111241.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,] 0.680 0.710 0.850 0.820 0.800 0.79 NA [2,] 0.690 0.710 0.870 0.840 0.800 0.80 NA [3,] 0.700 0.735 0.875 0.855 0.805 0.82 NA [4,] 0.705 0.815 0.905 0.920 0.820 0.83 NA [5,] 0.710 0.900 0.910 0.940 0.840 0.83 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6931584 0.6871088 0.8590363 0.8185115 0.7958779 0.8063168 NA [2,] 0.7068416 0.7828912 0.8909637 0.8914885 0.8141221 0.8336832 NA $out [1] 0.87 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.68, 0.69, 0.7, 0.705, 0.71, 0.71, 0.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cu4j1354111241.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.06655825 0.170 0.06000 [2,] 0.07293344 0.200 0.07750 [3,] 0.07697948 0.220 0.09125 [4,] 0.08200529 0.225 0.10250 [5,] 0.09077445 0.230 0.13250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.07284175 0.2085973 0.07984733 [2,] 0.08111721 0.2314027 0.10265267 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.066558245169175, 0.0729334446847417, 0.0769794763534155, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fmvz1354111241.ps tmp/1fmvz1354111241.png",intern=TRUE)) character(0) > try(system("convert tmp/2evjo1354111241.ps tmp/2evjo1354111241.png",intern=TRUE)) character(0) > try(system("convert tmp/33p221354111241.ps tmp/33p221354111241.png",intern=TRUE)) character(0) > try(system("convert tmp/4t36y1354111241.ps tmp/4t36y1354111241.png",intern=TRUE)) character(0) > try(system("convert tmp/5tzjj1354111241.ps tmp/5tzjj1354111241.png",intern=TRUE)) character(0) > try(system("convert tmp/6cu4j1354111241.ps tmp/6cu4j1354111241.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.562 0.636 4.195