R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(10.92,10.98,11.15,11.19,11.33,11.38,11.4,11.45,11.56,11.61,11.82,11.77,11.85,11.82,11.92,11.86,11.87,11.94,11.86,11.92,11.83,11.91,11.93,11.99,11.96,12.12,11.85,12.01,12.1,12.21,12.31,12.31,12.39,12.35,12.41,12.51,12.27,12.51,12.44,12.47,12.51,12.58,12.5,12.52,12.59,12.51,12.67,12.64,12.54,12.6,12.67,12.62,12.72,12.85,12.85,12.82,12.79,12.94,12.71,12.56,12.64,12.7,12.74,12.85,12.84,12.83,12.88,13.07,12.99,13.2,13.23,13.18) > 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,] 10.92 11.85 11.96 12.27 12.54 12.64 NA [2,] 10.98 11.82 12.12 12.51 12.60 12.70 NA [3,] 11.15 11.92 11.85 12.44 12.67 12.74 NA [4,] 11.19 11.86 12.01 12.47 12.62 12.85 NA [5,] 11.33 11.87 12.10 12.51 12.72 12.84 NA [6,] 11.38 11.94 12.21 12.58 12.85 12.83 NA [7,] 11.40 11.86 12.31 12.50 12.85 12.88 NA [8,] 11.45 11.92 12.31 12.52 12.82 13.07 NA [9,] 11.56 11.83 12.39 12.59 12.79 12.99 NA [10,] 11.61 11.91 12.35 12.51 12.94 13.20 NA [11,] 11.82 11.93 12.41 12.67 12.71 13.23 NA [12,] 11.77 11.99 12.51 12.64 12.56 13.18 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/1l8py1366983494.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/26lbz1366983494.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/3eoh21366983494.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/4zf2q1366983494.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] [1,] 10.920 10.980 11.15 11.19 11.330 11.380 11.400 11.450 11.56 11.61 11.82 [2,] 11.850 11.820 11.85 11.86 11.870 11.940 11.860 11.920 11.83 11.91 11.93 [3,] 12.115 12.315 12.18 12.24 12.305 12.395 12.405 12.415 12.49 12.43 12.54 [4,] 12.540 12.600 12.67 12.62 12.720 12.830 12.850 12.820 12.79 12.94 12.71 [5,] 12.640 12.700 12.74 12.85 12.840 12.850 12.880 13.070 12.99 13.20 13.23 [,12] [1,] 11.770 [2,] 11.990 [3,] 12.535 [4,] 12.640 [5,] 13.180 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 11.66993 11.81187 11.65107 11.74978 11.75672 11.82092 11.76642 11.83447 [2,] 12.56007 12.81813 12.70893 12.73022 12.85328 12.96908 13.04358 12.99553 [,9] [,10] [,11] [,12] [1,] 11.87077 11.76562 12.03687 12.11573 [2,] 13.10923 13.09438 13.04313 12.95427 $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(10.92, 11.85, 12.115, 12.54, 12.64, 10.98, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5m4ei1366983494.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,] 10.920 11.820 11.850 12.440 12.540 12.640 NA [2,] 11.170 11.855 12.055 12.485 12.610 12.785 NA [3,] 11.390 11.890 12.260 12.510 12.715 12.865 NA [4,] 11.585 11.925 12.370 12.585 12.835 13.125 NA [5,] 11.820 11.990 12.510 12.670 12.940 13.230 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 11.20072 11.85807 12.11633 12.46439 12.61238 12.70992 NA [2,] 11.57928 11.92193 12.40367 12.55561 12.81762 13.02008 NA $out [1] 12.27 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(10.92, 11.17, 11.39, 11.585, 11.82, 11.82, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/68yx11366983494.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.5277278 1.41 0.59500 [2,] 0.5658394 1.45 0.66625 [3,] 0.5870941 1.55 0.73375 [4,] 0.6065983 1.64 0.76500 [5,] 0.6493818 1.72 0.81250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5685037 1.46334 0.6887095 [2,] 0.6056845 1.63666 0.7787905 $out [1] 0.5016539 0.5000000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.527727833894202, 0.565839429819431, 0.587094084630168, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1l8py1366983494.ps tmp/1l8py1366983494.png",intern=TRUE)) character(0) > try(system("convert tmp/26lbz1366983494.ps tmp/26lbz1366983494.png",intern=TRUE)) character(0) > try(system("convert tmp/3eoh21366983494.ps tmp/3eoh21366983494.png",intern=TRUE)) character(0) > try(system("convert tmp/4zf2q1366983494.ps tmp/4zf2q1366983494.png",intern=TRUE)) character(0) > try(system("convert tmp/5m4ei1366983494.ps tmp/5m4ei1366983494.png",intern=TRUE)) character(0) > try(system("convert tmp/68yx11366983494.ps tmp/68yx11366983494.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.920 0.547 3.456