R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes" 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(87,93,89,88,90,91,91,90,90,90,88,85,91,93,94,90,91,93,93,92,92,92,94,93,95,98,98,95,97,100,100,100,98,98,98,99,97,100,104,96,99,102,101,101,99,99,101,102,103,102,104,103,103,102,101,101,103,103,103,103,103,104,98,102,103,103,102,103,102,102,103,103) > 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,] 87 91 95 97 103 103 NA [2,] 93 93 98 100 102 104 NA [3,] 89 94 98 104 104 98 NA [4,] 88 90 95 96 103 102 NA [5,] 90 91 97 99 103 103 NA [6,] 91 93 100 102 102 103 NA [7,] 91 93 100 101 101 102 NA [8,] 90 92 100 101 101 103 NA [9,] 90 92 98 99 103 102 NA [10,] 90 92 98 99 103 102 NA [11,] 88 94 98 101 103 103 NA [12,] 85 93 99 102 103 103 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/1vbe21461578182.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/2hl9m1461578182.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/3d3nn1461578182.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/479lb1461578182.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,] 87 93 89 88.0 90 91 91.0 90.0 90.0 90.0 88.0 85.0 [2,] 91 93 94 90.0 91 93 93.0 92.0 92.0 92.0 94.0 93.0 [3,] 96 99 98 95.5 98 101 100.5 100.5 98.5 98.5 99.5 100.5 [4,] 103 102 104 102.0 103 102 101.0 101.0 102.0 102.0 103.0 103.0 [5,] 103 104 104 103.0 103 103 102.0 103.0 103.0 103.0 103.0 103.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.25961 93.19471 91.54968 87.75961 90.25961 95.19471 95.33974 [2,] 103.74039 104.80529 104.45032 103.24039 105.74039 106.80529 105.66026 [,8] [,9] [,10] [,11] [,12] [1,] 94.69471 92.04968 92.04968 93.69471 94.04968 [2,] 106.30529 104.95032 104.95032 105.30529 106.95032 $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(87, 91, 96, 103, 103, 93, 93, 99, 102, 104, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bl1d1461578182.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,] 85.0 90.0 95.0 96.0 101 102 NA [2,] 88.0 91.5 97.5 99.0 102 102 NA [3,] 90.0 92.5 98.0 100.5 103 103 NA [4,] 90.5 93.0 99.5 101.5 103 103 NA [5,] 93.0 94.0 100.0 104.0 104 104 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.85973 91.81584 97.08779 99.35973 102.5439 102.5439 NA [2,] 91.14027 93.18416 98.91221 101.64027 103.4561 103.4561 NA $out [1] 98 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(85, 88, 90, 90.5, 93, 90, 91.5, 92.5, 93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ixpi1461578182.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,] 4.589844 11.0 6.250 [2,] 5.223047 12.5 7.250 [3,] 5.545334 13.0 7.625 [4,] 6.000751 15.0 8.750 [5,] 6.418723 18.0 9.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.190618 11.85973 6.94084 [2,] 5.900050 14.14027 8.30916 $out [1] 7.204165 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.5898438608156, 5.22304652252998, 5.545334262845, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vbe21461578182.ps tmp/1vbe21461578182.png",intern=TRUE)) character(0) > try(system("convert tmp/2hl9m1461578182.ps tmp/2hl9m1461578182.png",intern=TRUE)) character(0) > try(system("convert tmp/3d3nn1461578182.ps tmp/3d3nn1461578182.png",intern=TRUE)) character(0) > try(system("convert tmp/479lb1461578182.ps tmp/479lb1461578182.png",intern=TRUE)) character(0) > try(system("convert tmp/5bl1d1461578182.ps tmp/5bl1d1461578182.png",intern=TRUE)) character(0) > try(system("convert tmp/6ixpi1461578182.ps tmp/6ixpi1461578182.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.152 0.358 2.537