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(540,520,550,440,570,560,600,620,690,600,570,710,600,450,530,400,560,460,610,550,580,650,640,760,550,460,510,370,530,410,580,550,490,700,630,720,540,500,450,370,490,440,600,580,500,670,620,800,640,390,390,390,460,460,620,570,510,640,590,850,670,390,410,340,470,540,680,670,540,630,560,800,610,490,440,330,490,590,690,650,480,690,540,830,690,500,460,310,490,470,710,710,540,700,520,810,690,510,390,270,530,510,670,770,570,640,480,830) > 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,] 540 600 550 540 640 670 610 690 690 NA [2,] 520 450 460 500 390 390 490 500 510 NA [3,] 550 530 510 450 390 410 440 460 390 NA [4,] 440 400 370 370 390 340 330 310 270 NA [5,] 570 560 530 490 460 470 490 490 530 NA [6,] 560 460 410 440 460 540 590 470 510 NA [7,] 600 610 580 600 620 680 690 710 670 NA [8,] 620 550 550 580 570 670 650 710 770 NA [9,] 690 580 490 500 510 540 480 540 570 NA [10,] 600 650 700 670 640 630 690 700 640 NA [11,] 570 640 630 620 590 560 540 520 480 NA [12,] 710 760 720 800 850 800 830 810 830 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -20 -150 -90 -40 -250 -280 -120 -190 -180 NA [2,] 30 80 50 -50 0 20 -50 -40 -120 NA [3,] -110 -130 -140 -80 0 -70 -110 -150 -120 NA [4,] 130 160 160 120 70 130 160 180 260 NA [5,] -10 -100 -120 -50 0 70 100 -20 -20 NA [6,] 40 150 170 160 160 140 100 240 160 NA [7,] 20 -60 -30 -20 -50 -10 -40 0 100 NA [8,] 70 30 -60 -80 -60 -130 -170 -170 -200 NA [9,] -90 70 210 170 130 90 210 160 70 NA [10,] -30 -10 -70 -50 -50 -70 -150 -180 -160 NA [11,] 140 120 90 180 260 240 290 290 350 NA [12,] -110 -210 -180 -160 -180 -190 -140 -120 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/1xqnp1471286863.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/24osj1471286863.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/3lg9t1471286863.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/446id1471286863.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,] 540 390 390 270 460 410 580 550 480 600 480 710 [2,] 550 450 410 330 490 460 600 570 500 640 540 760 [3,] 610 490 450 370 490 470 620 620 540 650 570 800 [4,] 670 500 510 390 530 540 680 670 570 690 620 830 [5,] 690 520 550 440 570 590 710 770 580 700 640 850 $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,] 546.8 463.6667 397.3333 338.4 468.9333 427.8667 577.8667 567.3333 503.1333 [2,] 673.2 516.3333 502.6667 401.6 511.0667 512.1333 662.1333 672.6667 576.8667 [,10] [,11] [,12] [1,] 623.6667 527.8667 763.1333 [2,] 676.3333 612.1333 836.8667 $out [1] 690 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(540, 550, 610, 670, 690, 390, 450, 490, 500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zqk91471286863.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,] -280 -120 -150 120 -120 140 -60 -200 70 -180 90 -210 [2,] -190 -50 -130 130 -50 140 -40 -170 70 -150 140 -185 [3,] -150 0 -110 160 -20 160 -20 -80 130 -70 240 -170 [4,] -90 30 -80 160 0 160 0 -60 170 -50 290 -130 [5,] -20 80 -70 180 70 170 20 70 210 -10 350 -110 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -202.66667 -42.13333 -136.33333 144.2 -46.333333 149.4667 -41.066667 [2,] -97.33333 42.13333 -83.66667 175.8 6.333333 170.5333 1.066667 [,8] [,9] [,10] [,11] [,12] [1,] -137.93333 77.33333 -122.66667 161 -200.7238 [2,] -22.06667 182.66667 -17.33333 319 -139.2762 $out [1] 0 70 260 100 40 100 240 100 -90 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-280, -190, -150, -90, -20, -120, -50, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67v7x1471286863.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,] 520 400 370 370 390 340 330 310 270 NA [2,] 545 495 475 470 425 440 485 480 495 NA [3,] 570 570 540 520 540 550 565 530 550 NA [4,] 610 625 605 610 630 670 670 705 680 NA [5,] 690 760 720 800 850 800 830 810 830 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 540.3531 510.7061 480.7061 456.1451 446.4981 445.0955 480.6203 427.376 [2,] 599.6469 629.2939 599.2939 583.8549 633.5019 654.9045 649.3797 632.624 [,9] [,10] [1,] 465.6203 NA [2,] 634.3797 NA $out [1] 440 710 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(520, 545, 570, 610, 690, 400, 495, 570, 625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qt4p1471286863.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,] 357.7778 370 360.0 [2,] 480.5556 480 487.5 [3,] 558.3333 555 557.5 [4,] 635.0000 620 630.0 [5,] 790.0000 800 795.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 487.8902 491.1451 492.5048 [2,] 628.7765 618.8549 622.4952 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1xqnp1471286863.ps tmp/1xqnp1471286863.png",intern=TRUE)) character(0) > try(system("convert tmp/24osj1471286863.ps tmp/24osj1471286863.png",intern=TRUE)) character(0) > try(system("convert tmp/3lg9t1471286863.ps tmp/3lg9t1471286863.png",intern=TRUE)) character(0) > try(system("convert tmp/446id1471286863.ps tmp/446id1471286863.png",intern=TRUE)) character(0) > try(system("convert tmp/5zqk91471286863.ps tmp/5zqk91471286863.png",intern=TRUE)) character(0) > try(system("convert tmp/67v7x1471286863.ps tmp/67v7x1471286863.png",intern=TRUE)) character(0) > try(system("convert tmp/7qt4p1471286863.ps tmp/7qt4p1471286863.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.452 0.232 2.729