R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(467,475,470,442,433,427,410,406,429,425,431,408,454,459,441,420,416,400,401,398,442,458,476,447,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) > 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] 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,] 467 454 511 615 716 NA [2,] 475 459 514 634 730 NA [3,] 470 441 513 645 717 NA [4,] 442 420 511 634 694 NA [5,] 433 416 498 630 670 NA [6,] 427 400 490 635 641 NA [7,] 410 401 495 642 626 NA [8,] 406 398 486 637 604 NA [9,] 429 442 530 675 630 NA [10,] 425 458 539 679 634 NA [11,] 431 476 555 676 635 NA [12,] 408 447 548 660 619 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 8 5 3 19 14 NA [2,] -5 -18 -1 11 -13 NA [3,] -28 -21 -2 -11 -23 NA [4,] -9 -4 -13 -4 -24 NA [5,] -6 -16 -8 5 -29 NA [6,] -17 1 5 7 -15 NA [7,] -4 -3 -9 -5 -22 NA [8,] 23 44 44 38 26 NA [9,] -4 16 9 4 4 NA [10,] 6 18 16 -3 1 NA [11,] -23 -29 -7 -16 -16 NA [12,] 46 64 67 56 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/119631445099843.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/2d26a1445099843.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/3o25u1445099843.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/45iel1445099843.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,] 454 459 441 420 416 400 401 398 429 425 431 408 [2,] 467 475 470 442 433 427 410 406 442 458 476 447 [3,] 511 514 513 511 498 490 495 486 530 539 555 548 [4,] 615 634 645 634 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,] 406.4236 401.651 389.3454 375.3333 358.8003 343.0277 342.3749 346.0937 [2,] 615.5764 626.349 636.6546 646.6667 637.1997 636.9723 647.6251 625.9063 [,9] [,10] [,11] [,12] [1,] 397.1597 414.6388 442.651 426.4652 [2,] 662.8403 663.3612 667.349 669.5348 $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(454, 467, 511, 615, 716, 459, 475, 514, 634, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57jxy1445099843.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,] 3 -18 -28 -24 -29 -17 -9 23 4 -3 -29 46.0 [2,] 5 -13 -23 -13 -16 -15 -9 26 4 1 -23 51.0 [3,] 8 -5 -21 -9 -8 1 -5 38 4 6 -16 60.0 [4,] 14 -1 -11 -4 -6 5 -4 44 9 16 -16 65.5 [5,] 19 11 -2 -4 5 7 -3 44 16 18 -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.640623 -13.47917 -29.47917 -15.359377 -15.0659748 -13.13195 -8.532987 [2,] 14.359377 3.47917 -12.52083 -2.640623 -0.9340252 15.13195 -1.467013 [,8] [,9] [,10] [,11] [,12] [1,] 25.28125 0.4670126 -4.598962 -20.94618 48.545 [2,] 50.71875 7.5329874 16.598962 -11.05382 71.455 $out [1] -22 -4 $group [1] 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3, 5, 8, 14, 19, -18, -13, -5, -1, 11, -28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zb9h1445099843.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,] 406.0 398.0 486.0 615.0 604 NA [2,] 417.5 408.5 496.5 634.0 628 NA [3,] 430.0 441.5 512.0 639.5 638 NA [4,] 454.5 456.0 534.5 667.5 705 NA [5,] 475.0 476.0 555.0 679.0 730 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 413.1241 419.8349 494.6679 624.2204 602.8798 NA [2,] 446.8759 463.1651 529.3321 654.7796 673.1202 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(406, 417.5, 430, 454.5, 475, 398, 408.5, 441.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tph61445099843.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,] 506.2 486.0 505.00 [2,] 524.0 496.5 531.25 [3,] 540.7 512.0 537.00 [4,] 553.6 534.5 550.25 [5,] 562.4 555.0 557.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 527.1992 494.6679 528.334 [2,] 554.2008 529.3321 545.666 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(506.2, 524, 540.7, 553.6, 562.4, 486, 496.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/119631445099843.ps tmp/119631445099843.png",intern=TRUE)) character(0) > try(system("convert tmp/2d26a1445099843.ps tmp/2d26a1445099843.png",intern=TRUE)) character(0) > try(system("convert tmp/3o25u1445099843.ps tmp/3o25u1445099843.png",intern=TRUE)) character(0) > try(system("convert tmp/45iel1445099843.ps tmp/45iel1445099843.png",intern=TRUE)) character(0) > try(system("convert tmp/57jxy1445099843.ps tmp/57jxy1445099843.png",intern=TRUE)) character(0) > try(system("convert tmp/6zb9h1445099843.ps tmp/6zb9h1445099843.png",intern=TRUE)) character(0) > try(system("convert tmp/7tph61445099843.ps tmp/7tph61445099843.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.465 0.456 2.929