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(79.57,77.45,75.79,74.88,74.5,74.59,74.59,73.57,73.3,73.23,73,72.31,72.31,71.24,70.82,70.66,69.94,69.87,69.87,68.88,68.09,68.38,66.78,67.2,67.2,66.67,65.86,66.05,66.31,66.39,66.39,65.72,65.52,64.93,65.27,65.04,65.02,64.72,64.68,64.41,64.79,64.71,64.71,64.83,64.77,64.19,64.27,64.23,64.23,63.03,62.85,62.15,61.69,62.1,62.1,61.81,61.28,61.05,61.08,60.98,60.98,61.11,60.58,60.37,59.44,59.29,59.29,59.33,59.06,58.75,58.92,58.73) > 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,] 79.57 72.31 67.20 65.02 64.23 60.98 NA [2,] 77.45 71.24 66.67 64.72 63.03 61.11 NA [3,] 75.79 70.82 65.86 64.68 62.85 60.58 NA [4,] 74.88 70.66 66.05 64.41 62.15 60.37 NA [5,] 74.50 69.94 66.31 64.79 61.69 59.44 NA [6,] 74.59 69.87 66.39 64.71 62.10 59.29 NA [7,] 74.59 69.87 66.39 64.71 62.10 59.29 NA [8,] 73.57 68.88 65.72 64.83 61.81 59.33 NA [9,] 73.30 68.09 65.52 64.77 61.28 59.06 NA [10,] 73.23 68.38 64.93 64.19 61.05 58.75 NA [11,] 73.00 66.78 65.27 64.27 61.08 58.92 NA [12,] 72.31 67.20 65.04 64.23 60.98 58.73 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/1w6f91366875405.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/2k9sf1366875405.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/3049b1366875405.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/403ef1366875405.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,] 60.98 61.110 60.58 60.37 59.44 59.29 59.29 59.330 59.060 58.75 58.92 [2,] 64.23 63.030 62.85 62.15 61.69 62.10 62.10 61.810 61.280 61.05 61.08 [3,] 66.11 65.695 65.27 65.23 65.55 65.55 65.55 65.275 65.145 64.56 64.77 [4,] 72.31 71.240 70.82 70.66 69.94 69.87 69.87 68.880 68.090 68.38 66.78 [5,] 79.57 77.450 75.79 74.88 74.50 74.59 74.59 73.570 73.300 73.23 73.00 [,12] [1,] 58.730 [2,] 60.980 [3,] 64.635 [4,] 67.200 [5,] 72.310 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 60.89814 60.39928 60.12909 59.74078 60.22848 60.5381 60.5381 60.71462 [2,] 71.32186 70.99072 70.41091 70.71922 70.87152 70.5619 70.5619 69.83538 [,9] [,10] [,11] [,12] [1,] 60.75233 59.83191 61.09332 60.6229 [2,] 69.53767 69.28809 68.44668 68.6471 $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(60.98, 64.23, 66.11, 72.31, 79.57, 61.11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5izxo1366875405.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,] 72.310 66.780 64.930 64.19 60.980 58.730 NA [2,] 73.265 68.235 65.395 64.34 61.180 58.990 NA [3,] 74.545 69.870 65.955 64.71 61.955 59.310 NA [4,] 75.335 70.740 66.390 64.78 62.500 60.475 NA [5,] 77.450 72.310 67.200 65.02 64.230 61.110 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 73.60086 68.72745 65.50117 64.50931 61.35294 58.63268 NA [2,] 75.48914 71.01255 66.40883 64.91069 62.55706 59.98732 NA $out [1] 79.57 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(72.31, 73.265, 74.545, 75.335, 77.45, 66.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dwrc1366875405.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,] 4.774178 13.580 4.52500 [2,] 5.056843 14.240 5.41000 [3,] 5.470126 14.785 6.24750 [4,] 5.545114 15.300 6.58625 [5,] 6.035213 16.340 6.79250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.247422 14.30153 5.711004 [2,] 5.692830 15.26847 6.783996 $out [1] 6.710718 18.590000 $group [1] 1 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.77417811425869, 5.05684339608904, 5.47012602466547, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w6f91366875405.ps tmp/1w6f91366875405.png",intern=TRUE)) character(0) > try(system("convert tmp/2k9sf1366875405.ps tmp/2k9sf1366875405.png",intern=TRUE)) character(0) > try(system("convert tmp/3049b1366875405.ps tmp/3049b1366875405.png",intern=TRUE)) character(0) > try(system("convert tmp/403ef1366875405.ps tmp/403ef1366875405.png",intern=TRUE)) character(0) > try(system("convert tmp/5izxo1366875405.ps tmp/5izxo1366875405.png",intern=TRUE)) character(0) > try(system("convert tmp/6dwrc1366875405.ps tmp/6dwrc1366875405.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.356 1.054 6.533