R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(2.07,2.2,2.29,2.32,2.37,2.38,2.38,2.28,2.22,2.25,2.3,2.3,2.23,2.27,2.3,2.32,2.41,2.43,2.45,2.47,2.46,2.5,2.46,2.43,2.37,2.45,2.53,2.56,2.62,2.67,2.62,2.6,2.53,2.49,2.48,2.44,2.36,2.35,2.44,2.5,2.58,2.55,2.44,2.3,2.24,2.19,2.25,2.28,2.27,2.37,2.47,2.5,2.47,2.61,2.61,2.65,2.43,2.43,2.33,2.27,2.22,2.17,2.28,2.3,2.33,2.44,2.41,2.4,2.34,2.37,2.38,2.3,2.29,2.34,2.35,2.38,2.37,2.45,2.51,2.46,2.42,2.48,2.44,2.43,2.36,2.42,2.42,2.43,2.47,2.54,2.55,2.55,2.49,2.54,2.55,2.5) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2.07 2.23 2.37 2.36 2.27 2.22 2.29 2.36 NA [2,] 2.20 2.27 2.45 2.35 2.37 2.17 2.34 2.42 NA [3,] 2.29 2.30 2.53 2.44 2.47 2.28 2.35 2.42 NA [4,] 2.32 2.32 2.56 2.50 2.50 2.30 2.38 2.43 NA [5,] 2.37 2.41 2.62 2.58 2.47 2.33 2.37 2.47 NA [6,] 2.38 2.43 2.67 2.55 2.61 2.44 2.45 2.54 NA [7,] 2.38 2.45 2.62 2.44 2.61 2.41 2.51 2.55 NA [8,] 2.28 2.47 2.60 2.30 2.65 2.40 2.46 2.55 NA [9,] 2.22 2.46 2.53 2.24 2.43 2.34 2.42 2.49 NA [10,] 2.25 2.50 2.49 2.19 2.43 2.37 2.48 2.54 NA [11,] 2.30 2.46 2.48 2.25 2.33 2.38 2.44 2.55 NA [12,] 2.30 2.43 2.44 2.28 2.27 2.30 2.43 2.50 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/1cjb41426172598.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/2cujs1426172598.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/31j511426172598.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/42eey1426172598.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,] 2.070 2.170 2.280 2.300 2.330 2.380 2.380 2.280 2.220 2.190 2.250 2.270 [2,] 2.225 2.235 2.295 2.320 2.370 2.435 2.425 2.350 2.290 2.310 2.315 2.290 [3,] 2.280 2.345 2.385 2.405 2.440 2.495 2.480 2.465 2.425 2.455 2.410 2.365 [4,] 2.360 2.395 2.455 2.500 2.525 2.580 2.580 2.575 2.475 2.495 2.470 2.435 [5,] 2.370 2.450 2.530 2.560 2.620 2.670 2.620 2.650 2.530 2.540 2.550 2.500 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.204587 2.255622 2.295622 2.304449 2.353415 2.414001 2.393415 2.339312 [2,] 2.355413 2.434378 2.474378 2.505551 2.526585 2.575999 2.566585 2.590688 [,9] [,10] [,11] [,12] [1,] 2.321656 2.351656 2.323415 2.284001 [2,] 2.528344 2.558344 2.496585 2.445999 $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(2.07, 2.225, 2.28, 2.36, 2.37, 2.17, 2.235, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tdxq1426172598.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] [,9] [1,] 2.200 2.23 2.370 2.190 2.270 2.170 2.290 2.360 NA [2,] 2.235 2.31 2.465 2.265 2.350 2.290 2.360 2.425 NA [3,] 2.295 2.43 2.530 2.355 2.450 2.335 2.425 2.495 NA [4,] 2.345 2.46 2.610 2.470 2.555 2.390 2.455 2.545 NA [5,] 2.380 2.50 2.670 2.580 2.650 2.440 2.510 2.550 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.244828 2.361584 2.463865 2.261498 2.356498 2.289389 2.38167 2.440267 [2,] 2.345172 2.498416 2.596135 2.448502 2.543502 2.380611 2.46833 2.549733 [,9] [1,] NA [2,] NA $out [1] 2.07 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(2.2, 2.235, 2.295, 2.345, 2.38, 2.23, 2.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61o6j1426172598.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.09014869 0.230 0.12750 [2,] 0.09602360 0.255 0.13125 [3,] 0.10027618 0.290 0.14000 [4,] 0.10884906 0.305 0.15250 [5,] 0.12659694 0.370 0.18000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.0944264 0.2671947 0.1303077 [2,] 0.1061260 0.3128053 0.1496923 $out [1] 0.1338376 0.1875000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0901486867030559, 0.0960236024716374, 0.100276176019401, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cjb41426172598.ps tmp/1cjb41426172598.png",intern=TRUE)) character(0) > try(system("convert tmp/2cujs1426172598.ps tmp/2cujs1426172598.png",intern=TRUE)) character(0) > try(system("convert tmp/31j511426172598.ps tmp/31j511426172598.png",intern=TRUE)) character(0) > try(system("convert tmp/42eey1426172598.ps tmp/42eey1426172598.png",intern=TRUE)) character(0) > try(system("convert tmp/5tdxq1426172598.ps tmp/5tdxq1426172598.png",intern=TRUE)) character(0) > try(system("convert tmp/61o6j1426172598.ps tmp/61o6j1426172598.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.078 0.396 2.494