R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-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(748950,732973,746155,738949,729412,726562,715275,728702,717077,708408,676904,654143,652499,668754,679669,698930,726323,739294,752664,744275,728981,713645,703733,713572,702718,712740,702542,686170,657085,640511,640671,631680,614998,611805,603060,577483,592114,595833,640281,681011,683855,658764,690437,683431,699181,701566,687202,682328,676020,625576,622789,602783,586959,546937,552428,533891,513237,515609,509682,487134,468321,458101,450801,442803,433625,428685,419470,411306,415669,411813,409586,406666) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 748950 652499 702718 592114 676020 468321 NA [2,] 732973 668754 712740 595833 625576 458101 NA [3,] 746155 679669 702542 640281 622789 450801 NA [4,] 738949 698930 686170 681011 602783 442803 NA [5,] 729412 726323 657085 683855 586959 433625 NA [6,] 726562 739294 640511 658764 546937 428685 NA [7,] 715275 752664 640671 690437 552428 419470 NA [8,] 728702 744275 631680 683431 533891 411306 NA [9,] 717077 728981 614998 699181 513237 415669 NA [10,] 708408 713645 611805 701566 515609 411813 NA [11,] 676904 703733 603060 687202 509682 409586 NA [12,] 654143 713572 577483 682328 487134 406666 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -15977 16255 10022 3719 -50444 -10220 NA [2,] 13182 10915 -10198 44448 -2787 -7300 NA [3,] -7206 19261 -16372 40730 -20006 -7998 NA [4,] -9537 27393 -29085 2844 -15824 -9178 NA [5,] -2850 12971 -16574 -25091 -40022 -4940 NA [6,] -11287 13370 160 31673 5491 -9215 NA [7,] 13427 -8389 -8991 -7006 -18537 -8164 NA [8,] -11625 -15294 -16682 15750 -20654 4363 NA [9,] -8669 -15336 -3193 2385 2372 -3856 NA [10,] -31504 -9912 -8745 -14364 -5927 -2227 NA [11,] -22761 9839 -25577 -4874 -22548 -2920 NA [12,] -1644 -10854 14631 -6308 -18813 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/1c2vt1363137884.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/2v6iv1363137884.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/3oaai1363137884.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/4kn9a1363137884.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] [1,] 468321.0 458101 622789 602783.0 433625 428685.0 419470 411306.0 415669.0 [2,] 592114.0 595833 622789 602783.0 586959 546937.0 552428 533891.0 513237.0 [3,] 664259.5 647165 659975 683590.5 670470 649637.5 665554 657555.5 657089.5 [4,] 702718.0 712740 702542 698930.0 726323 726562.0 715275 728702.0 717077.0 [5,] 748950.0 732973 746155 738949.0 729412 739294.0 752664 744275.0 728981.0 [,10] [,11] [,12] [1,] 411813.0 409586 406666 [2,] 515609.0 509682 487134 [3,] 656685.5 639982 615813 [4,] 708408.0 687202 682328 [5,] 713645.0 703733 713572 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 592916.3 571756.2 608531.7 621572.6 580575.7 533773.6 560512.4 531896.1 [2,] 735602.7 722573.8 711418.3 745608.4 760364.3 765501.4 770595.6 783214.9 [,9] [,10] [,11] [,12] [1,] 525606.1 532323.9 525475.9 489906.6 [2,] 788572.9 781047.1 754488.1 741719.4 $out [1] 450801 442803 $group [1] 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(468321, 592114, 664259.5, 702718, 748950, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s0fg1363137884.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] [1,] -50444.0 -10198 -20006 -29085.0 -40022 -11287.0 -8991.0 -20654.0 -15336.0 [2,] -15977.0 -7300 -16372 -15824.0 -25091 -9215.0 -8991.0 -16682.0 -8669.0 [3,] -3250.5 4064 -7602 -9357.5 -10757 2825.5 -8276.5 -13459.5 -3524.5 [4,] 10022.0 13182 19261 2844.0 -2850 13370.0 -7006.0 4363.0 2372.0 [5,] 16255.0 13182 40730 27393.0 12971 31673.0 -7006.0 15750.0 2385.0 [,10] [,11] [,12] [1,] -14364.0 -25577 -18813 [2,] -14364.0 -22761 -10854 [3,] -9328.5 -13711 -6308 [4,] -5927.0 -2920 -1644 [5,] -2227.0 9839 -1644 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -20020.69 -9147.552 -30586.44 -21398.963 -25103.163 -11742.55 -9556.889 [2,] 13519.69 17275.552 15382.44 2683.963 3589.163 17393.55 -6996.111 [,8] [,9] [,10] [,11] [,12] [1,] -27034.2047 -10646.302 -14770.638 -26509.0858 -12815.7628 [2,] 115.2047 3597.302 -3886.362 -912.9142 199.7628 $out [1] 44448 13427 -18537 -31504 14631 $group [1] 2 7 7 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-50444, -15977, -3250.5, 10022, 16255, -10198, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6t5so1363137884.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] [1,] 676904.0 652499.0 577483.0 592114.0 487134.0 406666.0 NA [2,] 711841.5 689299.5 613401.5 649522.5 514423.0 411559.5 NA [3,] 727632.0 713608.5 640591.0 682879.5 549682.5 424077.5 NA [4,] 735961.0 734137.5 694356.0 688819.5 612786.0 446802.0 NA [5,] 748950.0 752664.0 712740.0 701566.0 676020.0 468321.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 716630.9 693157.6 603667.1 664955.9 504818.5 408003.2 NA [2,] 738633.1 734059.4 677514.9 700803.1 594546.5 440151.8 NA $out [1] 654143 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(676904, 711841.5, 727632, 735961, 748950, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wquu1363137884.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,] 586887.7 639982.0 592501.5 [2,] 612665.8 648401.2 624408.9 [3,] 625974.8 657322.5 640874.3 [4,] 638156.8 664906.8 655773.1 [5,] 641774.3 683590.5 661992.9 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 614348.2 649794.2 626568.9 [2,] 637601.4 664850.8 655179.7 $out [1] 615813 $group [1] 2 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1c2vt1363137884.ps tmp/1c2vt1363137884.png",intern=TRUE)) character(0) > try(system("convert tmp/2v6iv1363137884.ps tmp/2v6iv1363137884.png",intern=TRUE)) character(0) > try(system("convert tmp/3oaai1363137884.ps tmp/3oaai1363137884.png",intern=TRUE)) character(0) > try(system("convert tmp/4kn9a1363137884.ps tmp/4kn9a1363137884.png",intern=TRUE)) character(0) > try(system("convert tmp/5s0fg1363137884.ps tmp/5s0fg1363137884.png",intern=TRUE)) character(0) > try(system("convert tmp/6t5so1363137884.ps tmp/6t5so1363137884.png",intern=TRUE)) character(0) > try(system("convert tmp/7wquu1363137884.ps tmp/7wquu1363137884.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.286 0.502 3.783