R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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(39.28,39.36,39.55,39.64,39.8,39.79,39.79,39.86,39.91,40,40.01,40.01,40.01,39.96,40,39.76,39.68,39.7,39.7,39.73,39.64,39.56,39.67,39.66,39.66,40.05,39.99,40.06,40.08,40.1,40.1,40.12,40.07,40.24,40.58,40.72,40.72,40.89,40.9,41.04,41.27,41.29,41.29,41.33,41.34,41.37,41.33,41.37,41.37,41.42,41.61,41.58,41.75,41.75,41.75,41.85,41.84,41.97,42.01,42.04,42.04,42.06,41.93,41.93,41.99,42.03,42.03,42.12,42.22,42.21,42.23,42.22) > 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,] 39.28 40.01 39.66 40.72 41.37 42.04 NA [2,] 39.36 39.96 40.05 40.89 41.42 42.06 NA [3,] 39.55 40.00 39.99 40.90 41.61 41.93 NA [4,] 39.64 39.76 40.06 41.04 41.58 41.93 NA [5,] 39.80 39.68 40.08 41.27 41.75 41.99 NA [6,] 39.79 39.70 40.10 41.29 41.75 42.03 NA [7,] 39.79 39.70 40.10 41.29 41.75 42.03 NA [8,] 39.86 39.73 40.12 41.33 41.85 42.12 NA [9,] 39.91 39.64 40.07 41.34 41.84 42.22 NA [10,] 40.00 39.56 40.24 41.37 41.97 42.21 NA [11,] 40.01 39.67 40.58 41.33 42.01 42.23 NA [12,] 40.01 39.66 40.72 41.37 42.04 42.22 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/1awrc1354985209.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/24g7y1354985209.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/3eehb1354985209.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/4zy7t1354985209.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,] 39.280 39.36 39.55 39.64 39.680 39.700 39.700 39.730 39.640 39.560 39.670 [2,] 39.660 39.96 39.99 39.76 39.800 39.790 39.790 39.860 39.910 40.000 40.010 [3,] 40.365 40.47 40.45 40.55 40.675 40.695 40.695 40.725 40.705 40.805 40.955 [4,] 41.370 41.42 41.61 41.58 41.750 41.750 41.750 41.850 41.840 41.970 42.010 [5,] 42.040 42.06 41.93 41.93 41.990 42.030 42.030 42.120 42.220 42.210 42.230 [,12] [1,] 39.660 [2,] 40.010 [3,] 41.045 [4,] 42.040 [5,] 42.220 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 39.26199 39.52825 39.40505 39.37604 39.41719 39.43074 39.43074 39.44139 [2,] 41.46801 41.41175 41.49495 41.72396 41.93281 41.95926 41.95926 42.00861 [,9] [,10] [,11] [,12] [1,] 39.46009 39.53429 39.66494 39.73558 [2,] 41.94991 42.07571 42.24506 42.35442 $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(39.28, 39.66, 40.365, 41.37, 42.04, 39.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/56y4b1354985209.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,] 39.280 39.560 39.990 40.720 41.370 41.930 NA [2,] 39.595 39.665 40.055 40.970 41.595 42.010 NA [3,] 39.795 39.700 40.090 41.290 41.750 42.050 NA [4,] 39.955 39.860 40.180 41.335 41.910 42.215 NA [5,] 40.010 40.010 40.240 41.370 42.040 42.230 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 39.6308 39.61106 40.03299 41.12352 41.60633 41.9565 NA [2,] 39.9592 39.78894 40.14701 41.45648 41.89367 42.1435 NA $out [1] 39.66 40.58 40.72 $group [1] 3 3 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(39.28, 39.595, 39.795, 39.955, 40.01, 39.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6k5h41354985209.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.9684558 2.290 1.30500 [2,] 1.0216327 2.330 1.53500 [3,] 1.0455837 2.475 1.72375 [4,] 1.0592112 2.615 1.76625 [5,] 1.1065878 2.760 1.79500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.028444 2.34501 1.618275 [2,] 1.062724 2.60499 1.829225 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.968455815546929, 1.02163266219553, 1.04558372518381, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1awrc1354985209.ps tmp/1awrc1354985209.png",intern=TRUE)) character(0) > try(system("convert tmp/24g7y1354985209.ps tmp/24g7y1354985209.png",intern=TRUE)) character(0) > try(system("convert tmp/3eehb1354985209.ps tmp/3eehb1354985209.png",intern=TRUE)) character(0) > try(system("convert tmp/4zy7t1354985209.ps tmp/4zy7t1354985209.png",intern=TRUE)) character(0) > try(system("convert tmp/56y4b1354985209.ps tmp/56y4b1354985209.png",intern=TRUE)) character(0) > try(system("convert tmp/6k5h41354985209.ps tmp/6k5h41354985209.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.112 0.846 3.964