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(662,670,659,663,673,699,712,700,692,699,700,702,693,696,696,694,695,715,731,715,707,712,699,703,695,694,691,694,699,720,732,712,705,707,700,687,674,676,666,669,669,688,705,684,679,689,691,685,690,685,688,696,693,721,726,704,700,707,696,687) > 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,] 662 693 695 674 690 NA [2,] 670 696 694 676 685 NA [3,] 659 696 691 666 688 NA [4,] 663 694 694 669 696 NA [5,] 673 695 699 669 693 NA [6,] 699 715 720 688 721 NA [7,] 712 731 732 705 726 NA [8,] 700 715 712 684 704 NA [9,] 692 707 705 679 700 NA [10,] 699 712 707 689 707 NA [11,] 700 699 700 691 696 NA [12,] 702 703 687 685 687 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 8 3 -1 2 -5 NA [2,] -11 0 -3 -10 3 NA [3,] 4 -2 3 3 8 NA [4,] 10 1 5 0 -3 NA [5,] 26 20 21 19 28 NA [6,] 13 16 12 17 5 NA [7,] -12 -16 -20 -21 -22 NA [8,] -8 -8 -7 -5 -4 NA [9,] 7 5 2 10 7 NA [10,] 1 -13 -7 2 -11 NA [11,] 2 4 -13 -6 -9 NA [12,] -9 -8 -13 5 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/1r2u71476294994.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/25pas1476294994.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/3u85k1476294994.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/492301476294994.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,] 662 670 659 663 669 688 705 684 679 689 691 685 [2,] 674 676 666 669 673 699 712 700 692 699 696 687 [3,] 690 685 688 694 693 715 726 704 700 707 699 687 [4,] 693 694 691 694 695 720 731 712 705 707 700 702 [5,] 695 696 696 696 699 721 732 715 707 712 700 703 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 676.5746 672.2812 670.3351 676.3351 677.4549 700.1615 712.5746 695.5208 [2,] 703.4254 697.7188 705.6649 711.6649 708.5451 729.8385 739.4254 712.4792 [,9] [,10] [,11] [,12] [1,] 690.8142 701.3472 696.1736 676.401 [2,] 709.1858 712.6528 701.8264 697.599 $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(662, 674, 690, 693, 695, 670, 676, 685, 694, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xlvi1476294994.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,] -5 -11 3 -3 19 12 -22 -8 2 -13 -13 -13.0 [2,] -1 -10 3 0 20 12 -21 -8 5 -11 -9 -11.0 [3,] 2 -3 3 1 21 13 -20 -7 7 -7 -6 -8.5 [4,] 3 0 4 5 26 16 -16 -5 7 1 2 -1.5 [5,] 8 3 4 10 28 17 -12 -4 10 2 4 5.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.8263899 -10.065975 2.293403 -2.532987 16.76042 10.17361 -23.53299 [2,] 4.8263899 4.065975 3.706597 4.532987 25.23958 15.82639 -16.46701 [,8] [,9] [,10] [,11] [,12] [1,] -9.119792 5.586805 -15.47917 -13.772572 -16.005 [2,] -4.880208 8.413195 1.47917 1.772572 -0.995 $out [1] -2 8 5 $group [1] 3 3 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-5, -1, 2, 3, 8, -11, -10, -3, 0, 3, 3, 3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6a9eg1476294994.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,] 659.0 693.0 687.0 666.0 685.0 NA [2,] 666.5 695.5 694.0 671.5 689.0 NA [3,] 695.5 701.0 699.5 681.5 696.0 NA [4,] 700.0 713.5 709.5 688.5 705.5 NA [5,] 712.0 731.0 732.0 705.0 726.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 680.2204 692.7901 692.4303 673.7462 688.4742 NA [2,] 710.7796 709.2099 706.5697 689.2538 703.5258 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(659, 666.5, 695.5, 700, 712, 693, 695.5, 701, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7o2mh1476294994.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,] 680.0 685.0 678.50 [2,] 683.7 689.0 683.75 [3,] 694.7 696.5 696.25 [4,] 702.9 705.5 704.50 [5,] 721.2 726.0 721.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 685.9428 688.9742 686.7858 [2,] 703.4572 704.0258 705.7142 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(680, 683.7, 694.7, 702.9, 721.2, 685, 689, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r2u71476294994.ps tmp/1r2u71476294994.png",intern=TRUE)) character(0) > try(system("convert tmp/25pas1476294994.ps tmp/25pas1476294994.png",intern=TRUE)) character(0) > try(system("convert tmp/3u85k1476294994.ps tmp/3u85k1476294994.png",intern=TRUE)) character(0) > try(system("convert tmp/492301476294994.ps tmp/492301476294994.png",intern=TRUE)) character(0) > try(system("convert tmp/5xlvi1476294994.ps tmp/5xlvi1476294994.png",intern=TRUE)) character(0) > try(system("convert tmp/6a9eg1476294994.ps tmp/6a9eg1476294994.png",intern=TRUE)) character(0) > try(system("convert tmp/7o2mh1476294994.ps tmp/7o2mh1476294994.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.462 0.169 2.680