R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 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(55.64,56.13,56.69,56.8,56.93,57,57.01,57.21,57.17,57.36,57.29,57.26,57.29,57.68,58.19,58.34,58.46,58.67,58.72,58.74,58.77,58.84,59.13,59.12,59.12,59.33,59.49,59.67,59.7,59.73,59.74,59.62,59.6,59.98,60.05,60.06,60.1,60.18,60.38,60.52,60.78,60.72,60.72,60.86,60.99,61.11,61.17,61.19,61.19,61.22,61.19,60.82,60.6,60.15,60.14,60.2,60.36,60.38,60.44,60.47) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 55.64 57.29 59.12 60.10 61.19 NA [2,] 56.13 57.68 59.33 60.18 61.22 NA [3,] 56.69 58.19 59.49 60.38 61.19 NA [4,] 56.80 58.34 59.67 60.52 60.82 NA [5,] 56.93 58.46 59.70 60.78 60.60 NA [6,] 57.00 58.67 59.73 60.72 60.15 NA [7,] 57.01 58.72 59.74 60.72 60.14 NA [8,] 57.21 58.74 59.62 60.86 60.20 NA [9,] 57.17 58.77 59.60 60.99 60.36 NA [10,] 57.36 58.84 59.98 61.11 60.38 NA [11,] 57.29 59.13 60.05 61.17 60.44 NA [12,] 57.26 59.12 60.06 61.19 60.47 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/17guv1398716553.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/2xgdl1398716553.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/3d3yu1398716553.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/4r8ad1398716553.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,] 55.64 56.13 56.69 56.80 56.93 57.00 57.01 57.21 57.17 57.36 57.29 57.26 [2,] 57.29 57.68 58.19 58.34 58.46 58.67 58.72 58.74 58.77 58.84 59.13 59.12 [3,] 59.12 59.33 59.49 59.67 59.70 59.73 59.74 59.62 59.60 59.98 60.05 60.06 [4,] 60.10 60.18 60.38 60.52 60.60 60.15 60.14 60.20 60.36 60.38 60.44 60.47 [5,] 61.19 61.22 61.19 60.82 60.78 60.72 60.72 60.86 60.99 61.11 61.17 61.19 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 57.13446 57.56351 57.94255 58.12962 58.18788 58.68424 58.73663 58.58837 [2,] 61.10554 61.09649 61.03745 61.21038 61.21212 60.77576 60.74337 60.65163 [,9] [,10] [,11] [,12] [1,] 58.47651 58.89184 59.12436 59.10609 [2,] 60.72349 61.06816 60.97564 61.01391 $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(55.64, 57.29, 59.12, 60.1, 61.19, 56.13, 57.68, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zean1398716553.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] [1,] 56.130 57.680 59.120 60.10 60.140 NA [2,] 56.745 58.265 59.545 60.45 60.280 NA [3,] 57.005 58.695 59.685 60.75 60.455 NA [4,] 57.235 58.805 59.860 61.05 61.005 NA [5,] 57.360 59.130 60.060 61.19 61.220 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 56.78151 58.4487 59.54133 60.47634 60.12432 NA [2,] 57.22849 58.9413 59.82867 61.02366 60.78568 NA $out [1] 55.64 57.29 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(56.13, 56.745, 57.005, 57.235, 57.36, 57.68, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hgzs1398716553.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,] 1.416362 3.650 1.310 [2,] 1.466562 3.735 1.440 [3,] 1.505336 3.865 1.565 [4,] 1.725162 4.260 2.185 [5,] 2.022788 4.500 2.810 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.387387 3.625544 1.2252 [2,] 1.623286 4.104456 1.9048 $out [1] 2.218281 5.550000 5.090000 $group [1] 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.41636153576691, 1.46656228309132, 1.50533636676668, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17guv1398716553.ps tmp/17guv1398716553.png",intern=TRUE)) character(0) > try(system("convert tmp/2xgdl1398716553.ps tmp/2xgdl1398716553.png",intern=TRUE)) character(0) > try(system("convert tmp/3d3yu1398716553.ps tmp/3d3yu1398716553.png",intern=TRUE)) character(0) > try(system("convert tmp/4r8ad1398716553.ps tmp/4r8ad1398716553.png",intern=TRUE)) character(0) > try(system("convert tmp/5zean1398716553.ps tmp/5zean1398716553.png",intern=TRUE)) character(0) > try(system("convert tmp/6hgzs1398716553.ps tmp/6hgzs1398716553.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.022 0.868 4.911