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(512927,502831,470984,471067,476049,474605,470439,461251,454724,455626,516847,525192,522975,518585,509239,512238,519164,517009,509933,509127,500857,506971,569323,579714,577992,565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916) > 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,] 512927 522975 577992 612613 628232 619916 [2,] 502831 518585 565464 611324 612117 NA [3,] 470984 509239 547344 594167 595404 NA [4,] 471067 512238 554788 595454 597141 NA [5,] 476049 519164 562325 590865 593408 NA [6,] 474605 517009 560854 589379 590072 NA [7,] 470439 509933 555332 584428 579799 NA [8,] 461251 509127 543599 573100 574205 NA [9,] 454724 500857 536662 567456 572775 NA [10,] 455626 506971 542722 569028 572942 NA [11,] 516847 569323 593530 620735 619567 NA [12,] 525192 579714 610763 628884 625809 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/163e21225376833.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/2edyg1225376833.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/3ccvk1225376833.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/4001n1225376833.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] [1,] 512927.0 502831 470984 471067 476049 474605 470439 461251 454724 455626 [2,] 522975.0 518585 509239 512238 519164 517009 509933 509127 500857 506971 [3,] 595302.5 565464 547344 554788 562325 560854 555332 543599 536662 542722 [4,] 619916.0 611324 594167 595454 590865 589379 579799 573100 567456 569028 [5,] 628232.0 612117 595404 597141 593408 590072 584428 574205 572775 572942 [,11] [,12] [1,] 516847 525192 [2,] 569323 579714 [3,] 593530 610763 [4,] 619567 625809 [5,] 620735 628884 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 532772.4 499934.9 487334.1 495987.8 511661.3 509717.5 505964.9 498395.8 [2,] 657832.6 630993.1 607353.9 613588.2 612988.7 611990.5 604699.1 588802.2 [,9] [,10] [,11] [,12] [1,] 489603.3 498872.7 558027.7 578192.4 [2,] 583720.7 586571.3 629032.3 643333.6 $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(512927, 522975, 595302.5, 619916, 628232, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5pc9z1225376833.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,] 454724 500857.0 536662.0 567456.0 572775 619916 [2,] 465845 509183.0 545471.5 578764.0 577002 619916 [3,] 472836 514623.5 558093.0 592516.0 594406 619916 [4,] 507879 521069.5 571728.0 611968.5 615842 619916 [5,] 525192 522975.0 610763.0 628884.0 628232 619916 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 453664 509202 546117.2 577371.2 576690.8 619916 [2,] 492008 520045 570068.8 607660.8 612121.2 619916 $out [1] 569323 579714 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(454724, 465845, 472836, 507879, 525192, 500857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/60c381225376833.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,] 526494.8 536662.0 534156.5 [2,] 536121.3 545471.5 542989.8 [3,] 546260.7 558093.0 553520.0 [4,] 570586.7 579497.0 571182.1 [5,] 594072.4 610763.0 602761.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 530540.8 542573.7 540661.3 [2,] 561980.6 573612.3 566378.7 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(526494.8, 536121.3, 546260.7, 570586.683333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/163e21225376833.ps tmp/163e21225376833.png") > system("convert tmp/2edyg1225376833.ps tmp/2edyg1225376833.png") > system("convert tmp/3ccvk1225376833.ps tmp/3ccvk1225376833.png") > system("convert tmp/4001n1225376833.ps tmp/4001n1225376833.png") > system("convert tmp/5pc9z1225376833.ps tmp/5pc9z1225376833.png") > system("convert tmp/60c381225376833.ps tmp/60c381225376833.png") > > > proc.time() user system elapsed 1.239 0.799 1.495