R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(54854,53982,52301,51652,50338,51959,57648,57803,52599,51123,49604,51154,51765,50491,49332,48690,47496,48107,53970,54300,50246,48519,47602,49723,52010,50976,49795,49104,48354,49390,55323,56287,52831,51881,51382,53000,54365,53815,53107,53031,52419,53378,59398,60706,58531,57244,56843,58299,60654,59579,58823,57813,56487,57644,62444,62890,59758,58716,57485,57888,59676,58365,57337,56520,55189,56229,60766,61393,57919,56772,55820,56953) > 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,] 54854 51765 52010 54365 60654 59676 NA [2,] 53982 50491 50976 53815 59579 58365 NA [3,] 52301 49332 49795 53107 58823 57337 NA [4,] 51652 48690 49104 53031 57813 56520 NA [5,] 50338 47496 48354 52419 56487 55189 NA [6,] 51959 48107 49390 53378 57644 56229 NA [7,] 57648 53970 55323 59398 62444 60766 NA [8,] 57803 54300 56287 60706 62890 61393 NA [9,] 52599 50246 52831 58531 59758 57919 NA [10,] 51123 48519 51881 57244 58716 56772 NA [11,] 49604 47602 51382 56843 57485 55820 NA [12,] 51154 49723 53000 58299 57888 56953 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/10uum1479651822.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/2uonl1479651822.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/3s6v81479651822.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/4l88x1479651822.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,] 51765.0 50491.0 49332 48690.0 47496.0 48107.0 53970 54300.0 50246 48519.0 [2,] 52010.0 50976.0 49795 49104.0 48354.0 49390.0 55323 56287.0 52599 51123.0 [3,] 54609.5 53898.5 52704 52341.5 51378.5 52668.5 58523 59254.5 55375 54326.5 [4,] 59676.0 58365.0 57337 56520.0 55189.0 56229.0 60766 61393.0 58531 57244.0 [5,] 60654.0 59579.0 58823 57813.0 56487.0 57644.0 62444 62890.0 59758 58716.0 [,11] [,12] [1,] 47602 49723.0 [2,] 49604 51154.0 [3,] 53601 54976.5 [4,] 56843 57888.0 [5,] 57485 58299.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 49664.68 49132.36 47839.17 47557.94 46969.7 48257.12 55012.09 55960.97 [2,] 59554.32 58664.64 57568.83 57125.06 55787.3 57079.88 62033.91 62548.03 [,9] [,10] [,11] [,12] [1,] 51548.67 50378.26 48931.61 50632.85 [2,] 59201.33 58274.74 58270.39 59320.15 $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(51765, 52010, 54609.5, 59676, 60654, 50491, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cecx1479651822.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,] 49604.0 47496.0 48354.0 52419.0 56487.0 55189.0 NA [2,] 51138.5 48313.0 49592.5 53242.5 57728.5 56374.5 NA [3,] 52130.0 49527.5 51631.5 55604.0 58769.5 57145.0 NA [4,] 54418.0 51128.0 52915.5 58415.0 60206.0 59020.5 NA [5,] 57803.0 54300.0 56287.0 60706.0 62890.0 61393.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 50634.2 48243.56 50115.86 53244.79 57639.5 55938.14 NA [2,] 53625.8 50811.44 53147.14 57963.21 59899.5 58351.86 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(49604, 51138.5, 52130, 54418, 57803, 47496, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6c4yi1479651822.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,] 3642.216 8474.0 5484.00 [2,] 3667.639 8739.5 5533.75 [3,] 3752.949 9105.5 5767.25 [4,] 3896.638 9524.5 5889.25 [5,] 4148.135 10197.0 6038.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3648.501 8747.456 5605.104 [2,] 3857.396 9463.544 5929.396 $out [1] 3239.924 3304.176 4519.750 4555.250 6538.750 $group [1] 1 1 3 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3642.21577706026, 3667.63910723905, 3752.94866352227, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10uum1479651822.ps tmp/10uum1479651822.png",intern=TRUE)) character(0) > try(system("convert tmp/2uonl1479651822.ps tmp/2uonl1479651822.png",intern=TRUE)) character(0) > try(system("convert tmp/3s6v81479651822.ps tmp/3s6v81479651822.png",intern=TRUE)) character(0) > try(system("convert tmp/4l88x1479651822.ps tmp/4l88x1479651822.png",intern=TRUE)) character(0) > try(system("convert tmp/5cecx1479651822.ps tmp/5cecx1479651822.png",intern=TRUE)) character(0) > try(system("convert tmp/6c4yi1479651822.ps tmp/6c4yi1479651822.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.086 0.172 2.290