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(389.09,391.76,390.96,391.76,392.8,393.06,393.06,393.26,393.87,394.47,394.57,394.57,394.57,399.57,406.13,407.03,409.46,409.9,409.9,410.14,410.54,410.69,410.79,410.97,410.97,413.8,423.31,423.85,426.6,426.26,426.26,426.32,427.14,427.55,428.29,428.8,428.8,434.87,435.66,440.75,440.99,441.04,441.04,441.88,441.92,442.48,442.81,442.81,442.81,447.19,446.52,448.57,448.71,448.73,449.07,449.03,448.68,450.08,449.96,449.96,449.96,452.56,455.31,456.2,456.75,457.63,457.63,457.65,458.32,459.64,460.16,459.89) > 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,] 389.09 394.57 410.97 428.80 442.81 449.96 NA [2,] 391.76 399.57 413.80 434.87 447.19 452.56 NA [3,] 390.96 406.13 423.31 435.66 446.52 455.31 NA [4,] 391.76 407.03 423.85 440.75 448.57 456.20 NA [5,] 392.80 409.46 426.60 440.99 448.71 456.75 NA [6,] 393.06 409.90 426.26 441.04 448.73 457.63 NA [7,] 393.06 409.90 426.26 441.04 449.07 457.63 NA [8,] 393.26 410.14 426.32 441.88 449.03 457.65 NA [9,] 393.87 410.54 427.14 441.92 448.68 458.32 NA [10,] 394.47 410.69 427.55 442.48 450.08 459.64 NA [11,] 394.57 410.79 428.29 442.81 449.96 460.16 NA [12,] 394.57 410.97 428.80 442.81 449.96 459.89 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/16rrn1416764944.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/2d7a01416764944.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/3eg2w1416764944.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/4on7g1416764944.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] [1,] 389.090 391.760 390.960 391.76 392.800 393.06 393.06 393.26 393.87 394.470 [2,] 394.570 399.570 406.130 407.03 409.460 409.90 409.90 410.14 410.54 410.690 [3,] 419.885 424.335 429.485 432.30 433.795 433.65 433.65 434.10 434.53 435.015 [4,] 442.810 447.190 446.520 448.57 448.710 448.73 449.07 449.03 448.68 450.080 [5,] 449.960 452.560 455.310 456.20 456.750 457.63 457.63 457.65 458.32 459.640 [,11] [,12] [1,] 394.57 394.570 [2,] 410.79 410.970 [3,] 435.55 435.805 [4,] 449.96 449.960 [5,] 460.16 459.890 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 388.7686 393.6186 403.4321 405.5054 408.4775 408.6034 408.3841 409.0147 [2,] 451.0014 455.0514 455.5379 459.0946 459.1125 458.6966 458.9159 459.1853 [,9] [,10] [,11] [,12] [1,] 409.9285 409.6072 410.2841 410.6552 [2,] 459.1315 460.4228 460.8159 460.9548 $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(389.09, 394.57, 419.885, 442.81, 449.96, 391.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54w4h1416764944.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,] 389.09 406.130 423.310 434.870 446.520 452.560 NA [2,] 391.76 406.580 423.580 438.205 447.880 455.755 NA [3,] 393.06 409.900 426.290 441.040 448.720 457.630 NA [4,] 394.17 410.615 427.345 442.200 449.515 458.980 NA [5,] 394.57 410.970 428.800 442.810 450.080 460.160 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 391.9608 408.0596 424.5728 439.2179 447.9743 456.1591 NA [2,] 394.1592 411.7404 428.0072 442.8621 449.4657 459.1009 NA $out [1] 394.57 399.57 410.97 413.80 428.80 442.81 449.96 $group [1] 2 2 3 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(389.09, 391.76, 393.06, 394.17, 394.57, 406.13, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gn6w1416764944.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,] 24.43466 63.950 32.3000 [2,] 24.53463 64.150 32.9125 [3,] 24.69117 64.445 33.0650 [4,] 24.98645 64.870 34.3800 [5,] 25.33329 65.590 35.3800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 24.48509 64.1166 32.39566 [2,] 24.89724 64.7734 33.73434 $out [1] 60.8700 60.8000 40.6375 40.9825 $group [1] 2 2 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(24.4346576948945, 24.5346320293092, 24.691168991416, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16rrn1416764944.ps tmp/16rrn1416764944.png",intern=TRUE)) character(0) > try(system("convert tmp/2d7a01416764944.ps tmp/2d7a01416764944.png",intern=TRUE)) character(0) > try(system("convert tmp/3eg2w1416764944.ps tmp/3eg2w1416764944.png",intern=TRUE)) character(0) > try(system("convert tmp/4on7g1416764944.ps tmp/4on7g1416764944.png",intern=TRUE)) character(0) > try(system("convert tmp/54w4h1416764944.ps tmp/54w4h1416764944.png",intern=TRUE)) character(0) > try(system("convert tmp/6gn6w1416764944.ps tmp/6gn6w1416764944.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.132 0.348 2.517