R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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.49,79.69,79.86,79.87,79.83,79.83,79.83,79.37,79.53,79.78,79.94,79.97,79.97,79.98,80.25,80.38,80.13,80.15,80.15,80.18,80.47,80.83,80.62,80.66,80.66,80.67,80.8,81.04,81.24,81.26,81.26,81.47,81.94,82.83,82.29,82.32,82.32,82.3,82.54,82.54,82.62,82.63,82.63,82.63,82.71,83.25,83.14,83.34,83.34,83.37,83.33,83.26,83.66,83.64,83.64,83.71,83.87,84.17,84.35,84.44,84.44,84.45,84.67,84.95,84.89,84.93,84.93,84.93,85.45,85.77,85.79,85.9) > 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.49 79.97 80.66 82.32 83.34 84.44 NA [2,] 79.69 79.98 80.67 82.30 83.37 84.45 NA [3,] 79.86 80.25 80.80 82.54 83.33 84.67 NA [4,] 79.87 80.38 81.04 82.54 83.26 84.95 NA [5,] 79.83 80.13 81.24 82.62 83.66 84.89 NA [6,] 79.83 80.15 81.26 82.63 83.64 84.93 NA [7,] 79.83 80.15 81.26 82.63 83.64 84.93 NA [8,] 79.37 80.18 81.47 82.63 83.71 84.93 NA [9,] 79.53 80.47 81.94 82.71 83.87 85.45 NA [10,] 79.78 80.83 82.83 83.25 84.17 85.77 NA [11,] 79.94 80.62 82.29 83.14 84.35 85.79 NA [12,] 79.97 80.66 82.32 83.34 84.44 85.90 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/1az5r1354211405.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/2sk671354211405.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/3kfm31354211405.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/443fp1354211405.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,] 79.49 79.690 79.86 79.87 79.83 79.830 79.830 79.37 79.530 79.78 79.940 [2,] 79.97 79.980 80.25 80.38 80.13 80.150 80.150 80.18 80.470 80.83 80.620 [3,] 81.49 81.485 81.67 81.79 81.93 81.945 81.945 82.05 82.325 83.04 82.715 [4,] 83.34 83.370 83.33 83.26 83.66 83.640 83.640 83.71 83.870 84.17 84.350 [5,] 84.44 84.450 84.67 84.95 84.89 84.930 84.930 84.93 85.450 85.77 85.790 [,12] [1,] 79.97 [2,] 80.66 [3,] 82.83 [4,] 84.44 [5,] 85.90 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.31624 79.29834 79.6833 79.93231 79.65304 79.69384 79.69384 79.77304 [2,] 83.66376 83.67166 83.6567 83.64769 84.20696 84.19616 84.19616 84.32696 [,9] [,10] [,11] [,12] [1,] 80.13189 80.88559 80.30903 80.39178 [2,] 84.51811 85.19441 85.12097 85.26822 $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(79.49, 79.97, 81.49, 83.34, 84.44, 79.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fvdi1354211405.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,] 79.370 79.970 80.660 82.300 83.260 84.44 NA [2,] 79.610 80.140 80.920 82.540 83.355 84.78 NA [3,] 79.830 80.215 81.260 82.630 83.650 84.93 NA [4,] 79.865 80.545 82.115 82.925 84.020 85.61 NA [5,] 79.970 80.830 82.830 83.340 84.440 85.90 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.71369 80.03028 80.71495 82.4544 83.34669 84.55143 NA [2,] 79.94631 80.39972 81.80505 82.8056 83.95331 85.30857 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(79.37, 79.61, 79.83, 79.865, 79.97, 79.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6d6ok1354211405.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,] 1.908983 4.760 2.53500 [2,] 1.956928 5.005 2.74375 [3,] 2.015844 5.100 2.94625 [4,] 2.181732 5.885 2.97625 [5,] 2.254120 5.990 3.09000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.913309 4.698626 2.840205 [2,] 2.118379 5.501374 3.052295 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.90898314991691, 1.95692843066691, 2.01584390930118, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1az5r1354211405.ps tmp/1az5r1354211405.png",intern=TRUE)) character(0) > try(system("convert tmp/2sk671354211405.ps tmp/2sk671354211405.png",intern=TRUE)) character(0) > try(system("convert tmp/3kfm31354211405.ps tmp/3kfm31354211405.png",intern=TRUE)) character(0) > try(system("convert tmp/443fp1354211405.ps tmp/443fp1354211405.png",intern=TRUE)) character(0) > try(system("convert tmp/5fvdi1354211405.ps tmp/5fvdi1354211405.png",intern=TRUE)) character(0) > try(system("convert tmp/6d6ok1354211405.ps tmp/6d6ok1354211405.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.998 1.008 7.037