R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558,575,580,575,563,552,537,545,601,604,586,564,549,551,556,548,540,531,521,519,572,581,563,548,539,541,562,559,546,536,528,530,582,599,584,571,563,565) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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 > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 73 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[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,] 557 514 516 575 551 541 565 [2,] 561 517 528 580 556 562 NA [3,] 549 508 533 575 548 559 NA [4,] 532 493 536 563 540 546 NA [5,] 526 490 537 552 531 536 NA [6,] 511 469 524 537 521 528 NA [7,] 499 478 536 545 519 530 NA [8,] 555 528 587 601 572 582 NA [9,] 565 534 597 604 581 599 NA [10,] 542 518 581 586 563 584 NA [11,] 527 506 564 564 548 571 NA [12,] 510 502 558 549 539 563 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4 3 12 5 5 21 NA [2,] -12 -9 5 -5 -8 -3 NA [3,] -17 -15 3 -12 -8 -13 NA [4,] -6 -3 1 -11 -9 -10 NA [5,] -15 -21 -13 -15 -10 -8 NA [6,] -12 9 12 8 -2 2 NA [7,] 56 50 51 56 53 52 NA [8,] 10 6 10 3 9 17 NA [9,] -23 -16 -16 -18 -18 -15 NA [10,] -15 -12 -17 -22 -15 -13 NA [11,] -17 -4 -6 -15 -9 -8 NA [12,] 4 14 17 2 2 2 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/wessaorg/rcomp/tmp/1sx0l1362672986.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2yszk1362672986.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3imqv1362672986.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/4plmg1362672986.ps",horizontal=F,onefile=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,] 514.0 517.0 508.0 532 526.0 511.0 478.0 528 534 518 506 502 [2,] 528.5 528.0 533.0 532 526.0 511.0 499.0 555 565 542 527 510 [3,] 551.0 558.5 548.5 538 533.5 522.5 524.5 577 589 572 556 544 [4,] 561.0 562.0 559.0 546 537.0 528.0 536.0 587 599 584 564 558 [5,] 575.0 580.0 575.0 563 552.0 537.0 545.0 601 604 586 571 563 $n [1] 7 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 531.5915 536.5689 531.7292 528.9695 526.4046 511.5345 500.6338 556.359 [2,] 570.4085 580.4311 565.2708 547.0305 540.5954 533.4655 548.3662 597.641 [,9] [,10] [,11] [,12] [1,] 567.0689 544.9086 532.1338 513.0384 [2,] 610.9311 599.0914 579.8662 574.9616 $out [1] 493 490 469 $group [1] 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(514, 528.5, 551, 561, 575, 517, 528, 558.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cm6r1362672986.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 3 -12.0 -17.0 -11.0 -21 -12 50.0 3.0 -18 -22 -17.0 2 [2,] 4 -9.0 -15.0 -10.0 -15 -2 51.0 6.0 -18 -17 -15.0 2 [3,] 5 -6.5 -12.5 -7.5 -14 5 52.5 9.5 -17 -15 -8.5 3 [4,] 12 -3.0 -8.0 -3.0 -10 9 56.0 10.0 -16 -13 -6.0 14 [5,] 21 5.0 -8.0 1.0 -8 12 56.0 10.0 -15 -12 -4.0 17 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1602584 -10.370194 -17.015226 -12.015226 -17.22516 -2.095355 49.27484 [2,] 10.1602584 -2.629806 -7.984774 -2.984774 -10.77484 12.095355 55.72516 [,8] [,9] [,10] [,11] [,12] [1,] 6.919871 -18.29006 -17.58013 -14.305291 -4.740388 [2,] 12.080129 -15.70994 -12.41987 -2.694709 10.740388 $out [1] 3 17 -23 $group [1] 3 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3, 4, 5, 12, 21, -12, -9, -6.5, -3, 5, -17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dx191362672986.ps",horizontal=F,onefile=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,] 499.0 469.0 516.0 537.0 519.0 528.0 565 [2,] 518.5 491.5 530.5 550.5 535.0 538.5 565 [3,] 537.0 507.0 536.5 569.5 548.0 560.5 565 [4,] 556.0 517.5 572.5 583.0 559.5 576.5 565 [5,] 565.0 534.0 597.0 604.0 581.0 599.0 565 $n [1] 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 519.896 495.1412 517.3435 554.6765 536.8254 543.1679 565 [2,] 554.104 518.8588 555.6565 584.3235 559.1746 577.8321 565 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(499, 518.5, 537, 556, 565, 469, 491.5, 507, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73zuh1362672986.ps",horizontal=F,onefile=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,] 515.0000 522.50 519.2500 [2,] 531.8333 535.75 534.2500 [3,] 545.4524 549.75 545.6875 [4,] 556.5000 565.25 556.8125 [5,] 580.0000 589.00 583.7500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 534.2017 536.2949 535.3966 [2,] 556.7030 563.2051 555.9784 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(515, 531.833333333333, 545.452380952381, 556.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1sx0l1362672986.ps tmp/1sx0l1362672986.png",intern=TRUE)) character(0) > try(system("convert tmp/2yszk1362672986.ps tmp/2yszk1362672986.png",intern=TRUE)) character(0) > try(system("convert tmp/3imqv1362672986.ps tmp/3imqv1362672986.png",intern=TRUE)) character(0) > try(system("convert tmp/4plmg1362672986.ps tmp/4plmg1362672986.png",intern=TRUE)) character(0) > try(system("convert tmp/5cm6r1362672986.ps tmp/5cm6r1362672986.png",intern=TRUE)) character(0) > try(system("convert tmp/6dx191362672986.ps tmp/6dx191362672986.png",intern=TRUE)) character(0) > try(system("convert tmp/73zuh1362672986.ps tmp/73zuh1362672986.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.466 0.618 4.066