R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(74.16,73.21,77.14,80.9,82.76,83.33,81.94,82.38,82.81,83.17,84.07,87.33,90.75,92.82,97.78,99.32,98.33,98.66,98.13,97.8,99.36,100.37,103.22,101.68,104.39,103.99,106.71,106.06,103.5,100.17,101.1,105.93,108.09,107.27,104.9,102.7,102.06,103.05,102.08,100.13,97.56,97.38,99.66,99.58,102.7,98.92,97.85,99.01,97.71,97.95,97.24,96.69,96.41,96.99,98.36,97.8,96.79,94.73,92.67,87.15,79.54,82.35,86.38,84.75,87.54,86.73,84.74,80.75,79.28,78.52,78.54,77.33) > 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,] 74.16 90.75 104.39 102.06 97.71 79.54 NA [2,] 73.21 92.82 103.99 103.05 97.95 82.35 NA [3,] 77.14 97.78 106.71 102.08 97.24 86.38 NA [4,] 80.90 99.32 106.06 100.13 96.69 84.75 NA [5,] 82.76 98.33 103.50 97.56 96.41 87.54 NA [6,] 83.33 98.66 100.17 97.38 96.99 86.73 NA [7,] 81.94 98.13 101.10 99.66 98.36 84.74 NA [8,] 82.38 97.80 105.93 99.58 97.80 80.75 NA [9,] 82.81 99.36 108.09 102.70 96.79 79.28 NA [10,] 83.17 100.37 107.27 98.92 94.73 78.52 NA [11,] 84.07 103.22 104.90 97.85 92.67 78.54 NA [12,] 87.33 101.68 102.70 99.01 87.15 77.33 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/1beo41492783585.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/273ob1492783585.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/3r5yt1492783585.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/41v4s1492783585.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] [1,] 74.16 73.210 77.14 80.900 82.760 83.330 81.940 80.75 79.280 [2,] 79.54 82.350 86.38 84.750 87.540 86.730 84.740 82.38 82.810 [3,] 94.23 95.385 97.51 98.005 96.985 97.185 98.245 97.80 98.075 [4,] 102.06 103.050 102.08 100.130 98.330 98.660 99.660 99.58 102.700 [5,] 104.39 103.990 106.71 106.060 103.500 100.170 101.100 105.93 108.090 [,10] [,11] [,12] [1,] 78.520 78.54 77.33 [2,] 83.170 84.07 87.15 [3,] 96.825 95.26 93.17 [4,] 100.370 103.22 101.68 [5,] 107.270 104.90 102.70 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.70387 82.03283 87.38299 88.0844 90.0251 89.48976 88.62112 [2,] 108.75613 108.73717 107.63701 107.9256 103.9449 104.88024 107.86888 [,8] [,9] [,10] [,11] [,12] [1,] 86.70544 85.24531 85.73044 82.90763 83.79768 [2,] 108.89456 110.90469 107.91956 107.61237 102.54232 $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(74.16, 79.54, 94.23, 102.06, 104.39, 73.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50isn1492783585.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,] 73.21 97.780 100.170 97.380 92.670 77.330 NA [2,] 79.02 97.790 103.100 98.385 95.570 78.910 NA [3,] 82.57 98.495 104.645 99.620 96.890 81.550 NA [4,] 83.25 99.865 106.385 102.070 97.755 85.565 NA [5,] 87.33 101.680 108.090 103.050 98.360 87.540 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 80.64067 97.54858 103.1467 97.93925 95.89341 78.51461 NA [2,] 84.49933 99.44142 106.1433 101.30075 97.88659 84.58539 NA $out [1] 90.75 92.82 103.22 87.15 $group [1] 2 2 2 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(73.21, 79.02, 82.57, 83.25, 87.33, 97.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mqlx1492783585.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,] 7.025091 16.840 8.38000 [2,] 9.045990 22.950 11.57875 [3,] 10.356388 25.865 13.35875 [4,] 11.162696 29.190 15.60875 [5,] 12.332754 30.780 18.63000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.390945 23.01889 11.52064 [2,] 11.321832 28.71111 15.19686 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.02509122123454, 9.04599029147818, 10.3563883927946, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1beo41492783585.ps tmp/1beo41492783585.png",intern=TRUE)) character(0) > try(system("convert tmp/273ob1492783585.ps tmp/273ob1492783585.png",intern=TRUE)) character(0) > try(system("convert tmp/3r5yt1492783585.ps tmp/3r5yt1492783585.png",intern=TRUE)) character(0) > try(system("convert tmp/41v4s1492783585.ps tmp/41v4s1492783585.png",intern=TRUE)) character(0) > try(system("convert tmp/50isn1492783585.ps tmp/50isn1492783585.png",intern=TRUE)) character(0) > try(system("convert tmp/6mqlx1492783585.ps tmp/6mqlx1492783585.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.692 0.365 4.236