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(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,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] 84 > (np <- floor(n / par1)) [1] 7 > 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 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 561 517 528 580 556 562 578 NA [2,] 549 508 533 575 548 559 572 NA [3,] 532 493 536 563 540 546 565 NA [4,] 526 490 537 552 531 536 561 NA [5,] 511 469 524 537 521 528 551 NA [6,] 499 478 536 545 519 530 553 NA [7,] 555 528 587 601 572 582 611 NA [8,] 565 534 597 604 581 599 622 NA [9,] 542 518 581 586 563 584 613 NA [10,] 527 506 564 564 548 571 599 NA [11,] 510 502 558 549 539 563 591 NA [12,] 514 516 575 551 541 565 596 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -12 -9 5 -5 -8 -3 -6 NA [2,] -17 -15 3 -12 -8 -13 -7 NA [3,] -6 -3 1 -11 -9 -10 -4 NA [4,] -15 -21 -13 -15 -10 -8 -10 NA [5,] -12 9 12 8 -2 2 2 NA [6,] 56 50 51 56 53 52 58 NA [7,] 10 6 10 3 9 17 11 NA [8,] -23 -16 -16 -18 -18 -15 -9 NA [9,] -15 -12 -17 -22 -15 -13 -14 NA [10,] -17 -4 -6 -15 -9 -8 -8 NA [11,] 4 14 17 2 2 2 5 NA [12,] 3 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/1h4q71413754174.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/20zwv1413754174.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/3f9mn1413754174.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/49zpx1413754174.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 532.0 526.0 511.0 478.0 528.0 534.0 518.0 506.0 502.0 514.0 [2,] 542 540.5 534.0 528.5 516.0 509.0 563.5 573.0 552.5 537.5 524.5 528.5 [3,] 561 549.0 540.0 536.0 524.0 530.0 582.0 597.0 581.0 564.0 549.0 551.0 [4,] 570 565.5 554.5 544.5 532.5 540.5 594.0 601.5 585.0 567.5 560.5 570.0 [5,] 580 575.0 565.0 561.0 551.0 553.0 611.0 622.0 613.0 599.0 591.0 596.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 544.2789 534.0704 527.7577 526.4451 514.1465 511.1887 563.7859 579.9803 [2,] 577.7211 563.9296 552.2423 545.5549 533.8535 548.8113 600.2141 614.0197 [,9] [,10] [,11] [,12] [1,] 561.5915 546.0845 527.5014 526.2169 [2,] 600.4085 581.9155 570.4986 575.7831 $out [1] 493 490 469 $group [1] 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(517, 542, 561, 570, 580, 508, 540.5, 549, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5r2kb1413754174.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,] -12.0 -17.0 -11.0 -21 -12.0 50.0 3.0 -18.0 -17.0 -17 2.0 3.0 [2,] -8.5 -14.0 -9.5 -15 0.0 51.5 7.5 -18.0 -16.0 -12 2.0 5.0 [3,] -6.0 -12.0 -6.0 -13 2.0 53.0 10.0 -16.0 -15.0 -8 4.0 8.5 [4,] -4.0 -7.5 -3.5 -10 8.5 56.0 10.5 -15.5 -13.5 -7 9.5 13.0 [5,] -3.0 -7.0 1.0 -8 12.0 58.0 11.0 -15.0 -12.0 -4 17.0 21.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8.687327 -15.881695 -9.583103 -15.98592 -3.076063 50.31267 8.208448 [2,] -3.312673 -8.118305 -2.416897 -10.01408 7.076063 55.68733 11.791552 [,8] [,9] [,10] [,11] [,12] [1,] -17.49296 -16.49296 -10.985919 -0.478879 3.339742 [2,] -14.50704 -13.50704 -5.014081 8.478879 13.660258 $out [1] 5 3 17 -23 -9 -22 $group [1] 1 2 7 8 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-12, -8.5, -6, -4, -3, -17, -14, -12, -7.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dd6y1413754174.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] [1,] 499.0 469.0 524.0 537.0 519.0 528.0 551.0 NA [2,] 512.5 491.5 534.5 550.0 535.0 541.0 563.0 NA [3,] 529.5 507.0 547.5 563.5 544.5 562.5 584.5 NA [4,] 552.0 517.5 578.0 583.0 559.5 576.5 605.0 NA [5,] 565.0 534.0 597.0 604.0 581.0 599.0 622.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 511.4838 495.1412 527.6594 548.4485 533.3254 546.3082 565.3435 NA [2,] 547.5162 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" "7" NA Warning message: In bxp(list(stats = c(499, 512.5, 529.5, 552, 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/7s3q41413754174.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,] 520.1429 524.0 524.250 [2,] 536.2857 538.0 539.500 [3,] 550.1429 550.0 550.875 [4,] 562.0714 572.5 562.375 [5,] 586.0000 597.0 587.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 538.3818 534.2643 540.4416 [2,] 561.9039 565.7357 561.3084 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(520.142857142857, 536.285714285714, 550.142857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h4q71413754174.ps tmp/1h4q71413754174.png",intern=TRUE)) character(0) > try(system("convert tmp/20zwv1413754174.ps tmp/20zwv1413754174.png",intern=TRUE)) character(0) > try(system("convert tmp/3f9mn1413754174.ps tmp/3f9mn1413754174.png",intern=TRUE)) character(0) > try(system("convert tmp/49zpx1413754174.ps tmp/49zpx1413754174.png",intern=TRUE)) character(0) > try(system("convert tmp/5r2kb1413754174.ps tmp/5r2kb1413754174.png",intern=TRUE)) character(0) > try(system("convert tmp/6dd6y1413754174.ps tmp/6dd6y1413754174.png",intern=TRUE)) character(0) > try(system("convert tmp/7s3q41413754174.ps tmp/7s3q41413754174.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.409 0.398 2.847