R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(480,548,634,489,399,658,497,495,445,525,565,427,477,511,538,444,559,433,459,492,526,523,636,519,671,599,579,593,684,599,721,516,556,700,579,552,734,760,714,698,800,712,782,610,596,748,581,641,598,609,526,716,552,464,631,465,539,537,488,520,477,480,645,455,379,477,424,316,381,376,389,472) > 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] 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,] 480 477 671 734 598 477 NA [2,] 548 511 599 760 609 480 NA [3,] 634 538 579 714 526 645 NA [4,] 489 444 593 698 716 455 NA [5,] 399 559 684 800 552 379 NA [6,] 658 433 599 712 464 477 NA [7,] 497 459 721 782 631 424 NA [8,] 495 492 516 610 465 316 NA [9,] 445 526 556 596 539 381 NA [10,] 525 523 700 748 537 376 NA [11,] 565 636 579 581 488 389 NA [12,] 427 519 552 641 520 472 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 68 34 -72 26 11 3 NA [2,] 86 27 -20 -46 -83 165 NA [3,] -145 -94 14 -16 190 -190 NA [4,] -90 115 91 102 -164 -76 NA [5,] 259 -126 -85 -88 -88 98 NA [6,] -161 26 122 70 167 -53 NA [7,] -2 33 -205 -172 -166 -108 NA [8,] -50 34 40 -14 74 65 NA [9,] 80 -3 144 152 -2 -5 NA [10,] 40 113 -121 -167 -49 13 NA [11,] -138 -117 -27 60 32 83 NA [12,] 50 152 182 -43 -43 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/1bdfs1476867254.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/2nm581476867254.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/3d2uo1476867254.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/45nzi1476867254.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,] 477 480.0 526.0 444 379.0 433 424 465.0 381.0 376 389 427.0 [2,] 477 511.0 538.0 455 399.0 464 459 465.0 445.0 523 488 472.0 [3,] 539 573.5 606.5 541 555.5 538 564 493.5 532.5 531 572 519.5 [4,] 671 609.0 645.0 698 684.0 658 721 516.0 556.0 700 581 552.0 [5,] 734 609.0 714.0 716 800.0 712 782 516.0 596.0 748 636 641.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,] 413.8637 510.2868 537.4815 384.2572 371.6658 412.8637 395.0015 460.6034 [2,] 664.1363 636.7132 675.5185 697.7428 739.3342 663.1363 732.9985 526.3966 [,9] [,10] [,11] [,12] [1,] 460.9014 416.8293 512.012 467.8974 [2,] 604.0986 645.1707 631.988 571.1026 $out [1] 760 610 316 $group [1] 2 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(477, 477, 539, 671, 734, 480, 511, 573.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xnp71476867254.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.0 -83.0 -190 -164.0 -126.0 -161 -205 -50 -5 -167 -138.0 -43 [2,] 3.0 -46.0 -145 -90.0 -88.0 -53 -172 -14 -3 -121 -117.0 -43 [3,] 18.5 3.5 -55 7.5 -86.5 48 -137 37 39 -18 2.5 50 [4,] 34.0 86.0 14 102.0 98.0 122 -2 65 144 40 60.0 152 [5,] 68.0 165.0 190 115.0 259.0 167 33 74 152 113 83.0 182 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.496001 -81.64426 -157.56014 -116.3462 -206.47601 -64.88065 -246.65549 [2,] 38.496001 88.64426 47.56014 131.3462 33.47601 160.88065 -27.34451 [,8] [,9] [,10] [,11] [,12] [1,] -13.95755 -55.81975 -121.8502 -111.6707 -87.78651 [2,] 87.95755 133.81975 85.8502 116.6707 187.78651 $out [1] -72 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3, 3, 18.5, 34, 68, -83, -46, 3.5, 86, 165, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lp4t1476867254.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,] 399.0 433 516.0 581.0 464.0 316.0 NA [2,] 462.5 468 567.5 625.5 504.0 380.0 NA [3,] 496.0 515 596.0 713.0 538.0 439.5 NA [4,] 556.5 532 677.5 754.0 603.5 477.0 NA [5,] 658.0 559 721.0 800.0 716.0 480.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 453.126 485.8092 545.8283 654.3903 492.6174 395.2576 NA [2,] 538.874 544.1908 646.1717 771.6097 583.3826 483.7424 NA $out [1] 636 645 $group [1] 2 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(399, 462.5, 496, 556.5, 658, 433, 468, 515, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fojz1476867254.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,] 482.3333 493.50 491.2500 [2,] 530.7500 531.75 528.8750 [3,] 564.0000 540.00 559.3125 [4,] 578.6667 568.00 575.5625 [5,] 606.0000 606.50 595.2500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 542.1449 523.4661 538.018 [2,] 585.8551 556.5339 580.607 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(482.333333333333, 530.75, 564, 578.666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bdfs1476867254.ps tmp/1bdfs1476867254.png",intern=TRUE)) character(0) > try(system("convert tmp/2nm581476867254.ps tmp/2nm581476867254.png",intern=TRUE)) character(0) > try(system("convert tmp/3d2uo1476867254.ps tmp/3d2uo1476867254.png",intern=TRUE)) character(0) > try(system("convert tmp/45nzi1476867254.ps tmp/45nzi1476867254.png",intern=TRUE)) character(0) > try(system("convert tmp/5xnp71476867254.ps tmp/5xnp71476867254.png",intern=TRUE)) character(0) > try(system("convert tmp/6lp4t1476867254.ps tmp/6lp4t1476867254.png",intern=TRUE)) character(0) > try(system("convert tmp/7fojz1476867254.ps tmp/7fojz1476867254.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.742 0.192 2.983