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(630,720,740,720,720,690,790,760,840,840,640,840,590,770,750,590,730,740,770,660,830,900,630,770,640,700,760,500,740,740,680,580,780,990,630,780,630,780,730,490,710,700,740,520,730,1110,510,750,690,740,690,640,660,580,760,510,810,1050,510,740,690,800,670,670,640,540,740,600,860,1080,480,680,650,860,650,630,600,500,760,590,800,1120,520,710,600,880,700,590,680,530,730,600,880,1120,540,740,580,850,670,530,680,540,760,620,910,1230,530,720) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 630 590 640 630 690 690 650 600 580 NA [2,] 720 770 700 780 740 800 860 880 850 NA [3,] 740 750 760 730 690 670 650 700 670 NA [4,] 720 590 500 490 640 670 630 590 530 NA [5,] 720 730 740 710 660 640 600 680 680 NA [6,] 690 740 740 700 580 540 500 530 540 NA [7,] 790 770 680 740 760 740 760 730 760 NA [8,] 760 660 580 520 510 600 590 600 620 NA [9,] 840 830 780 730 810 860 800 880 910 NA [10,] 840 900 990 1110 1050 1080 1120 1120 1230 NA [11,] 640 630 630 510 510 480 520 540 530 NA [12,] 840 770 780 750 740 680 710 740 720 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 90 180 60 150 50 110 210 280 270 NA [2,] 20 -20 60 -50 -50 -130 -210 -180 -180 NA [3,] -20 -160 -260 -240 -50 0 -20 -110 -140 NA [4,] 0 140 240 220 20 -30 -30 90 150 NA [5,] -30 10 0 -10 -80 -100 -100 -150 -140 NA [6,] 100 30 -60 40 180 200 260 200 220 NA [7,] -30 -110 -100 -220 -250 -140 -170 -130 -140 NA [8,] 80 170 200 210 300 260 210 280 290 NA [9,] 0 70 210 380 240 220 320 240 320 NA [10,] -200 -270 -360 -600 -540 -600 -600 -580 -700 NA [11,] 200 140 150 240 230 200 190 200 190 NA [12,] -250 -130 -150 -60 -50 -30 -110 -160 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/1ejcz1471271696.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/2zpiy1471271696.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/35ces1471271696.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/4mh9q1471271696.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,] 580 700 650 490 600 500 730 520 730 840 480 680 [2,] 600 740 670 530 660 540 740 580 800 990 510 720 [3,] 630 780 700 590 680 580 760 600 830 1080 530 740 [4,] 650 850 740 640 720 700 760 620 860 1120 630 770 [5,] 690 880 760 720 740 740 790 660 910 1230 640 840 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 603.6667 722.0667 663.1333 532.0667 648.4 495.7333 749.4667 578.9333 798.4 [2,] 656.3333 837.9333 736.8667 647.9333 711.6 664.2667 770.5333 621.0667 861.6 [,10] [,11] [,12] [1,] 1011.533 466.8 713.6667 [2,] 1148.467 593.2 766.3333 $out [1] 680 760 510 $group [1] 7 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(580, 600, 630, 650, 690, 700, 740, 780, 850, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bffo1471271696.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,] 50 -210 -260 -30 -150 -60 -250 80 70 -700 190 -250 [2,] 90 -180 -160 0 -100 40 -170 200 210 -600 190 -155 [3,] 150 -50 -110 90 -80 180 -140 210 240 -580 200 -120 [4,] 210 -20 -20 150 -10 200 -110 280 320 -360 200 -55 [5,] 280 60 0 240 10 260 -30 300 380 -200 200 -30 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 86.8 -134.26667 -183.73333 11 -127.4 95.73333 -171.6 167.8667 182.0667 [2,] 213.2 34.26667 -36.26667 169 -32.6 264.26667 -108.4 252.1333 297.9333 [,10] [,11] [,12] [1,] -706.4 194.7333 -175.86144 [2,] -453.6 205.2667 -64.13856 $out [1] 0 140 150 240 230 $group [1] 9 11 11 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(50, 90, 150, 210, 280, -210, -180, -50, -20, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6p1s81471271696.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] [,9] [,10] [1,] 630 590 500 490 510 480 500 530 530 NA [2,] 705 645 635 575 610 620 595 595 560 NA [3,] 730 745 720 720 690 675 650 690 675 NA [4,] 815 770 770 745 750 770 780 810 805 NA [5,] 840 900 780 780 810 860 860 1120 910 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 679.8283 687.9867 658.4256 642.4619 626.1451 606.584 565.6203 591.9371 [2,] 780.1717 802.0133 781.5744 797.5381 753.8549 743.416 734.3797 788.0629 [,9] [,10] [1,] 563.2539 NA [2,] 786.7461 NA $out [1] 990 1110 1050 1080 1120 1230 $group [1] 3 4 5 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(630, 705, 730, 815, 840, 590, 645, 745, 770, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75n2f1471271696.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,] 554.4444 530 570.0 [2,] 611.1111 595 610.0 [3,] 695.5556 690 697.5 [4,] 768.3333 770 772.5 [5,] 826.6667 830 830.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 623.8454 610.1813 623.3827 [2,] 767.2657 769.8187 771.6173 $out [1] 1048.889 1080.000 1055.000 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1ejcz1471271696.ps tmp/1ejcz1471271696.png",intern=TRUE)) character(0) > try(system("convert tmp/2zpiy1471271696.ps tmp/2zpiy1471271696.png",intern=TRUE)) character(0) > try(system("convert tmp/35ces1471271696.ps tmp/35ces1471271696.png",intern=TRUE)) character(0) > try(system("convert tmp/4mh9q1471271696.ps tmp/4mh9q1471271696.png",intern=TRUE)) character(0) > try(system("convert tmp/5bffo1471271696.ps tmp/5bffo1471271696.png",intern=TRUE)) character(0) > try(system("convert tmp/6p1s81471271696.ps tmp/6p1s81471271696.png",intern=TRUE)) character(0) > try(system("convert tmp/75n2f1471271696.ps tmp/75n2f1471271696.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.542 0.252 2.841