R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(155.28,173.24,180.16,181.52,182.25,182.19,182,181.65,180.07,182.62,180.38,181.15,180.5,181.14,180.93,211.91,223.81,226.88,226.8,231.81,232.06,232.32,228.37,226.31,225.72,219.98,219.31,215.19,213.81,213.7,213.6,213.52,218.39,219.97,221.09,219.17,219.17,218.45,216.88,216.19,214.59,269.87,272.71,280.35,274.5,268.86,261.7,263.98,263.01,262.79,263.59,267,267.89,267.86,266.84,268.24,267.67,269.07,270.87,271.68,271.63,275.21,276.66,276.08,278.3,279.06,279.28,279.12,262.72,262.55,260.7,259.14,260.61,260.53,259.07,257.01,257.08,256.83,256.75,257.61,258.58,259.57,259.29,258.51) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 155.28 180.50 225.72 219.17 263.01 271.63 260.61 NA [2,] 173.24 181.14 219.98 218.45 262.79 275.21 260.53 NA [3,] 180.16 180.93 219.31 216.88 263.59 276.66 259.07 NA [4,] 181.52 211.91 215.19 216.19 267.00 276.08 257.01 NA [5,] 182.25 223.81 213.81 214.59 267.89 278.30 257.08 NA [6,] 182.19 226.88 213.70 269.87 267.86 279.06 256.83 NA [7,] 182.00 226.80 213.60 272.71 266.84 279.28 256.75 NA [8,] 181.65 231.81 213.52 280.35 268.24 279.12 257.61 NA [9,] 180.07 232.06 218.39 274.50 267.67 262.72 258.58 NA [10,] 182.62 232.32 219.97 268.86 269.07 262.55 259.57 NA [11,] 180.38 228.37 221.09 261.70 270.87 260.70 259.29 NA [12,] 181.15 226.31 219.17 263.98 271.68 259.14 258.51 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/11u5n1385976499.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/2ufpk1385976499.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/3gwny1385976499.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/4jijd1385976499.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] [1,] 155.280 173.240 180.160 181.520 182.250 182.190 182.000 181.650 180.070 [2,] 199.835 199.795 198.905 213.550 214.200 220.290 220.200 222.665 225.225 [3,] 225.720 219.980 219.310 216.190 223.810 256.830 256.750 257.610 258.580 [4,] 261.810 261.660 261.330 262.005 262.485 268.865 269.775 273.680 265.195 [5,] 271.630 275.210 276.660 276.080 278.300 279.060 279.280 280.350 274.500 [,10] [,11] [,12] [1,] 182.620 180.38 181.15 [2,] 226.145 224.73 222.74 [3,] 259.570 259.29 258.51 [4,] 265.705 261.20 261.56 [5,] 269.070 270.87 271.68 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 188.7095 183.0352 182.0308 187.2535 194.975 227.8218 227.1446 227.1447 [2,] 262.7305 256.9248 256.5892 245.1265 252.645 285.8382 286.3554 288.0753 [,9] [,10] [,11] [,12] [1,] 234.7106 235.9454 237.5107 235.3273 [2,] 282.4494 283.1946 281.0693 281.6927 $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(155.28, 199.835, 225.72, 261.81, 271.63, 173.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ufv21385976499.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] [,8] [1,] 180.070 180.500 213.520 214.590 262.790 259.140 256.750 NA [2,] 180.115 196.525 213.755 217.665 265.215 262.635 257.045 NA [3,] 181.335 226.555 218.780 262.840 267.765 275.645 258.545 NA [4,] 182.095 230.090 219.975 271.290 268.655 278.680 259.430 NA [5,] 182.620 232.320 225.720 280.350 271.680 279.280 260.610 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 180.4319 211.2458 215.943 238.3813 266.196 268.3268 257.4572 NA [2,] 182.2381 241.8642 221.617 287.2987 269.334 282.9632 259.6328 NA $out [1] 155.28 173.24 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(180.07, 180.115, 181.335, 182.095, 182.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6t3fo1385976499.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,] 32.32906 86.450 36.470 [2,] 33.26379 92.480 39.765 [3,] 35.26131 96.275 48.515 [4,] 38.27381 97.990 56.440 [5,] 44.27698 101.970 62.425 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 32.97621 93.76185 40.90942 [2,] 37.54641 98.78815 56.12058 $out [1] 116.35 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(32.3290569582461, 33.2637932386419, 35.2613084824558, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11u5n1385976499.ps tmp/11u5n1385976499.png",intern=TRUE)) character(0) > try(system("convert tmp/2ufpk1385976499.ps tmp/2ufpk1385976499.png",intern=TRUE)) character(0) > try(system("convert tmp/3gwny1385976499.ps tmp/3gwny1385976499.png",intern=TRUE)) character(0) > try(system("convert tmp/4jijd1385976499.ps tmp/4jijd1385976499.png",intern=TRUE)) character(0) > try(system("convert tmp/5ufv21385976499.ps tmp/5ufv21385976499.png",intern=TRUE)) character(0) > try(system("convert tmp/6t3fo1385976499.ps tmp/6t3fo1385976499.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.447 1.669 9.120