R version 2.7.2 (2008-08-25) 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(467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557) > 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] 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,] 467 476 519 562 591 593 NA [2,] 460 475 517 561 589 590 NA [3,] 448 470 510 555 584 580 NA [4,] 443 461 509 544 573 574 NA [5,] 436 455 501 537 567 573 NA [6,] 431 456 507 543 569 573 NA [7,] 484 517 569 594 621 620 NA [8,] 510 525 580 611 629 626 NA [9,] 513 523 578 613 628 620 NA [10,] 503 519 565 611 612 588 NA [11,] 471 509 547 594 595 566 NA [12,] 471 512 555 595 597 557 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/1awu01225629051.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/26tqj1225629051.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/3wbi21225629051.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/4rvh91225629051.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,] 467.0 460 448.0 443.0 436 431 484.0 510.0 513.0 503.0 471.0 471 [2,] 476.0 475 470.0 461.0 455 456 517.0 525.0 523.0 519.0 509.0 512 [3,] 540.5 539 532.5 526.5 519 525 581.5 595.5 595.5 576.5 556.5 556 [4,] 591.0 589 580.0 573.0 567 569 620.0 626.0 620.0 611.0 594.0 595 [5,] 593.0 590 584.0 574.0 573 573 621.0 629.0 628.0 612.0 595.0 597 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 466.3213 465.4663 461.5464 454.2564 446.7564 452.1114 515.0617 530.3517 [2,] 614.6787 612.5337 603.4536 598.7436 591.2436 597.8886 647.9383 660.6483 [,9] [,10] [,11] [,12] [1,] 532.9319 517.157 501.6723 502.4623 [2,] 658.0681 635.843 611.3277 609.5377 $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(467, 476, 540.5, 591, 593, 460, 475, 539, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5bt0j1225629051.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,] 431.0 455.0 501.0 537.0 567.0 557.0 NA [2,] 445.5 465.5 509.5 549.5 578.5 573.0 NA [3,] 469.0 492.5 533.0 578.0 593.0 584.0 NA [4,] 493.5 518.0 567.0 603.0 616.5 606.5 NA [5,] 513.0 525.0 580.0 613.0 629.0 626.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 447.1069 468.5544 506.7739 553.5983 575.668 568.7204 NA [2,] 490.8931 516.4456 559.2261 602.4017 610.332 599.2796 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(431, 445.5, 469, 493.5, 513, 455, 465.5, 492.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6t97k1225629051.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,] 511.5000 519.00 513.0000 [2,] 520.9167 529.50 523.1250 [3,] 540.8333 548.25 544.0000 [4,] 566.9167 579.00 569.8125 [5,] 580.1667 595.50 580.5000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 519.8524 525.6727 522.7055 [2,] 561.8142 570.8273 565.2945 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(511.5, 520.916666666667, 540.833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1awu01225629051.ps tmp/1awu01225629051.png") > system("convert tmp/26tqj1225629051.ps tmp/26tqj1225629051.png") > system("convert tmp/3wbi21225629051.ps tmp/3wbi21225629051.png") > system("convert tmp/4rvh91225629051.ps tmp/4rvh91225629051.png") > system("convert tmp/5bt0j1225629051.ps tmp/5bt0j1225629051.png") > system("convert tmp/6t97k1225629051.ps tmp/6t97k1225629051.png") > > > proc.time() user system elapsed 1.928 1.251 2.133