R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(250.71,251.57,260.85,265.47,262.37,272.39,277.49,274.41,274.42,267.1,258.84,253.97,253.88,253.3,249.86,246,248.42,250.29,246.9,255.2,253.33,251.02,254.5,253.18,256.03,262.15,259.94,253.75,247.69,242.42,231.82,235.88,240.68,260.15,265.32,265.02,279.86,298.3,304.14,295.26,281.93,280.46,272.06,270.05,271.84,268.49,270.92,273.22,269.43,271.21,265.4,265.53,276.78,281.49,283.75,281.45,282.1,274.01,275.51,277.62,275.33,271.15,270.89,265.29,266.96,266.87,267.68,272.37,285.05,296.79,309.15,304.19,307.33,290.68,292.26,294.81,293.67,293.57,286.28,278.93,284.22,282.09,282.26,285.79,294.01,292.73,303.01,298.67,292.38,295.7,294.9,299.46,299.75,294.76,297.68,300.24,302.48,310.2,311.49,307.37,304.58,305.87,309.81,313.91,313.2,307.85,306.89,310.83) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 250.71 253.88 256.03 279.86 269.43 275.33 307.33 294.01 302.48 NA [2,] 251.57 253.30 262.15 298.30 271.21 271.15 290.68 292.73 310.20 NA [3,] 260.85 249.86 259.94 304.14 265.40 270.89 292.26 303.01 311.49 NA [4,] 265.47 246.00 253.75 295.26 265.53 265.29 294.81 298.67 307.37 NA [5,] 262.37 248.42 247.69 281.93 276.78 266.96 293.67 292.38 304.58 NA [6,] 272.39 250.29 242.42 280.46 281.49 266.87 293.57 295.70 305.87 NA [7,] 277.49 246.90 231.82 272.06 283.75 267.68 286.28 294.90 309.81 NA [8,] 274.41 255.20 235.88 270.05 281.45 272.37 278.93 299.46 313.91 NA [9,] 274.42 253.33 240.68 271.84 282.10 285.05 284.22 299.75 313.20 NA [10,] 267.10 251.02 260.15 268.49 274.01 296.79 282.09 294.76 307.85 NA [11,] 258.84 254.50 265.32 270.92 275.51 309.15 282.26 297.68 306.89 NA [12,] 253.97 253.18 265.02 273.22 277.62 304.19 285.79 300.24 310.83 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/1rdta1447938349.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/2stw41447938349.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/3ex361447938349.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/4koa01447938349.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,] 250.71 251.57 249.86 246.00 247.69 242.42 246.90 255.20 253.33 251.02 [2,] 256.03 262.15 260.85 265.29 262.37 266.87 267.68 270.05 271.84 267.10 [3,] 275.33 271.21 270.89 265.53 276.78 280.46 277.49 274.41 282.10 274.01 [4,] 294.01 292.73 303.01 295.26 292.38 293.57 286.28 281.45 285.05 294.76 [5,] 307.33 310.20 311.49 307.37 304.58 305.87 309.81 281.45 299.75 307.85 [,11] [,12] [1,] 254.50 253.18 [2,] 265.32 265.02 [3,] 275.51 277.62 [4,] 297.68 300.24 [5,] 309.15 310.83 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 255.3272 255.1045 248.6857 249.7458 260.9747 266.398 267.694 268.406 [2,] 295.3328 287.3155 293.0943 281.3142 292.5853 294.522 287.286 280.414 [,9] [,10] [,11] [,12] [1,] 275.1427 259.4424 258.4671 259.0708 [2,] 289.0573 288.5776 292.5529 296.1692 $out [1] 231.82 235.88 299.46 313.91 240.68 313.20 $group [1] 7 8 8 8 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(250.71, 256.03, 275.33, 294.01, 307.33, 251.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52hjd1447938349.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] [,8] [,9] [,10] [1,] 250.710 246.000 231.82 268.490 265.400 265.29 278.93 292.380 302.48 NA [2,] 256.405 249.140 241.55 271.380 270.320 267.32 283.24 294.385 306.38 NA [3,] 263.920 252.100 254.89 276.540 276.145 271.76 288.48 296.690 308.83 NA [4,] 273.400 253.605 261.15 288.595 281.470 290.92 293.62 299.605 311.16 NA [5,] 277.490 255.200 265.32 304.140 283.750 309.15 307.33 303.010 313.91 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 256.1685 250.0635 245.9503 268.6881 271.0594 260.9959 283.7456 294.3091 [2,] 271.6715 254.1365 263.8297 284.3919 281.2306 282.5241 293.2144 299.0709 [,9] [,10] [1,] 306.6498 NA [2,] 311.0102 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(250.71, 256.405, 263.92, 273.4, 277.49, 246, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g0og1447938349.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,] 18.75306 54.650 11.40 [2,] 20.59258 56.860 22.65 [3,] 21.27241 60.000 29.99 [4,] 22.44899 67.985 33.79 [5,] 23.80134 78.030 42.16 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20.42569 54.92581 24.90897 [2,] 22.11913 65.07419 35.07103 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(18.7530593800348, 20.5925832189784, 21.2724103478077, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rdta1447938349.ps tmp/1rdta1447938349.png",intern=TRUE)) character(0) > try(system("convert tmp/2stw41447938349.ps tmp/2stw41447938349.png",intern=TRUE)) character(0) > try(system("convert tmp/3ex361447938349.ps tmp/3ex361447938349.png",intern=TRUE)) character(0) > try(system("convert tmp/4koa01447938349.ps tmp/4koa01447938349.png",intern=TRUE)) character(0) > try(system("convert tmp/52hjd1447938349.ps tmp/52hjd1447938349.png",intern=TRUE)) character(0) > try(system("convert tmp/6g0og1447938349.ps tmp/6g0og1447938349.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.156 0.402 2.582