R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(94.7,101.8,102.5,105.3,110.3,109.8,117.3,118.8,131.3,125.9,133.1,147,145.8,164.4,149.8,137.7,151.7,156.8,180,180.4,170.4,191.6,199.5,218.2,217.5,205,194,199.3,219.3,211.1,215.2,240.2,242.2,240.7,255.4,253,218.2,203.7,205.6,215.6,188.5,202.9,214,230.3,230,241,259.6,247.8,270.3,289.7,322.7,315,320.2,329.5,360.6,382.2,435.4,464,468.8,403,351.6) > par1 = '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Mean Plot (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_meanplot.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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 94.7 145.8 217.5 218.2 270.3 351.6 [2,] 101.8 164.4 205.0 203.7 289.7 NA [3,] 102.5 149.8 194.0 205.6 322.7 NA [4,] 105.3 137.7 199.3 215.6 315.0 NA [5,] 110.3 151.7 219.3 188.5 320.2 NA [6,] 109.8 156.8 211.1 202.9 329.5 NA [7,] 117.3 180.0 215.2 214.0 360.6 NA [8,] 118.8 180.4 240.2 230.3 382.2 NA [9,] 131.3 170.4 242.2 230.0 435.4 NA [10,] 125.9 191.6 240.7 241.0 464.0 NA [11,] 133.1 199.5 255.4 259.6 468.8 NA [12,] 147.0 218.2 253.0 247.8 403.0 NA > arr.mean <- array(NA,dim=par1) > arr.median <- array(NA,dim=par1) > arr.midrange <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.mean[j] <- mean(arr[j,],na.rm=TRUE) + arr.median[j] <- median(arr[j,],na.rm=TRUE) + arr.midrange[j] <- (quantile(arr[j,],0.75,na.rm=TRUE) + quantile(arr[j,],0.25,na.rm=TRUE)) / 2 + } > overall.mean <- mean(x) > overall.median <- median(x) > overall.midrange <- (quantile(x,0.75) + quantile(x,0.25)) / 2 > postscript(file="/var/www/html/freestat/rcomp/tmp/1v1hj1229271768.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,type='b',ylab='mean',main='Mean Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.mean,0) > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2uvxn1229271768.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.median,type='b',ylab='median',main='Median Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.median,0) > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/31b901229271768.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.midrange,type='b',ylab='midrange',main='Midrange Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.midrange,0) > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/4hgrw1229271768.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] [,12] [1,] 94.70 164.4 102.5 105.3 110.3 109.8 180.0 118.8 131.3 125.9 133.1 218.2 [2,] 145.80 164.4 149.8 137.7 151.7 156.8 180.0 180.4 170.4 191.6 199.5 218.2 [3,] 217.85 203.7 194.0 199.3 188.5 202.9 214.0 230.3 230.0 240.7 255.4 247.8 [4,] 270.30 205.0 205.6 215.6 219.3 211.1 215.2 240.2 242.2 241.0 259.6 253.0 [5,] 351.60 205.0 205.6 315.0 320.2 211.1 215.2 240.2 242.2 241.0 259.6 253.0 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 137.5435 175.0121 154.5719 144.2561 140.734 164.5318 189.1278 188.0455 [2,] 298.1565 232.3879 233.4281 254.3439 236.266 241.2682 238.8722 272.5545 [,9] [,10] [,11] [,12] [1,] 179.2663 205.7941 212.9335 223.2104 [2,] 280.7337 275.6059 297.8665 272.3896 $out [1] 101.8 289.7 322.7 329.5 117.3 360.6 382.2 435.4 464.0 468.8 147.0 403.0 $group [1] 2 2 3 6 7 7 8 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.7, 145.8, 217.85, 270.3, 351.6, 164.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5yaoa1229271768.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] [1,] 94.7 137.70 194.00 188.50 270.30 351.6 [2,] 103.9 150.75 208.05 204.65 317.60 351.6 [3,] 113.8 167.40 218.40 216.90 345.05 351.6 [4,] 128.6 186.00 241.45 235.65 419.20 351.6 [5,] 147.0 218.20 255.40 259.60 468.80 351.6 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 102.5342 151.3222 203.1660 202.7607 298.7096 351.6 [2,] 125.0658 183.4778 233.6340 231.0393 391.3904 351.6 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(94.7, 103.9, 113.8, 128.6, 147, 137.7, 150.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6txst1229271768.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.mean,arr.median,arr.midrange)) > names(z) <- list('mean','median','midrange') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Central Tendency',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 192.920 188.500 176.650 [2,] 196.460 201.100 184.325 [3,] 216.885 215.925 201.950 [4,] 247.250 235.500 213.400 [5,] 263.280 255.400 235.600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 193.7193 200.2349 188.6887 [2,] 240.0507 231.6151 215.2113 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(192.92, 196.46, 216.885, 247.25, 263.28, 188.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1v1hj1229271768.ps tmp/1v1hj1229271768.png") > system("convert tmp/2uvxn1229271768.ps tmp/2uvxn1229271768.png") > system("convert tmp/31b901229271768.ps tmp/31b901229271768.png") > system("convert tmp/4hgrw1229271768.ps tmp/4hgrw1229271768.png") > system("convert tmp/5yaoa1229271768.ps tmp/5yaoa1229271768.png") > system("convert tmp/6txst1229271768.ps tmp/6txst1229271768.png") > > > proc.time() user system elapsed 1.641 1.255 1.822