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(373,371,354,357,363,364,363,358,357,357,380,378,376,380,379,384,392,394,392,396,392,396,419,421,420,418,410,418,426,428,430,424,423,427,441,449,452,462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418) > 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] 73 > (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 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 373 376 420 452 471 471 418 [2,] 371 380 418 462 465 453 NA [3,] 354 379 410 455 459 443 NA [4,] 357 384 418 461 465 442 NA [5,] 363 392 426 461 468 444 NA [6,] 364 394 428 463 467 438 NA [7,] 363 392 430 462 463 427 NA [8,] 358 396 424 456 460 424 NA [9,] 357 392 423 455 462 416 NA [10,] 357 396 427 456 461 406 NA [11,] 380 419 441 472 476 431 NA [12,] 378 421 449 472 476 434 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/rcomp/tmp/1c38t1194895018.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/rcomp/tmp/2fic91194895018.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/rcomp/tmp/3h3g31194895018.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/rcomp/tmp/4ttob1194895018.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,] 373.0 371.0 354.0 357 363 364 363.0 358 357.0 357.0 380 378.0 [2,] 397.0 380.0 379.0 384 392 394 392.0 396 392.0 396.0 419 421.0 [3,] 420.0 435.5 426.5 430 435 433 428.5 424 419.5 416.5 436 441.5 [4,] 461.5 462.0 455.0 461 461 463 462.0 456 455.0 456.0 472 472.0 [5,] 471.0 465.0 459.0 465 468 467 463.0 460 462.0 461.0 476 476.0 $n [1] 7 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 381.4816 382.6074 377.4775 380.3325 390.4928 388.4928 383.3477 385.2981 [2,] 458.5184 488.3926 475.5225 479.6675 479.5072 477.5072 473.6523 462.7019 [,9] [,10] [,11] [,12] [1,] 378.863 377.7981 401.8133 408.6034 [2,] 460.137 455.2019 470.1867 474.3966 $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(373, 397, 420, 461.5, 471, 371, 380, 435.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/54haw1194895018.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,] 354 376 410 452.0 459.0 406.0 418 [2,] 357 382 419 455.5 461.5 425.5 418 [3,] 363 392 425 461.0 465.0 436.0 418 [4,] 372 396 429 462.5 469.5 443.5 418 [5,] 380 396 441 472.0 476.0 453.0 418 $n [1] 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 356.1584 385.6145 420.4389 457.8073 461.3511 427.7901 418 [2,] 369.8416 398.3855 429.5611 464.1927 468.6489 444.2099 418 $out [1] 419 421 449 471 $group [1] 2 2 3 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(354, 357, 363, 372, 380, 376, 382, 392, 396, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6n5ug1194895018.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,] 416.6667 416.50 419.3750 [2,] 418.5833 422.00 424.0000 [3,] 423.8333 429.25 426.4375 [4,] 425.7619 435.25 429.4375 [5,] 436.5000 441.50 429.6250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 420.5591 423.2066 423.9574 [2,] 427.1075 435.2934 428.9176 $out [1] 438.3333 443.1250 445.2500 $group [1] 1 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(416.666666666667, 418.583333333333, 423.833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1c38t1194895018.ps tmp/1c38t1194895018.png") > system("convert tmp/2fic91194895018.ps tmp/2fic91194895018.png") > system("convert tmp/3h3g31194895018.ps tmp/3h3g31194895018.png") > system("convert tmp/4ttob1194895018.ps tmp/4ttob1194895018.png") > system("convert tmp/54haw1194895018.ps tmp/54haw1194895018.png") > system("convert tmp/6n5ug1194895018.ps tmp/6n5ug1194895018.png") > > > proc.time() user system elapsed 1.326 0.854 1.703