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(473,475,552,530,525,548,487,483,550,528,560,546,521,507,596,520,590,568,503,515,529,573,590,529,524,516,598,532,582,573,535,538,554,590,607,529,563,562,593,588,576,558,543,494,585,586,553,541,506,500,570,541,544,545,552,460,526,569,549,525,473,498,582,573,528,571,518,483,551,562,580,515,492,509,601,579,561,537,513,499,563,561,546,558,507,517,544,529,557,532,512,488,518,567,537,484,487,484,534,514,523,489,495,468,513,544,520,509) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 473 521 524 563 506 473 492 507 487 NA [2,] 475 507 516 562 500 498 509 517 484 NA [3,] 552 596 598 593 570 582 601 544 534 NA [4,] 530 520 532 588 541 573 579 529 514 NA [5,] 525 590 582 576 544 528 561 557 523 NA [6,] 548 568 573 558 545 571 537 532 489 NA [7,] 487 503 535 543 552 518 513 512 495 NA [8,] 483 515 538 494 460 483 499 488 468 NA [9,] 550 529 554 585 526 551 563 518 513 NA [10,] 528 573 590 586 569 562 561 567 544 NA [11,] 560 590 607 553 549 580 546 537 520 NA [12,] 546 529 529 541 525 515 558 484 509 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 2 -14 -8 -1 -6 25 17 10 -3 NA [2,] 77 89 82 31 70 84 92 27 50 NA [3,] -22 -76 -66 -5 -29 -9 -22 -15 -20 NA [4,] -5 70 50 -12 3 -45 -18 28 9 NA [5,] 23 -22 -9 -18 1 43 -24 -25 -34 NA [6,] -61 -65 -38 -15 7 -53 -24 -20 6 NA [7,] -4 12 3 -49 -92 -35 -14 -24 -27 NA [8,] 67 14 16 91 66 68 64 30 45 NA [9,] -22 44 36 1 43 11 -2 49 31 NA [10,] 32 17 17 -33 -20 18 -15 -30 -24 NA [11,] -14 -61 -78 -12 -24 -65 12 -53 -11 NA [12,] -25 -5 34 -35 -52 -23 -51 3 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/19ygh1425381392.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/2qnrw1425381392.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/31mt81425381392.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/48vzb1425381392.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,] 473 475 534 514 523 532 487 460 513 544 520 484 [2,] 487 498 552 529 528 537 503 483 526 561 546 515 [3,] 506 507 582 532 557 548 513 488 550 567 553 529 [4,] 521 516 596 573 576 568 535 499 554 573 580 541 [5,] 563 517 601 588 590 573 552 515 585 590 607 558 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 488.0933 497.52 558.8267 508.8267 531.72 531.6733 496.1467 479.5733 [2,] 523.9067 516.48 605.1733 555.1733 582.28 564.3267 529.8533 496.4267 [,9] [,10] [,11] [,12] [1,] 535.2533 560.68 535.0933 515.3067 [2,] 564.7467 573.32 570.9067 542.6933 $out [1] 562 489 538 528 $group [1] 2 6 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(473, 487, 506, 521, 563, 475, 498, 507, 516, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5uwdg1425381392.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,] -14 27 -29 -45 -34 -65 -49 14 -22 -33 -78 -52 [2,] -6 50 -29 -12 -24 -53 -35 30 1 -24 -61 -43 [3,] -1 77 -22 3 -18 -24 -24 64 31 -15 -24 -24 [4,] 10 84 -15 28 1 -15 -4 67 43 17 -12 -1 [5,] 25 92 -5 70 23 7 12 91 49 32 12 34 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -9.426667 59.09333 -29.37333 -18.06667 -31.166667 -44.013333 -40.326667 [2,] 7.426667 94.90667 -14.62667 24.06667 -4.833333 -3.986667 -7.673333 [,8] [,9] [,10] [,11] [,12] [1,] 44.51333 8.88 -36.593333 -49.806667 -47.461803 [2,] 83.48667 53.12 6.593333 1.806667 -0.538197 $out [1] -76 -66 43 -92 $group [1] 3 3 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-14, -6, -1, 10, 25, 27, 50, 77, 84, 92, -29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w76y1425381392.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] [,8] [,9] [,10] [1,] 473 503.0 516.0 494.0 500.0 473.0 492 484.0 468.0 NA [2,] 485 517.5 530.5 548.0 515.5 506.5 511 509.5 488.0 NA [3,] 529 529.0 546.0 562.5 542.5 539.5 552 523.5 511.0 NA [4,] 549 581.5 586.0 585.5 550.5 572.0 562 540.5 521.5 NA [5,] 560 596.0 607.0 593.0 570.0 582.0 601 567.0 544.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 499.8092 499.8092 520.6861 545.396 526.5363 509.625 528.7386 509.3607 [2,] 558.1908 558.1908 571.3139 579.604 558.4637 569.375 575.2614 537.6393 [,9] [,10] [1,] 495.7204 NA [2,] 526.2796 NA $out [1] 460 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(473, 485, 529, 549, 560, 503, 517.5, 529, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wmym1425381392.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,] 492.0000 488 491.00 [2,] 512.5556 510 513.00 [3,] 544.1667 540 545.50 [4,] 557.1111 555 557.75 [5,] 574.4444 582 574.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 523.8446 519.4752 525.0892 [2,] 564.4888 560.5248 565.9108 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(492, 512.555555555556, 544.166666666667, 557.111111111111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19ygh1425381392.ps tmp/19ygh1425381392.png",intern=TRUE)) character(0) > try(system("convert tmp/2qnrw1425381392.ps tmp/2qnrw1425381392.png",intern=TRUE)) character(0) > try(system("convert tmp/31mt81425381392.ps tmp/31mt81425381392.png",intern=TRUE)) character(0) > try(system("convert tmp/48vzb1425381392.ps tmp/48vzb1425381392.png",intern=TRUE)) character(0) > try(system("convert tmp/5uwdg1425381392.ps tmp/5uwdg1425381392.png",intern=TRUE)) character(0) > try(system("convert tmp/6w76y1425381392.ps tmp/6w76y1425381392.png",intern=TRUE)) character(0) > try(system("convert tmp/7wmym1425381392.ps tmp/7wmym1425381392.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.535 0.419 2.981