R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(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,578,572,565,561,551,553,611,622,613,599,591,596) > 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] 72 > (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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 517 528 580 556 562 578 NA [2,] 508 533 575 548 559 572 NA [3,] 493 536 563 540 546 565 NA [4,] 490 537 552 531 536 561 NA [5,] 469 524 537 521 528 551 NA [6,] 478 536 545 519 530 553 NA [7,] 528 587 601 572 582 611 NA [8,] 534 597 604 581 599 622 NA [9,] 518 581 586 563 584 613 NA [10,] 506 564 564 548 571 599 NA [11,] 502 558 549 539 563 591 NA [12,] 516 575 551 541 565 596 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -9 5 -5 -8 -3 -6 NA [2,] -15 3 -12 -8 -13 -7 NA [3,] -3 1 -11 -9 -10 -4 NA [4,] -21 -13 -15 -10 -8 -10 NA [5,] 9 12 8 -2 2 2 NA [6,] 50 51 56 53 52 58 NA [7,] 6 10 3 9 17 11 NA [8,] -16 -16 -18 -18 -15 -9 NA [9,] -12 -17 -22 -15 -13 -14 NA [10,] -4 -6 -15 -9 -8 -8 NA [11,] 14 17 2 2 2 5 NA [12,] 12 5 5 21 13 NA 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/1nfnr1413052708.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/2blxn1413052708.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/3vyu41413052708.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/47h2o1413052708.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,] 517 508.0 536 531.0 521 519 572.0 581 563.0 548 539.0 516 [2,] 528 533.0 536 531.0 521 519 572.0 581 563.0 548 539.0 541 [3,] 559 553.5 543 536.5 526 533 584.5 598 582.5 564 553.5 558 [4,] 578 572.0 563 552.0 537 545 601.0 604 586.0 571 563.0 575 [5,] 580 575.0 565 561.0 551 553 611.0 622 613.0 599 591.0 596 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 526.7484 528.3437 525.5841 522.9543 515.6795 516.2292 565.7941 583.1643 [2,] 591.2516 578.6563 560.4159 550.0457 536.3205 549.7708 603.2059 612.8357 [,9] [,10] [,11] [,12] [1,] 567.6643 549.1643 538.0192 536.0689 [2,] 597.3357 578.8357 568.9808 579.9311 $out [1] 493 490 469 478 528 534 518 506 502 $group [1] 3 4 5 6 7 8 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(517, 528, 559, 578, 580, 508, 533, 553.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p0px1413052708.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,] -9.0 -15 -11.0 -21.0 -2 50.0 3.0 -18 -22.0 -9 2.0 5 [2,] -8.0 -13 -10.0 -15.0 2 51.0 6.0 -18 -17.0 -9 2.0 5 [3,] -5.5 -10 -6.5 -11.5 5 52.5 9.5 -16 -14.5 -8 3.5 12 [4,] -3.0 -7 -3.0 -10.0 9 56.0 11.0 -15 -13.0 -6 14.0 13 [5,] -3.0 -7 1.0 -8.0 12 58.0 17.0 -15 -12.0 -4 17.0 21 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8.725161 -13.870194 -11.015226 -14.725161 0.4847739 49.27484 6.274839 [2,] -2.274839 -6.129806 -1.984774 -8.274839 9.5152261 55.72516 12.725161 [,8] [,9] [,10] [,11] [,12] [1,] -17.9351 -17.08013 -9.935097 -4.240388 6.34722 [2,] -14.0649 -11.91987 -6.064903 11.240388 17.65278 $out [1] 5 3 -9 -15 $group [1] 1 2 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-9, -8, -5.5, -3, -3, -15, -13, -10, -7, -7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6yom91413052708.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,] 469.0 524.0 537.0 519.0 528.0 551.0 NA [2,] 491.5 534.5 550.0 535.0 541.0 563.0 NA [3,] 507.0 547.5 563.5 544.5 562.5 584.5 NA [4,] 517.5 578.0 583.0 559.5 576.5 605.0 NA [5,] 534.0 597.0 604.0 581.0 599.0 622.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 495.1412 527.6594 548.4485 533.3254 546.3082 565.3435 NA [2,] 518.8588 567.3406 578.5515 555.6746 578.6918 603.6565 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(469, 491.5, 507, 517.5, 534, 524, 534.5, 547.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7j8ey1413052708.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,] 521.6667 526.00 528.2500 [2,] 537.5000 539.75 544.0625 [3,] 551.9167 555.75 553.6250 [4,] 566.4167 573.25 568.5625 [5,] 589.5000 598.00 593.8750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 538.7276 540.4704 542.4504 [2,] 565.1058 571.0296 564.7996 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(521.666666666667, 537.5, 551.916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nfnr1413052708.ps tmp/1nfnr1413052708.png",intern=TRUE)) character(0) > try(system("convert tmp/2blxn1413052708.ps tmp/2blxn1413052708.png",intern=TRUE)) character(0) > try(system("convert tmp/3vyu41413052708.ps tmp/3vyu41413052708.png",intern=TRUE)) character(0) > try(system("convert tmp/47h2o1413052708.ps tmp/47h2o1413052708.png",intern=TRUE)) character(0) > try(system("convert tmp/5p0px1413052708.ps tmp/5p0px1413052708.png",intern=TRUE)) character(0) > try(system("convert tmp/6yom91413052708.ps tmp/6yom91413052708.png",intern=TRUE)) character(0) > try(system("convert tmp/7j8ey1413052708.ps tmp/7j8ey1413052708.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.405 0.406 2.842