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(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,561,549,532,526,511,499,555,565,542,527,510,514) > 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] 60 > (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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 519 562 591 593 561 NA [2,] 517 561 589 590 549 NA [3,] 510 555 584 580 532 NA [4,] 509 544 573 574 526 NA [5,] 501 537 567 573 511 NA [6,] 507 543 569 573 499 NA [7,] 569 594 621 620 555 NA [8,] 580 611 629 626 565 NA [9,] 578 613 628 620 542 NA [10,] 565 611 612 588 527 NA [11,] 547 594 595 566 510 NA [12,] 555 595 597 557 514 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/15ykh1225542193.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/2iih31225542193.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/32msb1225542193.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/493be1225542193.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,] 519 517 510 509 501 499 555 565 542 527 510 514 [2,] 561 549 532 526 511 507 569 580 578 565 547 555 [3,] 562 561 555 544 537 543 594 611 613 588 566 557 [4,] 591 589 580 573 567 569 620 626 620 611 594 595 [5,] 593 590 584 574 573 573 621 629 628 612 595 597 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 540.8021 532.7361 521.0833 510.7899 497.4305 499.191 557.9635 578.4965 [2,] 583.1979 589.2639 588.9167 577.2101 576.5695 586.809 630.0365 643.5035 [,9] [,10] [,11] [,12] [1,] 583.3229 555.4965 532.7899 528.7361 [2,] 642.6771 620.5035 599.2101 585.2639 $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(519, 561, 562, 591, 593, 517, 549, 561, 589, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5fjyw1225542193.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,] 501.0 537.0 567.0 557.0 499.0 NA [2,] 509.5 549.5 578.5 573.0 512.5 NA [3,] 533.0 578.0 593.0 584.0 529.5 NA [4,] 567.0 603.0 616.5 606.5 552.0 NA [5,] 580.0 613.0 629.0 626.0 565.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 506.7739 553.5983 575.668 568.7204 511.4838 NA [2,] 559.2261 602.4017 610.332 599.2796 547.5162 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(501, 509.5, 533, 567, 580, 537, 549.5, 578, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6e83q1225542193.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,] 537.8 537.0 538.00 [2,] 548.7 549.5 552.75 [3,] 563.0 561.5 572.75 [4,] 586.2 591.0 591.25 [5,] 602.2 613.0 603.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 545.896 542.5716 555.1899 [2,] 580.104 580.4284 590.3101 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(537.8, 548.7, 563, 586.2, 602.2, 537, 549.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/15ykh1225542193.ps tmp/15ykh1225542193.png") > system("convert tmp/2iih31225542193.ps tmp/2iih31225542193.png") > system("convert tmp/32msb1225542193.ps tmp/32msb1225542193.png") > system("convert tmp/493be1225542193.ps tmp/493be1225542193.png") > system("convert tmp/5fjyw1225542193.ps tmp/5fjyw1225542193.png") > system("convert tmp/6e83q1225542193.ps tmp/6e83q1225542193.png") > > > proc.time() user system elapsed 1.275 0.826 1.507