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(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) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '12' > ylab = '' > xlab = '' > main = '' > #'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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 562 591 593 561 NA [2,] 561 589 590 549 NA [3,] 555 584 580 532 NA [4,] 544 573 574 526 NA [5,] 537 567 573 511 NA [6,] 543 569 573 499 NA [7,] 594 621 620 555 NA [8,] 611 629 626 565 NA [9,] 613 628 620 542 NA [10,] 611 612 588 527 NA [11,] 594 595 566 510 NA [12,] 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/freestat/rcomp/tmp/1hmpt1225757351.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/2ktm41225757351.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/3ecoe1225757351.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/4okly1225757351.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,] 561.0 549.0 532.0 526.0 511 499 555.0 565.0 542.0 527.0 510.0 514.0 [2,] 561.5 555.0 543.5 535.0 524 521 574.5 588.0 577.5 557.5 538.0 535.5 [3,] 576.5 575.0 567.5 558.5 552 556 607.0 618.5 616.5 599.5 580.0 576.0 [4,] 592.0 589.5 582.0 573.5 570 571 620.5 627.5 624.0 611.5 594.5 596.0 [5,] 593.0 590.0 584.0 574.0 573 573 621.0 629.0 628.0 612.0 595.0 597.0 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 552.405 547.745 537.085 528.085 515.66 516.5 570.66 587.295 579.765 556.84 [2,] 600.595 602.255 597.915 588.915 588.34 595.5 643.34 649.705 653.235 642.16 [,11] [,12] [1,] 535.365 528.205 [2,] 624.635 623.795 $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(561, 561.5, 576.5, 592, 593, 549, 555, 575, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5iwzu1225757351.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] [1,] 537.0 567.0 557.0 499.0 NA [2,] 549.5 578.5 573.0 512.5 NA [3,] 578.0 593.0 584.0 529.5 NA [4,] 603.0 616.5 606.5 552.0 NA [5,] 613.0 629.0 626.0 565.0 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 553.5983 575.668 568.7204 511.4838 NA [2,] 602.4017 610.332 599.2796 547.5162 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(537, 549.5, 578, 603, 613, 567, 578.5, 593, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6ea3w1225757351.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,] 546.00 552.00 549.500 [2,] 558.50 563.00 560.750 [3,] 569.25 576.25 573.375 [4,] 591.00 603.25 597.125 [5,] 607.75 618.50 613.125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 554.4265 557.8917 556.7841 [2,] 584.0735 594.6083 589.9659 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(546, 558.5, 569.25, 591, 607.75, 552, 563, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1hmpt1225757351.ps tmp/1hmpt1225757351.png") > system("convert tmp/2ktm41225757351.ps tmp/2ktm41225757351.png") > system("convert tmp/3ecoe1225757351.ps tmp/3ecoe1225757351.png") > system("convert tmp/4okly1225757351.ps tmp/4okly1225757351.png") > system("convert tmp/5iwzu1225757351.ps tmp/5iwzu1225757351.png") > system("convert tmp/6ea3w1225757351.ps tmp/6ea3w1225757351.png") > > > proc.time() user system elapsed 1.927 1.260 2.124