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(876,819,610,757,840,745,662,563,624,588,754,705,661,737,542,709,787,689,601,467,555,471,718,676,700,781,596,779,727,692,560,517,572,491,639,585,596,617,445,615,571,592,580,487,540,546,649,620,593,528,492,570,592,512,475,405,540,472,567,538,508,578,466,540,515,550,485,355,386,365,417,356) > 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,] 876 661 700 596 593 508 NA [2,] 819 737 781 617 528 578 NA [3,] 610 542 596 445 492 466 NA [4,] 757 709 779 615 570 540 NA [5,] 840 787 727 571 592 515 NA [6,] 745 689 692 592 512 550 NA [7,] 662 601 560 580 475 485 NA [8,] 563 467 517 487 405 355 NA [9,] 624 555 572 540 540 386 NA [10,] 588 471 491 546 472 365 NA [11,] 754 718 639 649 567 417 NA [12,] 705 676 585 620 538 356 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -57 76 81 21 -65 70 NA [2,] -209 -195 -185 -172 -36 -112 NA [3,] 147 167 183 170 78 74 NA [4,] 83 78 -52 -44 22 -25 NA [5,] -95 -98 -35 21 -80 35 NA [6,] -83 -88 -132 -12 -37 -65 NA [7,] -99 -134 -43 -93 -70 -130 NA [8,] 61 88 55 53 135 31 NA [9,] -36 -84 -81 6 -68 -21 NA [10,] 166 247 148 103 95 52 NA [11,] -49 -42 -54 -29 -29 -61 NA [12,] -44 24 11 -27 -30 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/1hczc1413534444.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/2g9nk1413534444.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/33cw81413534444.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/48ctw1413534444.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,] 508.0 528 445 540 515.0 512.0 475 355 540.0 365.0 417 356.0 [2,] 593.0 578 466 570 571.0 550.0 485 405 540.0 471.0 567 538.0 [3,] 628.5 677 517 662 659.5 640.5 570 477 547.5 481.5 644 602.5 [4,] 700.0 781 596 757 787.0 692.0 601 517 572.0 546.0 718 676.0 [5,] 700.0 819 610 779 840.0 745.0 662 563 572.0 588.0 754 705.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 559.4815 546.0584 433.1458 541.379 520.173 548.9054 495.1763 404.7564 [2,] 697.5185 807.9416 600.8542 782.621 798.827 732.0946 644.8237 549.2436 [,9] [,10] [,11] [,12] [1,] 526.859 433.1226 546.6001 513.4855 [2,] 568.141 529.8774 741.3999 691.5145 $out [1] 876 624 386 $group [1] 1 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(508, 593, 628.5, 700, 700, 528, 578, 677, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59tjc1413534444.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,] -65.0 -209.0 74 -52.0 -98.0 -132 -134 31 -84 52.0 -61.0 -44 [2,] -57.0 -195.0 78 -44.0 -95.0 -88 -130 53 -81 95.0 -54.0 -30 [3,] 45.5 -178.5 157 -1.5 -57.5 -74 -96 58 -52 125.5 -45.5 -27 [4,] 76.0 -112.0 170 78.0 21.0 -37 -70 88 -21 166.0 -29.0 11 [5,] 81.0 -36.0 183 83.0 35.0 -12 -43 135 6 247.0 -29.0 24 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -40.2893 -232.0377 97.65703 -80.19394 -132.32375 -106.89665 -134.70194 [2,] 131.2893 -124.9623 216.34297 77.19394 17.32375 -41.10335 -57.29806 [,8] [,9] [,10] [,11] [,12] [1,] 35.42387 -90.70194 79.70271 -61.62581 -55.970497 [2,] 80.57613 -13.29806 171.29729 -29.37419 1.970497 $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(-65, -57, 45.5, 76, 81, -209, -195, -178.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rux61413534444.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,] 563 467.0 491.0 445 405.0 355.0 NA [2,] 617 548.5 566.0 543 483.5 375.5 NA [3,] 725 668.5 617.5 586 533.0 475.5 NA [4,] 788 713.5 713.5 616 568.5 527.5 NA [5,] 876 787.0 781.0 649 593.0 578.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 647.0058 593.2424 550.2243 552.7042 494.2309 406.1718 NA [2,] 802.9942 743.7576 684.7757 619.2958 571.7691 544.8282 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(563, 617, 725, 788, 876, 467, 548.5, 668.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/776tr1413534444.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,] 465.6667 477.00 465.000 [2,] 530.6667 532.25 538.625 [3,] 602.0000 615.50 615.875 [4,] 658.6667 651.75 653.000 [5,] 676.6667 677.00 678.875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 543.6183 560.9952 563.7078 [2,] 660.3817 670.0048 668.0422 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(465.666666666667, 530.666666666667, 602, 658.666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hczc1413534444.ps tmp/1hczc1413534444.png",intern=TRUE)) character(0) > try(system("convert tmp/2g9nk1413534444.ps tmp/2g9nk1413534444.png",intern=TRUE)) character(0) > try(system("convert tmp/33cw81413534444.ps tmp/33cw81413534444.png",intern=TRUE)) character(0) > try(system("convert tmp/48ctw1413534444.ps tmp/48ctw1413534444.png",intern=TRUE)) character(0) > try(system("convert tmp/59tjc1413534444.ps tmp/59tjc1413534444.png",intern=TRUE)) character(0) > try(system("convert tmp/6rux61413534444.ps tmp/6rux61413534444.png",intern=TRUE)) character(0) > try(system("convert tmp/776tr1413534444.ps tmp/776tr1413534444.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.448 0.489 2.961