R version 3.0.1 (2013-05-16) -- "Good Sport" 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(106.1,106.17,105.75,106.49,106.61,106.61,106.61,106.61,106.92,106.94,107.28,107.36,107.36,107.39,107.46,107.51,108.21,108.33,108.33,108.36,108.89,109.3,109.55,109.45,109.45,109.4,109.45,109.5,109.91,109.9,109.9,109.92,109.74,110.28,110.97,111.02,111.02,111,111.43,111.52,112.29,112.27,112.27,112.39,112.31,112.91,112.9,113.08,113.08,113.54,114,115.28,116.4,116.56,116.56,116.59,116.96,117.17,117.83,117.84,117.84,117.84,117.69,117.9,118.05,118.08,118.08,118.08,118.16,118.53,118.5,118.62) > 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,] 106.10 107.36 109.45 111.02 113.08 117.84 NA [2,] 106.17 107.39 109.40 111.00 113.54 117.84 NA [3,] 105.75 107.46 109.45 111.43 114.00 117.69 NA [4,] 106.49 107.51 109.50 111.52 115.28 117.90 NA [5,] 106.61 108.21 109.91 112.29 116.40 118.05 NA [6,] 106.61 108.33 109.90 112.27 116.56 118.08 NA [7,] 106.61 108.33 109.90 112.27 116.56 118.08 NA [8,] 106.61 108.36 109.92 112.39 116.59 118.08 NA [9,] 106.92 108.89 109.74 112.31 116.96 118.16 NA [10,] 106.94 109.30 110.28 112.91 117.17 118.53 NA [11,] 107.28 109.55 110.97 112.90 117.83 118.50 NA [12,] 107.36 109.45 111.02 113.08 117.84 118.62 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/fisher/rcomp/tmp/1ogmt1369614683.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/fisher/rcomp/tmp/20wla1369614683.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/fisher/rcomp/tmp/3ucoz1369614683.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/fisher/rcomp/tmp/4gk8t1369614683.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,] 106.100 106.17 105.75 106.49 106.61 106.610 106.610 106.610 106.920 [2,] 107.360 107.39 107.46 107.51 108.21 108.330 108.330 108.360 108.890 [3,] 110.235 110.20 110.44 110.51 111.10 111.085 111.085 111.155 111.025 [4,] 113.080 113.54 114.00 115.28 116.40 116.560 116.560 116.590 116.960 [5,] 117.840 117.84 117.69 117.90 118.05 118.080 118.080 118.080 118.160 [,10] [,11] [,12] [1,] 106.940 107.280 107.36 [2,] 109.300 109.550 109.45 [3,] 111.595 111.935 112.05 [4,] 117.170 117.830 117.84 [5,] 118.530 118.500 118.62 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106.5454 106.2331 106.2215 105.4981 105.8172 105.7764 105.7764 105.8464 [2,] 113.9246 114.1669 114.6585 115.5219 116.3828 116.3936 116.3936 116.4636 [,9] [,10] [,11] [,12] [1,] 105.8196 106.5186 106.5941 106.6382 [2,] 116.2304 116.6714 117.2759 117.4618 $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(106.1, 107.36, 110.235, 113.08, 117.84, 106.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5rk271369614683.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,] 105.75 107.360 109.400 111.000 113.080 117.69 NA [2,] 106.33 107.485 109.475 111.475 114.640 117.87 NA [3,] 106.61 108.330 109.900 112.280 116.560 118.08 NA [4,] 106.93 109.095 110.100 112.645 117.065 118.33 NA [5,] 107.36 109.550 111.020 113.080 117.840 118.62 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 106.3363 107.5957 109.6149 111.7464 115.4539 117.8702 NA [2,] 106.8837 109.0643 110.1851 112.8136 117.6661 118.2898 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(105.75, 106.33, 106.61, 106.93, 107.36, 107.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/601xn1369614683.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,] 4.255681 11.220 4.68250 [2,] 4.433668 11.335 5.86625 [3,] 4.542599 11.470 6.69375 [4,] 4.573515 11.630 6.76500 [5,] 4.578521 11.940 6.80750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.478813 11.33545 6.283824 [2,] 4.606384 11.60455 7.103676 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.25568051745742, 4.43366829924924, 4.5425986852521, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ogmt1369614683.ps tmp/1ogmt1369614683.png",intern=TRUE)) character(0) > try(system("convert tmp/20wla1369614683.ps tmp/20wla1369614683.png",intern=TRUE)) character(0) > try(system("convert tmp/3ucoz1369614683.ps tmp/3ucoz1369614683.png",intern=TRUE)) character(0) > try(system("convert tmp/4gk8t1369614683.ps tmp/4gk8t1369614683.png",intern=TRUE)) character(0) > try(system("convert tmp/5rk271369614683.ps tmp/5rk271369614683.png",intern=TRUE)) character(0) > try(system("convert tmp/601xn1369614683.ps tmp/601xn1369614683.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.772 0.539 3.301