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(1.005,1.026,1.043,1.068,1.07,1.091,1.102,1.091,1.121,1.134,1.225,1.191,1.184,1.207,1.271,1.299,1.411,1.437,1.462,1.36,1.33,1.234,1.142,1.017,1.016,1.013,1,1.018,1.024,1.075,1.055,1.091,1.062,1.083,1.099,1.097,1.138,1.138,1.181,1.223,1.23,1.232,1.209,1.209,1.218,1.225,1.242,1.294,1.33,1.357,1.407,1.42,1.386,1.377,1.393,1.371,1.393,1.405,1.438,1.424,1.47,1.481,1.506,1.503,1.478,1.433,1.459,1.51,1.526,1.543,1.529,1.499) > 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.005 1.184 1.016 1.138 1.330 1.470 NA [2,] 1.026 1.207 1.013 1.138 1.357 1.481 NA [3,] 1.043 1.271 1.000 1.181 1.407 1.506 NA [4,] 1.068 1.299 1.018 1.223 1.420 1.503 NA [5,] 1.070 1.411 1.024 1.230 1.386 1.478 NA [6,] 1.091 1.437 1.075 1.232 1.377 1.433 NA [7,] 1.102 1.462 1.055 1.209 1.393 1.459 NA [8,] 1.091 1.360 1.091 1.209 1.371 1.510 NA [9,] 1.121 1.330 1.062 1.218 1.393 1.526 NA [10,] 1.134 1.234 1.083 1.225 1.405 1.543 NA [11,] 1.225 1.142 1.099 1.242 1.438 1.529 NA [12,] 1.191 1.017 1.097 1.294 1.424 1.499 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/1z8gv1400616758.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/20tki1400616758.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/39ejz1400616758.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/4qrim1400616758.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,] 1.005 1.0130 1.000 1.018 1.024 1.0750 1.055 1.0910 1.062 1.0830 1.0990 [2,] 1.016 1.0260 1.043 1.068 1.070 1.0910 1.102 1.0910 1.121 1.1340 1.1420 [3,] 1.161 1.1725 1.226 1.261 1.308 1.3045 1.301 1.2845 1.274 1.2295 1.2335 [4,] 1.330 1.3570 1.407 1.420 1.411 1.4330 1.459 1.3710 1.393 1.4050 1.4380 [5,] 1.470 1.4810 1.506 1.503 1.478 1.4370 1.462 1.5100 1.526 1.5430 1.5290 [,12] [1,] 1.0170 [2,] 1.0970 [3,] 1.2425 [4,] 1.4240 [5,] 1.4990 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.9584599 0.9589943 0.9912082 1.033949 1.088044 1.083899 1.070723 1.103891 [2,] 1.3635401 1.3860057 1.4607918 1.488051 1.527956 1.525101 1.531277 1.465109 [,9] [,10] [,11] [,12] [1,] 1.098551 1.054696 1.04257 1.031574 [2,] 1.449449 1.404304 1.42443 1.453426 $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(1.005, 1.016, 1.161, 1.33, 1.47, 1.013, 1.026, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56usq1400616758.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,] 1.0050 1.0170 1.0000 1.1810 1.3300 1.433 NA [2,] 1.0555 1.1955 1.0170 1.1950 1.3740 1.474 NA [3,] 1.0910 1.2850 1.0585 1.2205 1.3930 1.501 NA [4,] 1.1275 1.3855 1.0870 1.2310 1.4135 1.518 NA [5,] 1.2250 1.4620 1.0990 1.2420 1.4380 1.543 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.05816 1.19834 1.026573 1.20408 1.374984 1.480931 NA [2,] 1.12384 1.37166 1.090427 1.23692 1.411016 1.521069 NA $out [1] 1.138 1.138 1.294 $group [1] 4 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.005, 1.0555, 1.091, 1.1275, 1.225, 1.017, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6d4uo1400616758.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.1657183 0.3620 0.20550 [2,] 0.1712274 0.4245 0.23950 [3,] 0.1818031 0.4620 0.26825 [4,] 0.1881348 0.4750 0.29375 [5,] 0.1996624 0.5060 0.31375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1740915 0.4389666 0.2435062 [2,] 0.1895146 0.4850334 0.2929938 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.165718335336397, 0.17122735726882, 0.181803052367717, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1z8gv1400616758.ps tmp/1z8gv1400616758.png",intern=TRUE)) character(0) > try(system("convert tmp/20tki1400616758.ps tmp/20tki1400616758.png",intern=TRUE)) character(0) > try(system("convert tmp/39ejz1400616758.ps tmp/39ejz1400616758.png",intern=TRUE)) character(0) > try(system("convert tmp/4qrim1400616758.ps tmp/4qrim1400616758.png",intern=TRUE)) character(0) > try(system("convert tmp/56usq1400616758.ps tmp/56usq1400616758.png",intern=TRUE)) character(0) > try(system("convert tmp/6d4uo1400616758.ps tmp/6d4uo1400616758.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.785 0.549 3.366