R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(511,514,513,511,498,490,495,486,530,539,555,548,615,634,645,634,630,635,642,637,675,679,676,660,716,730,717,694,670,641,626,604,630,634,635,619,674,664,653,635,614,595,580,570,608,617,591,565,603,612,599,587,557,528,517,484,514,510,495,458) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 511 615 716 674 603 NA [2,] 514 634 730 664 612 NA [3,] 513 645 717 653 599 NA [4,] 511 634 694 635 587 NA [5,] 498 630 670 614 557 NA [6,] 490 635 641 595 528 NA [7,] 495 642 626 580 517 NA [8,] 486 637 604 570 484 NA [9,] 530 675 630 608 514 NA [10,] 539 679 634 617 510 NA [11,] 555 676 635 591 495 NA [12,] 548 660 619 565 458 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3 19 14 -10 9 NA [2,] -1 11 -13 -11 -13 NA [3,] -2 -11 -23 -18 -12 NA [4,] -13 -4 -24 -21 -30 NA [5,] -8 5 -29 -19 -29 NA [6,] 5 7 -15 -15 -11 NA [7,] -9 -5 -22 -10 -33 NA [8,] 44 38 26 38 30 NA [9,] 9 4 4 9 -4 NA [10,] 16 -3 1 -26 -15 NA [11,] -7 -16 -16 -26 -37 NA [12,] 67 56 55 38 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/1k9yk1495118847.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/297ld1495118847.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/3vypd1495118847.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/4lykl1495118847.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,] 511 612 599 587 498 490 495 484 514 510 495 458 [2,] 603 612 599 587 557 528 517 486 530 539 555 548 [3,] 615 634 645 634 614 595 580 570 608 617 591 565 [4,] 674 664 653 635 630 635 626 604 630 634 635 619 [5,] 716 730 717 694 670 641 642 637 675 679 676 660 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 564.8316 597.2569 606.8437 600.0833 562.4184 519.3941 502.9809 486.6215 [2,] 665.1684 670.7431 683.1563 667.9167 665.5816 670.6059 657.0191 653.3785 [,9] [,10] [,11] [,12] [1,] 537.3403 549.8732 534.4722 514.8316 [2,] 678.6597 684.1268 647.5278 615.1684 $out [1] 514 513 511 $group [1] 2 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(511, 603, 615, 674, 716, 612, 612, 634, 664, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55zr01495118847.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,] -10 -13 -23 -30 -29 -15 -33 26 4 -26 -37 38.0 [2,] 3 -13 -18 -24 -29 -15 -22 30 4 -15 -26 46.5 [3,] 9 -11 -12 -21 -19 -11 -10 38 4 -3 -16 55.5 [4,] 14 -1 -11 -13 -8 5 -9 38 9 1 -16 61.5 [5,] 19 11 -2 -4 5 7 -5 44 9 16 -7 67.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.227428 -19.47917 -16.946182 -28.77257 -33.838547 -25.13195 -19.1857673 [2,] 16.772572 -2.52083 -7.053818 -13.22743 -4.161453 3.13195 -0.8142327 [,8] [,9] [,10] [,11] [,12] [1,] 32.34722 0.4670126 -14.30556 -23.065975 43.65 [2,] 43.65278 7.5329874 8.30556 -8.934025 67.35 $out [1] -4 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-10, 3, 9, 14, 19, -13, -13, -11, -1, 11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/636wd1495118847.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] [1,] 486.0 615.0 604 565.0 458.0 NA [2,] 496.5 634.0 628 585.5 502.5 NA [3,] 512.0 639.5 638 611.0 522.5 NA [4,] 534.5 667.5 705 644.0 593.0 NA [5,] 555.0 679.0 730 674.0 612.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 494.6679 624.2204 602.8798 584.3178 481.2223 NA [2,] 529.3321 654.7796 673.1202 637.6822 563.7777 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(486, 496.5, 512, 534.5, 555, 615, 634, 639.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kaum1495118847.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,] 556.2 565.0 545.00 [2,] 574.9 585.5 580.75 [3,] 592.6 611.0 590.00 [4,] 618.0 625.5 618.50 [5,] 630.8 645.0 638.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 572.9418 592.7557 572.782 [2,] 612.2582 629.2443 607.218 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(556.2, 574.9, 592.6, 618, 630.8, 565, 585.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1k9yk1495118847.ps tmp/1k9yk1495118847.png",intern=TRUE)) character(0) > try(system("convert tmp/297ld1495118847.ps tmp/297ld1495118847.png",intern=TRUE)) character(0) > try(system("convert tmp/3vypd1495118847.ps tmp/3vypd1495118847.png",intern=TRUE)) character(0) > try(system("convert tmp/4lykl1495118847.ps tmp/4lykl1495118847.png",intern=TRUE)) character(0) > try(system("convert tmp/55zr01495118847.ps tmp/55zr01495118847.png",intern=TRUE)) character(0) > try(system("convert tmp/636wd1495118847.ps tmp/636wd1495118847.png",intern=TRUE)) character(0) > try(system("convert tmp/7kaum1495118847.ps tmp/7kaum1495118847.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.685 0.429 4.243