R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(2.3,2.31,2.31,2.32,2.33,2.34,2.36,2.37,2.37,2.38,2.39,2.4,2.4,2.39,2.4,2.42,2.42,2.44,2.44,2.44,2.45,2.46,2.47,2.48,2.48,2.49,2.5,2.51,2.52,2.52,2.52,2.54,2.54,2.54,2.56,2.57,2.58,2.58,2.58,2.58,2.59,2.6,2.61,2.61,2.62,2.63,2.65,2.67,2.68,2.67,2.68,2.68,2.68,2.68,2.69,2.69,2.69,2.7,2.71,2.72,2.71,2.72,2.73,2.74,2.74,2.75,2.75,2.76,2.75,2.78,2.79,2.8,2.81,2.81,2.82,2.82,2.83,2.83,2.84,2.84,2.84,2.86,2.87) > 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] 83 > (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] 7 7 7 7 7 7 7 7 7 7 7 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.30 2.40 2.48 2.58 2.68 2.71 2.81 [2,] 2.31 2.39 2.49 2.58 2.67 2.72 2.81 [3,] 2.31 2.40 2.50 2.58 2.68 2.73 2.82 [4,] 2.32 2.42 2.51 2.58 2.68 2.74 2.82 [5,] 2.33 2.42 2.52 2.59 2.68 2.74 2.83 [6,] 2.34 2.44 2.52 2.60 2.68 2.75 2.83 [7,] 2.36 2.44 2.52 2.61 2.69 2.75 2.84 [8,] 2.37 2.44 2.54 2.61 2.69 2.76 2.84 [9,] 2.37 2.45 2.54 2.62 2.69 2.75 2.84 [10,] 2.38 2.46 2.54 2.63 2.70 2.78 2.86 [11,] 2.39 2.47 2.56 2.65 2.71 2.79 2.87 [12,] 2.40 2.48 2.57 2.67 2.72 2.80 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/1wnbz1337949549.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/2ji8s1337949549.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/3lmpz1337949549.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/420gt1337949549.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,] 2.300 2.310 2.310 2.320 2.33 2.340 2.36 2.370 2.370 2.38 2.390 2.40 [2,] 2.440 2.440 2.450 2.465 2.47 2.480 2.48 2.490 2.495 2.50 2.515 2.48 [3,] 2.580 2.580 2.580 2.580 2.59 2.600 2.61 2.610 2.620 2.63 2.650 2.62 [4,] 2.695 2.695 2.705 2.710 2.71 2.715 2.72 2.725 2.720 2.74 2.750 2.72 [5,] 2.810 2.810 2.820 2.820 2.83 2.830 2.84 2.840 2.840 2.86 2.870 2.80 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.427718 2.427718 2.427718 2.43369 2.446676 2.459662 2.466676 2.469662 [2,] 2.732282 2.732282 2.732282 2.72631 2.733324 2.740338 2.753324 2.750338 [,9] [,10] [,11] [,12] [1,] 2.485634 2.486676 2.509662 2.465192 [2,] 2.754366 2.773324 2.790338 2.774808 $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(2.3, 2.44, 2.58, 2.695, 2.81, 2.31, 2.44, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wqv51337949549.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,] 2.300 2.390 2.480 2.580 2.670 2.710 2.81 [2,] 2.315 2.410 2.505 2.580 2.680 2.735 2.82 [3,] 2.350 2.440 2.520 2.605 2.685 2.750 2.83 [4,] 2.375 2.455 2.540 2.625 2.695 2.770 2.84 [5,] 2.400 2.480 2.570 2.670 2.710 2.800 2.87 $n [1] 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.322634 2.419475 2.504036 2.584475 2.678158 2.734036 2.820472 [2,] 2.377366 2.460525 2.535964 2.625525 2.691842 2.765964 2.839528 $out [1] 2.72 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2.3, 2.315, 2.35, 2.375, 2.4, 2.39, 2.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l0tu1337949549.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.1668761 0.470 0.225 [2,] 0.1710294 0.475 0.235 [3,] 0.1733144 0.485 0.240 [4,] 0.1797709 0.500 0.250 [5,] 0.1832900 0.510 0.255 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1693274 0.4735973 0.2331584 [2,] 0.1773015 0.4964027 0.2468416 $out [1] 0.1512173 0.4000000 0.2050000 $group [1] 1 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.166876058940817, 0.171029371293277, 0.173314424429577, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wnbz1337949549.ps tmp/1wnbz1337949549.png",intern=TRUE)) character(0) > try(system("convert tmp/2ji8s1337949549.ps tmp/2ji8s1337949549.png",intern=TRUE)) character(0) > try(system("convert tmp/3lmpz1337949549.ps tmp/3lmpz1337949549.png",intern=TRUE)) character(0) > try(system("convert tmp/420gt1337949549.ps tmp/420gt1337949549.png",intern=TRUE)) character(0) > try(system("convert tmp/5wqv51337949549.ps tmp/5wqv51337949549.png",intern=TRUE)) character(0) > try(system("convert tmp/6l0tu1337949549.ps tmp/6l0tu1337949549.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.447 0.388 1.836