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(1.58,1.58,1.58,1.58,1.59,1.59,1.6,1.6,1.61,1.62,1.62,1.63,1.63,1.63,1.63,1.63,1.63,1.64,1.64,1.64,1.65,1.65,1.66,1.67,1.67,1.68,1.68,1.69,1.7,1.71,1.72,1.72,1.73,1.73,1.73,1.73,1.74,1.75,1.75,1.75,1.76,1.76,1.76,1.77,1.78,1.78,1.79,1.79,1.79,1.79,1.79,1.83,1.83,1.83,1.83,1.84,1.84,1.84,1.85,1.85,1.85,1.86,1.86,1.86,1.87,1.87,1.88,1.88,1.88,1.89,1.89,1.9) > 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.58 1.63 1.67 1.74 1.79 1.85 NA [2,] 1.58 1.63 1.68 1.75 1.79 1.86 NA [3,] 1.58 1.63 1.68 1.75 1.79 1.86 NA [4,] 1.58 1.63 1.69 1.75 1.83 1.86 NA [5,] 1.59 1.63 1.70 1.76 1.83 1.87 NA [6,] 1.59 1.64 1.71 1.76 1.83 1.87 NA [7,] 1.60 1.64 1.72 1.76 1.83 1.88 NA [8,] 1.60 1.64 1.72 1.77 1.84 1.88 NA [9,] 1.61 1.65 1.73 1.78 1.84 1.88 NA [10,] 1.62 1.65 1.73 1.78 1.84 1.89 NA [11,] 1.62 1.66 1.73 1.79 1.85 1.89 NA [12,] 1.63 1.67 1.73 1.79 1.85 1.90 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/124ij1354645065.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/25pse1354645065.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/3r81f1354645065.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/41bvo1354645065.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.580 1.580 1.580 1.58 1.59 1.590 1.60 1.600 1.610 1.620 1.62 1.63 [2,] 1.630 1.630 1.630 1.63 1.63 1.640 1.64 1.640 1.650 1.650 1.66 1.67 [3,] 1.705 1.715 1.715 1.72 1.73 1.735 1.74 1.745 1.755 1.755 1.76 1.76 [4,] 1.790 1.790 1.790 1.83 1.83 1.830 1.83 1.840 1.840 1.840 1.85 1.85 [5,] 1.850 1.860 1.860 1.86 1.87 1.870 1.88 1.880 1.880 1.890 1.89 1.90 $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.601795 1.611795 1.611795 1.590994 1.600994 1.612444 1.617444 1.615994 [2,] 1.808205 1.818205 1.818205 1.849006 1.859006 1.857556 1.862556 1.874006 [,9] [,10] [,11] [,12] [1,] 1.632444 1.632444 1.637444 1.643894 [2,] 1.877556 1.877556 1.882556 1.876106 $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.58, 1.63, 1.705, 1.79, 1.85, 1.58, 1.63, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5t4c81354645065.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.580 1.63 1.670 1.74 1.79 1.850 NA [2,] 1.580 1.63 1.685 1.75 1.81 1.860 NA [3,] 1.595 1.64 1.715 1.76 1.83 1.875 NA [4,] 1.615 1.65 1.730 1.78 1.84 1.885 NA [5,] 1.630 1.67 1.730 1.79 1.85 1.900 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.579036 1.630878 1.694475 1.746317 1.816317 1.863597 NA [2,] 1.610964 1.649122 1.735525 1.773683 1.843683 1.886403 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.58, 1.58, 1.595, 1.615, 1.63, 1.63, 1.63, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mmw51354645065.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.1017841 0.27 0.13750 [2,] 0.1044509 0.27 0.14375 [3,] 0.1059322 0.28 0.15500 [4,] 0.1090911 0.28 0.16000 [5,] 0.1105743 0.28 0.16500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1038158 0.2754389 0.1475883 [2,] 0.1080486 0.2845611 0.1624117 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.101784085199996, 0.104450945424156, 0.105932155424431, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/124ij1354645065.ps tmp/124ij1354645065.png",intern=TRUE)) character(0) > try(system("convert tmp/25pse1354645065.ps tmp/25pse1354645065.png",intern=TRUE)) character(0) > try(system("convert tmp/3r81f1354645065.ps tmp/3r81f1354645065.png",intern=TRUE)) character(0) > try(system("convert tmp/41bvo1354645065.ps tmp/41bvo1354645065.png",intern=TRUE)) character(0) > try(system("convert tmp/5t4c81354645065.ps tmp/5t4c81354645065.png",intern=TRUE)) character(0) > try(system("convert tmp/6mmw51354645065.ps tmp/6mmw51354645065.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.237 0.523 3.776