R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(770,710,890,730,790,820,810,810,760,840,830,890,800,710,850,790,800,840,850,810,760,860,860,880,770,740,850,790,860,820,900,800,660,820,850,850,760,730,770,880,890,790,930,770,680,810,870,850,820,740,800,920,970,780,880,750,620,760,930,820,900,700,810,970,820,740,930,720,580,800,910,810,890,710,830,900,830,680,980,690,530,740,930,770,870,660,770,900,830,660,1000,710,460,740,940,870,810,650,760,950,870,670,960,750,480,690,850,890) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (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,] 770 800 770 760 820 900 890 870 810 NA [2,] 710 710 740 730 740 700 710 660 650 NA [3,] 890 850 850 770 800 810 830 770 760 NA [4,] 730 790 790 880 920 970 900 900 950 NA [5,] 790 800 860 890 970 820 830 830 870 NA [6,] 820 840 820 790 780 740 680 660 670 NA [7,] 810 850 900 930 880 930 980 1000 960 NA [8,] 810 810 800 770 750 720 690 710 750 NA [9,] 760 760 660 680 620 580 530 460 480 NA [10,] 840 860 820 810 760 800 740 740 690 NA [11,] 830 860 850 870 930 910 930 940 850 NA [12,] 890 880 850 850 820 810 770 870 890 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -60 -90 -30 -30 -80 -200 -180 -210 -160 NA [2,] 180 140 110 40 60 110 120 110 110 NA [3,] -160 -60 -60 110 120 160 70 130 190 NA [4,] 60 10 70 10 50 -150 -70 -70 -80 NA [5,] 30 40 -40 -100 -190 -80 -150 -170 -200 NA [6,] -10 10 80 140 100 190 300 340 290 NA [7,] 0 -40 -100 -160 -130 -210 -290 -290 -210 NA [8,] -50 -50 -140 -90 -130 -140 -160 -250 -270 NA [9,] 80 100 160 130 140 220 210 280 210 NA [10,] -10 0 30 60 170 110 190 200 160 NA [11,] 60 20 0 -20 -110 -100 -160 -70 40 NA [12,] -90 -110 -90 -30 80 80 100 -60 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/1fspz1408360742.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/2avza1408360742.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/3cur01408360742.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/49wqa1408360742.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,] 760 660 760 730 790 660 810 690 460 690 830 770 [2,] 770 700 770 790 820 680 880 720 530 740 850 820 [3,] 810 710 810 900 830 780 930 750 620 800 870 850 [4,] 870 730 850 920 870 820 960 800 680 820 930 880 [5,] 900 740 890 970 890 840 1000 810 760 860 940 890 $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,] 757.3333 694.2 767.8667 831.5333 803.6667 706.2667 887.8667 707.8667 541 [2,] 862.6667 725.8 852.1333 968.4667 856.3333 853.7333 972.1333 792.1333 699 [,10] [,11] [,12] [1,] 757.8667 827.8667 818.4 [2,] 842.1333 912.1333 881.6 $out [1] 650 970 $group [1] 2 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(760, 770, 810, 870, 900, 660, 700, 710, 730, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5m79l1408360742.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,] -210 110 -160 -150 -200 -10 -290 -250 80 -10 -160 -110 [2,] -180 110 -60 -70 -170 80 -210 -160 130 30 -100 -90 [3,] -90 110 110 10 -100 140 -160 -140 160 110 -20 -45 [4,] -60 120 130 50 -40 290 -100 -90 210 170 20 80 [5,] -30 120 190 70 40 340 0 -50 280 200 60 100 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -153.2 104.7333 9.933333 -53.2 -168.46667 29.4 -217.9333 -176.8667 [2,] -26.8 115.2667 210.066667 73.2 -31.53333 250.6 -102.0667 -103.1333 [,9] [,10] [,11] [,12] [1,] 117.8667 36.26667 -83.2 -139.96444 [2,] 202.1333 183.73333 43.2 49.96444 $out [1] 180 140 40 60 -270 $group [1] 2 2 2 2 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-210, -180, -90, -60, -30, 110, 110, 110, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m8eu1408360742.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,] 710 710 740 680 620 580 530 460 480 NA [2,] 765 795 780 765 755 730 700 685 680 NA [3,] 810 825 820 800 810 810 800 800 785 NA [4,] 835 855 850 875 900 905 895 885 880 NA [5,] 890 880 900 930 970 970 980 1000 960 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 778.0725 797.6336 788.0725 749.8283 743.8645 730.1813 711.0592 708.7787 [2,] 841.9275 852.3664 851.9275 850.1717 876.1355 889.8187 888.9408 891.2213 [,9] [,10] [1,] 693.7787 NA [2,] 876.2213 NA $out [1] 660 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(710, 765, 810, 835, 890, 710, 795, 825, 855, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7icon1408360742.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,] 614.4444 710 715.0 [2,] 756.1111 765 755.0 [3,] 817.7778 810 815.0 [4,] 860.5556 860 852.5 [5,] 915.5556 930 920.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 770.1400 766.6699 770.5296 [2,] 865.4156 853.3301 859.4704 $out [1] 620 605 $group [1] 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(614.444444444444, 756.111111111111, 817.777777777778, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fspz1408360742.ps tmp/1fspz1408360742.png",intern=TRUE)) character(0) > try(system("convert tmp/2avza1408360742.ps tmp/2avza1408360742.png",intern=TRUE)) character(0) > try(system("convert tmp/3cur01408360742.ps tmp/3cur01408360742.png",intern=TRUE)) character(0) > try(system("convert tmp/49wqa1408360742.ps tmp/49wqa1408360742.png",intern=TRUE)) character(0) > try(system("convert tmp/5m79l1408360742.ps tmp/5m79l1408360742.png",intern=TRUE)) character(0) > try(system("convert tmp/6m8eu1408360742.ps tmp/6m8eu1408360742.png",intern=TRUE)) character(0) > try(system("convert tmp/7icon1408360742.ps tmp/7icon1408360742.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.485 0.409 2.926