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(3.96,3.97,3.96,3.95,3.94,3.94,3.95,3.93,3.94,3.92,3.95,3.94,3.95,3.92,3.92,3.92,3.92,3.9,3.92,3.94,3.96,3.95,3.96,3.97,3.99,4,4.05,4.08,4.09,4.12,4.14,4.15,4.15,4.15,4.15,4.2,4.22,4.22,4.22,4.23,4.3,4.29,4.32,4.31,4.35,4.34,4.35,4.38,4.39,4.38,4.34,4.33,4.33,4.33,4.33,4.32,4.35,4.35,4.35,4.36,4.38,4.41,4.43,4.42,4.43,4.43,4.42,4.46,4.44,4.41,4.41,4.46,4.5,4.58,4.61,4.65,4.55,4.63,4.69,4.72,4.71,4.74,4.77,4.78) > 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,] 3.96 3.95 3.99 4.22 4.39 4.38 4.50 NA [2,] 3.97 3.92 4.00 4.22 4.38 4.41 4.58 NA [3,] 3.96 3.92 4.05 4.22 4.34 4.43 4.61 NA [4,] 3.95 3.92 4.08 4.23 4.33 4.42 4.65 NA [5,] 3.94 3.92 4.09 4.30 4.33 4.43 4.55 NA [6,] 3.94 3.90 4.12 4.29 4.33 4.43 4.63 NA [7,] 3.95 3.92 4.14 4.32 4.33 4.42 4.69 NA [8,] 3.93 3.94 4.15 4.31 4.32 4.46 4.72 NA [9,] 3.94 3.96 4.15 4.35 4.35 4.44 4.71 NA [10,] 3.92 3.95 4.15 4.34 4.35 4.41 4.74 NA [11,] 3.95 3.96 4.15 4.35 4.35 4.41 4.77 NA [12,] 3.94 3.97 4.20 4.38 4.36 4.46 4.78 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/1zd5d1386061260.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/2xbcz1386061260.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/3v5ty1386061260.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/4mwee1386061260.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,] 3.950 3.920 3.920 3.920 3.920 3.90 3.920 3.930 3.940 3.92 3.950 3.940 [2,] 3.975 3.985 4.005 4.015 4.015 4.03 4.045 4.045 4.055 4.05 4.055 4.085 [3,] 4.220 4.220 4.220 4.230 4.300 4.29 4.320 4.310 4.350 4.34 4.350 4.360 [4,] 4.385 4.395 4.385 4.375 4.380 4.38 4.375 4.390 4.395 4.38 4.380 4.420 [5,] 4.500 4.580 4.610 4.650 4.550 4.63 4.690 4.720 4.710 4.74 4.770 4.780 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3.975155 3.975155 3.99307 4.015014 4.082028 4.080986 4.122929 4.103972 [2,] 4.464845 4.464845 4.44693 4.444986 4.517972 4.499014 4.517071 4.516028 [,9] [,10] [,11] [,12] [1,] 4.146957 4.142929 4.155915 4.159943 [2,] 4.553043 4.537071 4.544085 4.560057 $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(3.95, 3.975, 4.22, 4.385, 4.5, 3.92, 3.985, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51svr1386061260.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,] 3.920 3.900 3.990 4.220 4.320 4.380 4.500 NA [2,] 3.940 3.920 4.065 4.225 4.330 4.410 4.595 NA [3,] 3.945 3.930 4.130 4.305 4.345 4.425 4.670 NA [4,] 3.955 3.955 4.150 4.345 4.355 4.435 4.730 NA [5,] 3.970 3.970 4.200 4.380 4.390 4.460 4.780 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3.938158 3.914036 4.091231 4.250267 4.333597 4.413597 4.608426 NA [2,] 3.951842 3.945964 4.168769 4.359733 4.356403 4.436403 4.731574 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(3.92, 3.94, 3.945, 3.955, 3.97, 3.9, 3.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6itzl1386061260.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.2320509 0.550 0.3250 [2,] 0.2563790 0.675 0.3325 [3,] 0.2683170 0.750 0.3475 [4,] 0.2846097 0.805 0.3725 [5,] 0.2928269 0.840 0.4100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.2554408 0.6907061 0.3292557 [2,] 0.2811932 0.8092939 0.3657443 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.232050897536767, 0.25637898156212, 0.26831697854257, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zd5d1386061260.ps tmp/1zd5d1386061260.png",intern=TRUE)) character(0) > try(system("convert tmp/2xbcz1386061260.ps tmp/2xbcz1386061260.png",intern=TRUE)) character(0) > try(system("convert tmp/3v5ty1386061260.ps tmp/3v5ty1386061260.png",intern=TRUE)) character(0) > try(system("convert tmp/4mwee1386061260.ps tmp/4mwee1386061260.png",intern=TRUE)) character(0) > try(system("convert tmp/51svr1386061260.ps tmp/51svr1386061260.png",intern=TRUE)) character(0) > try(system("convert tmp/6itzl1386061260.ps tmp/6itzl1386061260.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.748 1.158 6.881