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(31025,31068,31619,32020,30467,31960,31389,28863,33143,33350,29079,26505,24975,24644,26626,23977,23898,25583,25974,23529,27491,28053,27913,26706,26788,27600,32770,29623,29300,32152,30700,29463,32709,32823,34073,33551,32168,32833,37341,33747,34482,33309,33057,32809,35316,33989,35799,34508,34646,35203,38084,35005,36734,35716,34543,34340,35094,38730,37805,33815,36486,34960,38054,35283,37361,35536,36103,33886,35416,38053,37181,34787,36074,34966,37482,36109,35520,36123,36256,32456,37748,38461,36344,35865) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 31025 24975 26788 32168 34646 36486 36074 NA [2,] 31068 24644 27600 32833 35203 34960 34966 NA [3,] 31619 26626 32770 37341 38084 38054 37482 NA [4,] 32020 23977 29623 33747 35005 35283 36109 NA [5,] 30467 23898 29300 34482 36734 37361 35520 NA [6,] 31960 25583 32152 33309 35716 35536 36123 NA [7,] 31389 25974 30700 33057 34543 36103 36256 NA [8,] 28863 23529 29463 32809 34340 33886 32456 NA [9,] 33143 27491 32709 35316 35094 35416 37748 NA [10,] 33350 28053 32823 33989 38730 38053 38461 NA [11,] 29079 27913 34073 35799 37805 37181 36344 NA [12,] 26505 26706 33551 34508 33815 34787 35865 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/1a3p91448193312.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/2v26p1448193312.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/3ai6g1448193312.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/431tq1448193312.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,] 24975.0 24644 26626.0 29623.0 23898.0 31960 25974.0 23529.0 32709 28053.0 [2,] 28906.5 29334 32194.5 30821.5 29883.5 32056 31044.5 29163.0 32926 33086.5 [3,] 32168.0 32833 37341.0 33747.0 34482.0 33309 33057.0 32456.0 35094 33989.0 [4,] 35360.0 34963 37768.0 35144.0 36127.0 35626 35323.0 33347.5 35366 38257.0 [5,] 36486.0 35203 38084.0 36109.0 37361.0 36123 36256.0 34340.0 37748 38730.0 [,11] [,12] [1,] 27913.0 26505.0 [2,] 31576.0 30128.5 [3,] 35799.0 33815.0 [4,] 36762.5 34647.5 [5,] 37805.0 35865.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 28314.07 29471.45 34012.6 31165.67 30753.48 31177.05 30501.95 29957.08 [2,] 36021.93 36194.55 40669.4 36328.33 38210.52 35440.95 35612.05 34954.92 [,9] [,10] [,11] [,12] [1,] 33636.87 30901.26 32701.71 31116.33 [2,] 36551.13 37076.74 38896.29 36513.67 $out [1] 23977 25583 27491 $group [1] 4 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(24975, 28906.5, 32168, 35360, 36486, 24644, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51ex71448193312.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] [1,] 26505.0 23529.0 26788.0 32168 33815.0 33886.0 34966.0 NA [2,] 29773.0 24310.5 29381.5 32945 34594.5 35121.5 35692.5 NA [3,] 31228.5 25778.5 31426.0 33868 35148.5 35819.5 36116.0 NA [4,] 31990.0 27098.5 32796.5 34912 37269.5 37271.0 36913.0 NA [5,] 33350.0 28053.0 34073.0 37341 38730.0 38054.0 38461.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 30217.31 24506.87 29868.4 32970.84 33928.41 34839.1 35559.32 NA [2,] 32239.69 27050.13 32983.6 34765.16 36368.59 36799.9 36672.68 NA $out [1] 32456 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(26505, 29773, 31228.5, 31990, 33350, 23529, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mt8v1448193312.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,] 3255.301 9360.0 2440.00 [2,] 3736.932 10269.5 4231.50 [3,] 3948.367 10618.0 4844.75 [4,] 4329.871 11484.5 5601.25 [5,] 4881.299 12132.0 6453.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3677.924 10063.83 4219.998 [2,] 4218.811 11172.17 5469.502 $out [1] 13463 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3255.30099551924, 3736.93175798658, 3948.3673868425, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1a3p91448193312.ps tmp/1a3p91448193312.png",intern=TRUE)) character(0) > try(system("convert tmp/2v26p1448193312.ps tmp/2v26p1448193312.png",intern=TRUE)) character(0) > try(system("convert tmp/3ai6g1448193312.ps tmp/3ai6g1448193312.png",intern=TRUE)) character(0) > try(system("convert tmp/431tq1448193312.ps tmp/431tq1448193312.png",intern=TRUE)) character(0) > try(system("convert tmp/51ex71448193312.ps tmp/51ex71448193312.png",intern=TRUE)) character(0) > try(system("convert tmp/6mt8v1448193312.ps tmp/6mt8v1448193312.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.088 0.386 2.500