R version 2.6.0 (2007-10-03) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(100.80,100.80,100.80,90.10,95.70,88.60,93.30,93.30,93.30,93.30,93.30,93.30,88.60,97.40,97.40,102.90,102.90,102.90,105.10,105.10,105.10,105.10,105.10,105.10,96.90,96.90,96.90,96.90,96.90,96.90,96.50,96.50,96.50,96.00,96.00,96.00,96.00,96.00,96.00,105.80,105.80,105.80,105.80,105.80,105.80,105.80,105.80,105.80,123.60,142.20,142.20,141.20,141.20,141.20,124.70,124.70,124.70,122.70,122.70,122.70,123.30,123.30,123.30,127.20,127.20,127.20,140.00,140.00,140.00,140.00,140.00,140.00,139.00,139.00,139.00,147.00,147.00,147.00,147.10,147.10) > par1 = '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2006), Standard Deviation Plot (v1.0.0) 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 > #Technical description: Write here your technical program description > par1 <- as.numeric(par1) > (n <- length(x)) [1] 80 > (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] 7 7 7 7 7 7 7 7 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.8 88.6 96.9 96.0 123.6 123.3 139.0 [2,] 100.8 97.4 96.9 96.0 142.2 123.3 139.0 [3,] 100.8 97.4 96.9 96.0 142.2 123.3 139.0 [4,] 90.1 102.9 96.9 105.8 141.2 127.2 147.0 [5,] 95.7 102.9 96.9 105.8 141.2 127.2 147.0 [6,] 88.6 102.9 96.9 105.8 141.2 127.2 147.0 [7,] 93.3 105.1 96.5 105.8 124.7 140.0 147.1 [8,] 93.3 105.1 96.5 105.8 124.7 140.0 147.1 [9,] 93.3 105.1 96.5 105.8 124.7 140.0 NA [10,] 93.3 105.1 96.0 105.8 122.7 140.0 NA [11,] 93.3 105.1 96.0 105.8 122.7 140.0 NA [12,] 93.3 105.1 96.0 105.8 122.7 140.0 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/www/html/rcomp/tmp/1a1xw1196113611.ps",horizontal=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/www/html/rcomp/tmp/2ivky1196113611.ps",horizontal=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/www/html/rcomp/tmp/3ew5j1196113611.ps",horizontal=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/www/html/rcomp/tmp/4om9q1196113611.ps",horizontal=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] [1,] 88.60 96.00 96.00 90.1 95.7 88.6 93.30 93.30 93.30 93.30 93.30 [2,] 96.45 97.15 97.15 99.9 99.9 99.9 100.80 100.80 96.50 96.00 96.00 [3,] 100.80 100.80 100.80 105.8 105.8 105.8 105.80 105.80 105.45 105.45 105.45 [4,] 123.45 131.15 131.15 134.2 134.2 134.2 132.35 132.35 124.70 122.70 122.70 [5,] 139.00 142.20 142.20 147.0 147.0 147.0 147.10 147.10 140.00 140.00 140.00 [,12] [1,] 93.30 [2,] 96.00 [3,] 105.45 [4,] 122.70 [5,] 140.00 $n [1] 7 7 7 7 7 7 7 7 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 84.67604 80.49575 80.49575 85.3166 85.3166 85.3166 86.95885 [2,] 116.92396 121.10425 121.10425 126.2834 126.2834 126.2834 124.64115 [,8] [,9] [,10] [,11] [,12] [1,] 86.95885 87.26009 88.22764 88.22764 88.22764 [2,] 124.64115 123.63991 122.67236 122.67236 122.67236 $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(88.6, 96.45, 100.8, 123.45, 139, 96, 97.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/58iow1196113611.ps",horizontal=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,] 88.60 97.40 96.00 96.0 122.70 123.30 139.00 [2,] 93.30 100.15 96.25 100.9 123.15 125.25 139.00 [3,] 93.30 104.00 96.70 105.8 124.70 133.60 147.00 [4,] 98.25 105.10 96.90 105.8 141.20 140.00 147.05 [5,] 100.80 105.10 96.90 105.8 142.20 140.00 147.10 $n [1] 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.04227 101.7423 96.40353 103.5651 116.4673 126.8724 142.5032 [2,] 95.55773 106.2577 96.99647 108.0349 132.9327 140.3276 151.4968 $out [1] 88.6 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(88.6, 93.3, 93.3, 98.25, 100.8, 97.4, 100.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6hkfy1196113611.ps",horizontal=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,] 17.75629 46.20 20.2000 [2,] 17.86152 46.70 20.7625 [3,] 20.70474 48.55 31.5500 [4,] 21.42444 53.80 34.1500 [5,] 22.77380 58.40 34.3000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 19.07967 45.31164 25.44387 [2,] 22.32981 51.78836 37.65613 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(17.7562852721696, 17.8615161672255, 20.7047383580713, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1a1xw1196113611.ps tmp/1a1xw1196113611.png") > system("convert tmp/2ivky1196113611.ps tmp/2ivky1196113611.png") > system("convert tmp/3ew5j1196113611.ps tmp/3ew5j1196113611.png") > system("convert tmp/4om9q1196113611.ps tmp/4om9q1196113611.png") > system("convert tmp/58iow1196113611.ps tmp/58iow1196113611.png") > system("convert tmp/6hkfy1196113611.ps tmp/6hkfy1196113611.png") > > > proc.time() user system elapsed 1.354 0.862 1.579