R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(85.73,85.73,85.74,86.32,87.59,87.81,87.87,87.94,87.96,88.01,88.01,88.01,88.01,88.01,88.59,89.43,89.63,89.73,89.88,89.89,89.9,89.91,89.86,90.07,90.17,90.17,90.28,90.87,92.05,92.1,92.16,92.22,92.25,92.29,92.29,92.29,92.29,92.29,91.95,91.82,92.16,92.31,92.33,92.4,92.54,92.49,92.54,92.58,92.58,92.39,92.33,93.59,95.51,95.99,96.22,97.2,98.54,99.64,100.23,100.17) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 85.73 88.01 90.17 92.29 92.58 NA [2,] 85.73 88.01 90.17 92.29 92.39 NA [3,] 85.74 88.59 90.28 91.95 92.33 NA [4,] 86.32 89.43 90.87 91.82 93.59 NA [5,] 87.59 89.63 92.05 92.16 95.51 NA [6,] 87.81 89.73 92.10 92.31 95.99 NA [7,] 87.87 89.88 92.16 92.33 96.22 NA [8,] 87.94 89.89 92.22 92.40 97.20 NA [9,] 87.96 89.90 92.25 92.54 98.54 NA [10,] 88.01 89.91 92.29 92.49 99.64 NA [11,] 88.01 89.86 92.29 92.54 100.23 NA [12,] 88.01 90.07 92.29 92.58 100.17 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/1ypgt1387753146.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/20w791387753146.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/3hpn51387753146.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/4w1jp1387753146.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,] 85.73 85.73 85.74 86.32 87.59 87.81 87.87 87.94 87.96 88.01 88.01 88.01 [2,] 88.01 88.01 88.59 89.43 89.63 89.73 89.88 89.89 89.90 89.91 89.86 90.07 [3,] 90.17 90.17 90.28 90.87 92.05 92.10 92.16 92.22 92.25 92.29 92.29 92.29 [4,] 92.29 92.29 91.95 91.82 92.16 92.31 92.33 92.40 92.54 92.49 92.54 92.58 [5,] 92.58 92.39 92.33 93.59 95.51 95.99 92.33 92.40 92.54 92.49 92.54 92.58 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 87.14576 87.14576 87.90583 89.18123 90.26231 90.27698 90.42884 90.44644 [2,] 93.19424 93.19424 92.65417 92.55877 93.83769 93.92302 93.89116 93.99356 [,9] [,10] [,11] [,12] [1,] 90.38458 90.46698 90.39632 90.51644 [2,] 94.11542 94.11302 94.18368 94.06356 $out [1] 96.22 97.20 98.54 99.64 100.23 100.17 $group [1] 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(85.73, 88.01, 90.17, 92.29, 92.58, 85.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cgxm1387753146.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] [1,] 85.730 88.010 90.170 91.820 92.330 NA [2,] 86.030 89.010 90.575 92.225 93.085 NA [3,] 87.840 89.795 92.130 92.320 96.105 NA [4,] 87.985 89.895 92.270 92.515 99.090 NA [5,] 88.010 90.070 92.290 92.580 100.230 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 86.94831 89.39135 91.3569 92.18773 93.36608 NA [2,] 88.73169 90.19865 92.9031 92.45227 98.84392 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(85.73, 86.03, 87.84, 87.985, 88.01, 88.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fpb31387753146.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.701809 6.590 2.39 [2,] 2.885332 7.060 2.51 [3,] 3.100447 8.265 2.58 [4,] 4.199672 11.105 3.02 [5,] 4.660776 12.220 3.36 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.500968 6.420048 2.347386 [2,] 3.699927 10.109952 2.812614 $out [1] 4.28 4.28 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.70180865347641, 2.88533158483077, 3.10044722439707, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ypgt1387753146.ps tmp/1ypgt1387753146.png",intern=TRUE)) character(0) > try(system("convert tmp/20w791387753146.ps tmp/20w791387753146.png",intern=TRUE)) character(0) > try(system("convert tmp/3hpn51387753146.ps tmp/3hpn51387753146.png",intern=TRUE)) character(0) > try(system("convert tmp/4w1jp1387753146.ps tmp/4w1jp1387753146.png",intern=TRUE)) character(0) > try(system("convert tmp/5cgxm1387753146.ps tmp/5cgxm1387753146.png",intern=TRUE)) character(0) > try(system("convert tmp/6fpb31387753146.ps tmp/6fpb31387753146.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.400 0.817 5.192