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(1.01,1.02,1.04,1.06,1.06,1.06,1.06,1.06,1.02,0.98,0.99,0.99,0.94,0.96,0.98,1.01,1.01,1.02,1.04,1.03,1.05,1.08,1.17,1.11,1.11,1.11,1.2,1.21,1.31,1.37,1.37,1.26,1.23,1.17,1.06,0.95,0.92,0.92,0.9,0.93,0.93,0.97,0.96,0.99,0.98,0.96,1,0.99,1.03,1.02,1.07,1.13,1.15,1.16,1.14,1.15,1.15,1.16,1.17,1.22,1.26,1.29,1.36,1.38,1.37,1.37,1.37,1.36,1.38,1.4,1.44,1.42) > 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,] 1.01 0.94 1.11 0.92 1.03 1.26 NA [2,] 1.02 0.96 1.11 0.92 1.02 1.29 NA [3,] 1.04 0.98 1.20 0.90 1.07 1.36 NA [4,] 1.06 1.01 1.21 0.93 1.13 1.38 NA [5,] 1.06 1.01 1.31 0.93 1.15 1.37 NA [6,] 1.06 1.02 1.37 0.97 1.16 1.37 NA [7,] 1.06 1.04 1.37 0.96 1.14 1.37 NA [8,] 1.06 1.03 1.26 0.99 1.15 1.36 NA [9,] 1.02 1.05 1.23 0.98 1.15 1.38 NA [10,] 0.98 1.08 1.17 0.96 1.16 1.40 NA [11,] 0.99 1.17 1.06 1.00 1.17 1.44 NA [12,] 0.99 1.11 0.95 0.99 1.22 1.42 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/10v591366993086.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/24nzm1366993086.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/3mdb11366993087.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/4f52j1366993087.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,] 0.92 0.92 0.900 0.930 0.930 0.97 0.96 0.990 0.98 0.96 0.990 0.95 [2,] 0.94 0.96 0.980 1.010 1.010 1.02 1.04 1.030 1.02 0.98 1.000 0.99 [3,] 1.02 1.02 1.055 1.095 1.105 1.11 1.10 1.105 1.10 1.12 1.115 1.05 [4,] 1.11 1.11 1.200 1.210 1.310 1.37 1.37 1.260 1.23 1.17 1.170 1.22 [5,] 1.26 1.29 1.360 1.380 1.370 1.37 1.37 1.360 1.38 1.40 1.170 1.42 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9103445 0.9232452 0.9130929 0.9659935 0.9114903 0.8842387 0.8871393 [2,] 1.1296555 1.1167548 1.1969071 1.2240065 1.2985097 1.3357613 1.3128607 [,8] [,9] [,10] [,11] [,12] [1,] 0.9566426 0.9645432 0.9974439 1.005345 0.9016426 [2,] 1.2533574 1.2354568 1.2425561 1.224655 1.1983574 $out [1] 1.44 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.92, 0.94, 1.02, 1.11, 1.26, 0.92, 0.96, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/501da1366993087.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,] 0.98 0.940 0.950 0.900 1.02 1.36 NA [2,] 1.00 0.995 1.110 0.925 1.10 1.36 NA [3,] 1.03 1.025 1.205 0.960 1.15 1.37 NA [4,] 1.06 1.065 1.285 0.985 1.16 1.39 NA [5,] 1.06 1.170 1.370 1.000 1.22 1.42 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.002634 0.9930725 1.125181 0.9326336 1.122634 1.356317 NA [2,] 1.057366 1.0569275 1.284819 0.9873664 1.177366 1.383683 NA $out [1] 1.26 1.29 1.44 $group [1] 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.98, 1, 1.03, 1.06, 1.06, 0.94, 0.995, 1.025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6yslm1366993087.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.1253395 0.340 0.11250 [2,] 0.1474861 0.385 0.15875 [3,] 0.1628459 0.425 0.17750 [4,] 0.1738406 0.450 0.22500 [5,] 0.1802961 0.470 0.28750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1508255 0.3953531 0.1472829 [2,] 0.1748664 0.4546469 0.2077171 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.125339538853468, 0.147486082915318, 0.162845944186902, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10v591366993086.ps tmp/10v591366993086.png",intern=TRUE)) character(0) > try(system("convert tmp/24nzm1366993086.ps tmp/24nzm1366993086.png",intern=TRUE)) character(0) > try(system("convert tmp/3mdb11366993087.ps tmp/3mdb11366993087.png",intern=TRUE)) character(0) > try(system("convert tmp/4f52j1366993087.ps tmp/4f52j1366993087.png",intern=TRUE)) character(0) > try(system("convert tmp/501da1366993087.ps tmp/501da1366993087.png",intern=TRUE)) character(0) > try(system("convert tmp/6yslm1366993087.ps tmp/6yslm1366993087.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.978 0.564 3.532