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(4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.06,4.07,4.07,4.07,4.07,4.07,4.30,4.44,4.52,4.52,4.52,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.61,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.66,4.70,4.72,4.73,4.73,4.74,4.74,4.74,4.76,4.88,4.88,4.88,4.88,4.89,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.98,5.00,5.03,5.04,5.04,5.05,5.05,5.05,5.06,5.06,5.06,5.07,5.09,5.18,5.23,5.25,5.26,5.28,5.29) > 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] 82 > (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 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.00 4.07 4.53 4.63 4.88 4.97 5.06 [2,] 4.00 4.07 4.53 4.63 4.88 4.97 5.06 [3,] 4.00 4.30 4.53 4.66 4.88 4.97 5.07 [4,] 4.00 4.44 4.61 4.70 4.89 4.98 5.09 [5,] 4.00 4.52 4.63 4.72 4.97 5.00 5.18 [6,] 4.00 4.52 4.63 4.73 4.97 5.03 5.23 [7,] 4.00 4.52 4.63 4.73 4.97 5.04 5.25 [8,] 4.00 4.53 4.63 4.74 4.97 5.04 5.26 [9,] 4.06 4.53 4.63 4.74 4.97 5.05 5.28 [10,] 4.07 4.53 4.63 4.74 4.97 5.05 5.29 [11,] 4.07 4.53 4.63 4.76 4.97 5.05 NA [12,] 4.07 4.53 4.63 4.88 4.97 5.06 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/1p5wz1367256187.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/2jr6s1367256187.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/3gkfz1367256187.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/4evk21367256187.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,] 4.000 4.000 4.000 4.000 4.000 4.000 4.000 4.000 4.06 4.07 4.070 4.070 [2,] 4.300 4.300 4.415 4.525 4.575 4.575 4.575 4.580 4.58 4.58 4.530 4.530 [3,] 4.630 4.630 4.660 4.700 4.720 4.730 4.730 4.740 4.74 4.74 4.695 4.755 [4,] 4.925 4.925 4.925 4.935 4.985 5.000 5.005 5.005 5.01 5.01 4.970 4.970 [5,] 5.060 5.060 5.070 5.090 5.180 5.230 5.250 5.260 5.28 5.29 5.050 5.060 $n [1] 7 7 7 7 7 7 7 7 7 7 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4.25676 4.25676 4.355436 4.455155 4.475155 4.476197 4.473211 4.486197 [2,] 5.00324 5.00324 4.964564 4.944845 4.964845 4.983803 4.986789 4.993803 [,9] [,10] [,11] [,12] [1,] 4.483211 4.483211 4.411186 4.471186 [2,] 4.996789 4.996789 4.978814 5.038814 $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(4, 4.3, 4.63, 4.925, 5.06, 4, 4.3, 4.63, 4.925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5wlv51367256187.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,] 4.000 4.30 4.53 4.63 4.880 4.970 5.060 [2,] 4.000 4.37 4.57 4.68 4.885 4.975 5.070 [3,] 4.000 4.52 4.63 4.73 4.970 5.035 5.205 [4,] 4.065 4.53 4.63 4.74 4.970 5.050 5.260 [5,] 4.070 4.53 4.63 4.76 4.970 5.060 5.290 $n [1] 12 12 12 12 12 12 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.970353 4.447023 4.602634 4.702634 4.931231 5.000792 5.110068 [2,] 4.029647 4.592977 4.657366 4.757366 5.008769 5.069208 5.299932 $out [1] 4.07 4.07 4.88 $group [1] 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(4, 4, 4, 4.065, 4.07, 4.3, 4.37, 4.52, 4.53, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/67pp01367256187.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.3531808 0.980 0.3625 [2,] 0.3780428 1.060 0.4100 [3,] 0.3993177 1.135 0.4275 [4,] 0.4111014 1.225 0.4700 [5,] 0.4229038 1.260 0.5100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.3842395 1.059742 0.4001336 [2,] 0.4143960 1.210258 0.4548664 $out [1] 0.625 0.625 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.353180784679272, 0.378042750367136, 0.399317738532101, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1p5wz1367256187.ps tmp/1p5wz1367256187.png",intern=TRUE)) character(0) > try(system("convert tmp/2jr6s1367256187.ps tmp/2jr6s1367256187.png",intern=TRUE)) character(0) > try(system("convert tmp/3gkfz1367256187.ps tmp/3gkfz1367256187.png",intern=TRUE)) character(0) > try(system("convert tmp/4evk21367256187.ps tmp/4evk21367256187.png",intern=TRUE)) character(0) > try(system("convert tmp/5wlv51367256187.ps tmp/5wlv51367256187.png",intern=TRUE)) character(0) > try(system("convert tmp/67pp01367256187.ps tmp/67pp01367256187.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.865 0.584 3.432