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(279,399,364,306,471,293,333,316,329,265,61,679,428,394,352,387,590,177,199,203,255,261,115) > 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] 23 > (np <- floor(n / par1)) [1] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 1 > arr [,1] [,2] [1,] 279 428 [2,] 399 394 [3,] 364 352 [4,] 306 387 [5,] 471 590 [6,] 293 177 [7,] 333 199 [8,] 316 203 [9,] 329 255 [10,] 265 261 [11,] 61 115 [12,] 679 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/1fcws1461512674.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/2rz5p1461512674.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/3oajs1461512674.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/40x8d1461512674.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,] 279.0 394.0 352 306.0 471.0 177 199 203.0 255 261 61 679 [2,] 279.0 394.0 352 306.0 471.0 177 199 203.0 255 261 61 679 [3,] 353.5 396.5 358 346.5 530.5 235 266 259.5 292 263 88 679 [4,] 428.0 399.0 364 387.0 590.0 293 333 316.0 329 265 115 679 [5,] 428.0 399.0 364 387.0 590.0 293 333 316.0 329 265 115 679 $n [1] 2 2 2 2 2 2 2 2 2 2 2 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 187.0329 390.9139 344.5933 256.0045 397.5498 105.4015 116.2914 133.2532 [2,] 519.9671 402.0861 371.4067 436.9955 663.4502 364.5985 415.7086 385.7468 [,9] [,10] [,11] [,12] [1,] 209.3251 258.5311 27.66965 679 [2,] 374.6749 267.4689 148.33035 679 $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(279, 279, 353.5, 428, 428, 394, 394, 396.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/589ys1461512674.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] [1,] 265.0 115.0 [2,] 286.0 201.0 [3,] 322.5 261.0 [4,] 381.5 390.5 [5,] 471.0 590.0 $n [1] 12 11 $conf [,1] [,2] [1,] 278.9418 170.7245 [2,] 366.0582 351.2755 $out [1] 61 679 $group [1] 1 1 $names [1] "1" NA Warning message: In bxp(list(stats = c(265, 286, 322.5, 381.5, 471, 115, 201, 261, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vrey1461512674.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,] 2.828427 0.0 0.00 [2,] 23.334524 8.5 4.25 [3,] 57.275649 77.5 38.75 [4,] 83.085047 117.5 58.75 [5,] 105.358910 149.0 74.50 $n [1] 11 12 12 $conf [,1] [,2] [,3] [1,] 28.81122 27.78437 13.89218 [2,] 85.74008 127.21563 63.60782 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.82842712474619, 23.3345237791561, 57.2756492761104, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fcws1461512674.ps tmp/1fcws1461512674.png",intern=TRUE)) character(0) > try(system("convert tmp/2rz5p1461512674.ps tmp/2rz5p1461512674.png",intern=TRUE)) character(0) > try(system("convert tmp/3oajs1461512674.ps tmp/3oajs1461512674.png",intern=TRUE)) character(0) > try(system("convert tmp/40x8d1461512674.ps tmp/40x8d1461512674.png",intern=TRUE)) character(0) > try(system("convert tmp/589ys1461512674.ps tmp/589ys1461512674.png",intern=TRUE)) character(0) > try(system("convert tmp/6vrey1461512674.ps tmp/6vrey1461512674.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.252 0.392 2.670