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(92.44,94.36,93.42,92.97,94.83,91.47,88.42,86.36,86.01,87.87,89.81,88.41,86.33,89.64,89.53,88.3,99.49,98.81,90.97,92.58,92.98,95,92.47,88.65,84.81,88.6,89.31,92.34,91.53,96.95,95.44,89.59,89.86,91.66,92.7,90.54,86.17,89.15,89.73,91.07,93.36,96.27,95,94.72,97.16,100.92,98.66,95.87,94.6,98.41,98.05,99.82,106.96,107.45,100.25,99.28,101.38,101,97.43,95.38,95.17,94.13,96.43,105.38,98.39,99.8,94.43,90.16,85.49,90.57,88.22,89.66) > 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,] 92.44 86.33 84.81 86.17 94.60 95.17 NA [2,] 94.36 89.64 88.60 89.15 98.41 94.13 NA [3,] 93.42 89.53 89.31 89.73 98.05 96.43 NA [4,] 92.97 88.30 92.34 91.07 99.82 105.38 NA [5,] 94.83 99.49 91.53 93.36 106.96 98.39 NA [6,] 91.47 98.81 96.95 96.27 107.45 99.80 NA [7,] 88.42 90.97 95.44 95.00 100.25 94.43 NA [8,] 86.36 92.58 89.59 94.72 99.28 90.16 NA [9,] 86.01 92.98 89.86 97.16 101.38 85.49 NA [10,] 87.87 95.00 91.66 100.92 101.00 90.57 NA [11,] 89.81 92.47 92.70 98.66 97.43 88.22 NA [12,] 88.41 88.65 90.54 95.87 95.38 89.66 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/1np2d1447791717.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/2umkl1447791717.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/3pp6b1447791717.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/4mnp81447791717.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,] 84.810 88.600 89.310 88.300 91.53 91.47 88.420 86.36 85.49 87.87 [2,] 86.170 89.150 89.530 91.070 93.36 96.27 90.970 89.59 86.01 90.57 [3,] 89.385 91.885 91.575 92.655 96.61 97.88 94.715 91.37 91.42 93.33 [4,] 94.600 94.360 96.430 99.820 99.49 99.80 95.440 94.72 97.16 100.92 [5,] 95.170 98.410 98.050 105.380 106.96 99.80 100.250 99.28 101.38 101.00 [,11] [,12] [1,] 88.220 88.41 [2,] 89.810 88.65 [3,] 92.585 90.10 [4,] 97.430 95.38 [5,] 98.660 95.87 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 83.94738 88.52438 87.12428 87.01097 92.65595 95.60304 91.83171 88.06098 [2,] 94.82262 95.24562 96.02572 98.29903 100.56405 100.15696 97.59829 94.67902 [,9] [,10] [,11] [,12] [1,] 84.22789 86.65392 87.66985 85.75893 [2,] 98.61211 100.00608 97.50015 94.44107 $out [1] 107.45 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(84.81, 86.17, 89.385, 94.6, 95.17, 88.6, 89.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zngq1447791717.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,] 86.010 86.33 88.600 86.170 94.60 85.49 NA [2,] 88.140 89.09 89.450 90.400 97.74 89.91 NA [3,] 90.640 91.72 91.035 94.860 99.55 94.28 NA [4,] 93.195 93.99 92.520 96.715 101.19 97.41 NA [5,] 94.830 99.49 96.950 100.920 101.38 105.38 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.33438 89.48508 89.63475 91.97969 97.97643 90.8592 NA [2,] 92.94562 93.95492 92.43525 97.74031 101.12357 97.7008 NA $out [1] 84.81 106.96 107.45 $group [1] 3 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(86.01, 88.14, 90.64, 93.195, 94.83, 86.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mjfd1447791717.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,] 3.349301 7.460 3.11250 [2,] 3.976049 10.085 4.74125 [3,] 4.587736 12.375 5.63000 [4,] 5.525374 15.660 7.28500 [5,] 6.364052 17.080 9.14250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.881078 9.832205 4.469779 [2,] 5.294394 14.917795 6.790221 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.34930092208309, 3.97604894213232, 4.58773601385533, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1np2d1447791717.ps tmp/1np2d1447791717.png",intern=TRUE)) character(0) > try(system("convert tmp/2umkl1447791717.ps tmp/2umkl1447791717.png",intern=TRUE)) character(0) > try(system("convert tmp/3pp6b1447791717.ps tmp/3pp6b1447791717.png",intern=TRUE)) character(0) > try(system("convert tmp/4mnp81447791717.ps tmp/4mnp81447791717.png",intern=TRUE)) character(0) > try(system("convert tmp/5zngq1447791717.ps tmp/5zngq1447791717.png",intern=TRUE)) character(0) > try(system("convert tmp/6mjfd1447791717.ps tmp/6mjfd1447791717.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.122 0.399 2.548