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(615,680,680,625,710,695,640,665,700,685,645,750,630,680,660,650,720,680,665,710,755,640,655,730,640,685,695,695,730,705,615,630,795,625,700,725,610,645,700,700,730,725,635,630,775,615,690,745,590,595,700,690,755,700,645,600,800,610,690,725,630,565,695,690,785,660,605,595,790,575,665,710,630,520,725,680,750,620,630,610,840,605,675,740,635,520,725,655,755,580,645,615,840,595,655,740,660,525,690,660,740,575,625,630,840,575,655,735) > 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,] 615 630 640 610 590 630 630 635 660 NA [2,] 680 680 685 645 595 565 520 520 525 NA [3,] 680 660 695 700 700 695 725 725 690 NA [4,] 625 650 695 700 690 690 680 655 660 NA [5,] 710 720 730 730 755 785 750 755 740 NA [6,] 695 680 705 725 700 660 620 580 575 NA [7,] 640 665 615 635 645 605 630 645 625 NA [8,] 665 710 630 630 600 595 610 615 630 NA [9,] 700 755 795 775 800 790 840 840 840 NA [10,] 685 640 625 615 610 575 605 595 575 NA [11,] 645 655 700 690 690 665 675 655 655 NA [12,] 750 730 725 745 725 710 740 740 735 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 65 50 45 35 5 -65 -110 -115 -135 NA [2,] 0 -20 10 55 105 130 205 205 165 NA [3,] -55 -10 0 0 -10 -5 -45 -70 -30 NA [4,] 85 70 35 30 65 95 70 100 80 NA [5,] -15 -40 -25 -5 -55 -125 -130 -175 -165 NA [6,] -55 -15 -90 -90 -55 -55 10 65 50 NA [7,] 25 45 15 -5 -45 -10 -20 -30 5 NA [8,] 35 45 165 145 200 195 230 225 210 NA [9,] -15 -115 -170 -160 -190 -215 -235 -245 -265 NA [10,] -40 15 75 75 80 90 70 60 80 NA [11,] 105 75 25 55 35 45 65 85 80 NA [12,] -120 -90 -115 -155 -95 -80 -105 -80 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/1bw3o1470867001.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/2neye1470867001.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/3nj5g1470867001.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/49l6s1470867001.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,] 590 520 680 625 710 575 605 595 700 575 645 710 [2,] 615 525 690 655 730 620 625 610 775 595 655 725 [3,] 630 595 695 680 740 680 635 630 795 610 665 735 [4,] 635 680 700 690 755 700 645 630 840 625 690 740 [5,] 660 685 700 700 785 725 665 630 840 640 700 750 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 619.4667 513.3667 689.7333 661.5667 726.8333 637.8667 624.4667 619.4667 [2,] 640.5333 676.6333 700.2667 698.4333 753.1667 722.1333 645.5333 640.5333 [,9] [,10] [,11] [,12] [1,] 760.7667 594.2 646.5667 727.1 [2,] 829.2333 625.8 683.4333 742.9 $out [1] 660 725 725 665 710 685 $group [1] 3 3 3 8 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(590, 615, 630, 635, 660, 520, 525, 595, 680, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58jy61470867001.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,] -135 -20 -70 35 -175 -90 -45 145 -265 60 25 -155.0 [2,] -110 10 -45 65 -130 -55 -20 145 -235 60 45 -117.5 [3,] 5 105 -10 70 -55 -55 -5 195 -190 75 65 -100.0 [4,] 45 165 -5 85 -25 10 15 210 -160 80 80 -85.0 [5,] 65 205 0 100 -5 65 45 230 -115 90 105 -80.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -76.63333 23.36667 -31.06667 59.46667 -110.3 -89.23333 -23.43333 160.7667 [2,] 86.63333 186.63333 11.06667 80.53333 0.3 -20.76667 13.43333 229.2333 [,9] [,10] [,11] [,12] [1,] -229.5 64.46667 46.56667 -118.15497 [2,] -150.5 85.53333 83.43333 -81.84503 $out [1] 30 35 45 -15 -40 15 $group [1] 4 8 8 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-135, -110, 5, 45, 65, -20, 10, 105, 165, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ernb1470867001.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,] 615.0 630.0 615 610.0 590.0 565.0 520.0 520.0 525.0 NA [2,] 642.5 652.5 635 632.5 605.0 600.0 615.0 605.0 600.0 NA [3,] 680.0 672.5 695 695.0 690.0 662.5 652.5 650.0 657.5 NA [4,] 697.5 715.0 715 727.5 712.5 702.5 732.5 732.5 712.5 NA [5,] 750.0 755.0 795 775.0 800.0 790.0 840.0 840.0 840.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 654.9141 643.9933 658.5115 651.6699 640.9685 615.7491 598.9075 591.8464 [2,] 705.0859 701.0067 731.4885 738.3301 739.0315 709.2509 706.0925 708.1536 [,9] [,10] [1,] 606.188 NA [2,] 708.812 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(615, 642.5, 680, 697.5, 750, 630, 652.5, 672.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7whon1470867001.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,] 601.6667 595.0 602.50 [2,] 629.1667 630.0 622.50 [3,] 665.0000 672.5 666.25 [4,] 715.0000 715.0 713.75 [5,] 792.7778 795.0 807.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 625.8508 633.7309 624.6303 [2,] 704.1492 711.2691 707.8697 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(601.666666666667, 629.166666666667, 665, 715, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bw3o1470867001.ps tmp/1bw3o1470867001.png",intern=TRUE)) character(0) > try(system("convert tmp/2neye1470867001.ps tmp/2neye1470867001.png",intern=TRUE)) character(0) > try(system("convert tmp/3nj5g1470867001.ps tmp/3nj5g1470867001.png",intern=TRUE)) character(0) > try(system("convert tmp/49l6s1470867001.ps tmp/49l6s1470867001.png",intern=TRUE)) character(0) > try(system("convert tmp/58jy61470867001.ps tmp/58jy61470867001.png",intern=TRUE)) character(0) > try(system("convert tmp/6ernb1470867001.ps tmp/6ernb1470867001.png",intern=TRUE)) character(0) > try(system("convert tmp/7whon1470867001.ps tmp/7whon1470867001.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.892 0.275 3.255