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(5204472,5185089,5165433,5124756,5527158,5505864,5204472,5004090,5023473,5023473,5045040,5083806,5144139,5144139,5105373,5004090,5527158,5606874,5486481,5204472,5325138,5144139,5225766,5264805,5305482,5204472,5225766,5083806,5527158,5667207,5546814,5325138,5566197,5305482,5546814,5527158,5587491,5365815,5606874,5587491,5949216,5867589,5546814,5385198,5606874,5305482,5527158,5566197,5647824,5467098,5566197,5626530,5848206,5667207,5426148,5165433,5406765,4743375,5064423,5245149,5426148,5165433,5165433,5165433,5305482,5105373,4842747,4622982,4782414,4159974,4541355,4763031,4803708,4582032,4601415,4541355,4743375,4601415,4321590,4119297,4461366,3718533,4200924,4420689,4420689,4159974,3918915,3899532,4119297,3918915,3537807,3275181,3557190,2894073,3496857,3817632,3918915,3697239,3417141,3617523,3697239,3636906,3033849,2754024,2954133,2351349,2973789,3195465,3376191,3074799,2792790,2954133,3033849,2874417,2271633,2009007,2250066,1586949,2310399,2754024) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5204472 5144139 5305482 5587491 5647824 5426148 4803708 4420689 3918915 [2,] 5185089 5144139 5204472 5365815 5467098 5165433 4582032 4159974 3697239 [3,] 5165433 5105373 5225766 5606874 5566197 5165433 4601415 3918915 3417141 [4,] 5124756 5004090 5083806 5587491 5626530 5165433 4541355 3899532 3617523 [5,] 5527158 5527158 5527158 5949216 5848206 5305482 4743375 4119297 3697239 [6,] 5505864 5606874 5667207 5867589 5667207 5105373 4601415 3918915 3636906 [7,] 5204472 5486481 5546814 5546814 5426148 4842747 4321590 3537807 3033849 [8,] 5004090 5204472 5325138 5385198 5165433 4622982 4119297 3275181 2754024 [9,] 5023473 5325138 5566197 5606874 5406765 4782414 4461366 3557190 2954133 [10,] 5023473 5144139 5305482 5305482 4743375 4159974 3718533 2894073 2351349 [11,] 5045040 5225766 5546814 5527158 5064423 4541355 4200924 3496857 2973789 [12,] 5083806 5264805 5527158 5566197 5245149 4763031 4420689 3817632 3195465 [,10] [,11] [1,] 3376191 NA [2,] 3074799 NA [3,] 2792790 NA [4,] 2954133 NA [5,] 3033849 NA [6,] 2874417 NA [7,] 2271633 NA [8,] 2009007 NA [9,] 2250066 NA [10,] 1586949 NA [11,] 2310399 NA [12,] 2754024 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -19383 0 -101010 -221676 -180726 -260715 -221676 -260715 -221676 [2,] -19656 -38766 21294 241059 99099 0 19383 -241059 -280098 [3,] -40677 -101283 -141960 -19383 60333 0 -60060 -19383 200382 [4,] 402402 523068 443352 361725 221676 140049 202020 219765 79716 [5,] -21294 79716 140049 -81627 -180999 -200109 -141960 -200382 -60333 [6,] -301392 -120393 -120393 -320775 -241059 -262626 -279825 -381108 -603057 [7,] -200382 -282009 -221676 -161616 -260715 -219765 -202293 -262626 -279825 [8,] 19383 120666 241059 221676 241332 159432 342069 282009 200109 [9,] 0 -180999 -260715 -301392 -663390 -622440 -742833 -663117 -602784 [10,] 21567 81627 241332 221676 321048 381381 482391 602784 622440 [11,] 38766 39039 -19656 39039 180726 221676 219765 320775 221676 [12,] 60333 40677 60333 81627 180999 40677 0 101283 180726 [,10] [,11] [1,] -301392 NA [2,] -282009 NA [3,] 161343 NA [4,] 79716 NA [5,] -159432 NA [6,] -602784 NA [7,] -262626 NA [8,] 241059 NA [9,] -663117 NA [10,] 723450 NA [11,] 443625 NA [12,] 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/133wf1439727383.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/27f8g1439727383.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/3vpcu1439727383.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/4m21m1439727383.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,] 3376191 3074799 2792790 2954133 3033849 2874417 2271633 2009007 2250066 [2,] 4420689 4159974 3918915 3899532 4119297 3918915 3537807 3275181 3557190 [3,] 5174306 5154786 5135403 5043948 5416320 5305618 5023610 4813536 4902944 [4,] 5426148 5204472 5225766 5165433 5527158 5667207 5486481 5204472 5406765 [5,] 5647824 5467098 5606874 5626530 5949216 5867589 5546814 5385198 5606874 [,10] [,11] [,12] [1,] 1586949 2310399 2754024 [2,] 2894073 3496857 3817632 [3,] 4451674 4793198 4923418 [4,] 5144139 5225766 5264805 [5,] 5305482 5546814 5566197 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 4671938 4632913 4482448 4411453 4712897 4432102 4049974 3849585 3978822 [2,] 5676673 5676659 5788358 5676443 6119743 6179135 5997245 5777487 5827065 [,10] [,11] [,12] [1,] 3327452 3929366 4200353 [2,] 5575897 5657029 5646484 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3376191, 4420689, 5174305.5, 5426148, 5647824, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55u981439727383.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] [1,] -301392 -282009 -141960 79716.0 -200382.0 -381108.0 -282009.0 120666.0 [2,] -260715 -241059 -60060 140049.0 -180999.0 -381108.0 -262626.0 159432.0 [3,] -221676 -9828 -19383 220720.5 -111793.5 -290608.5 -241195.5 231367.5 [4,] -101010 21294 60333 402402.0 -21294.0 -241059.0 -202293.0 241332.0 [5,] 0 241059 200382 523068.0 140049.0 -120393.0 -161616.0 342069.0 [,9] [,10] [,11] [,12] [1,] -742833 21567.0 -19656.0 0 [2,] -663117 221676.0 39039.0 40677 [3,] -612612 351214.5 200245.5 60333 [4,] -260715 602784.0 221676.0 101283 [5,] 0 723450.0 443625.0 180999 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -301471 -140910 -79536.14 89638.48 -191588.49 -360582.6 -271340.3 190447 [2,] -141881 121254 40770.14 351802.52 -31998.51 -220634.4 -211050.7 272288 [,9] [,10] [,11] [,12] [1,] -813668.1 160797.7 108992.8 28413.84 [2,] -411555.9 541631.3 291498.2 92252.16 $out [1] -603057 -602784 19383 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-301392, -260715, -221676, -101010, 0, -282009, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dc921439727383.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] [1,] 5004090 5004090 5083806 5305482 4743375 4159974 4119297 2894073 2351349 [2,] 5034256 5144139 5265624 5456178 5205291 4693006 4261257 3517332 2963961 [3,] 5145094 5215119 5426148 5576844 5446623 4974060 4501360 3858582 3306303 [4,] 5204472 5405810 5546814 5606874 5637177 5165433 4601415 4019106 3667072 [5,] 5204472 5606874 5667207 5606874 5848206 5426148 4803708 4420689 3918915 [,10] [,11] [1,] 1586949 NA [2,] 2260850 NA [3,] 2773407 NA [4,] 2993991 NA [5,] 3376191 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5067458 5095769 5297895 5508111 5249637 4758583 4346212 3629720 2985609 [2,] 5222731 5334469 5554401 5645577 5643609 5189537 4656509 4087444 3626997 [,10] [,11] [1,] 2439016 NA [2,] 3107798 NA $out [1] 5527158 5505864 5949216 5867589 3718533 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(5004090, 5034256.5, 5145094.5, 5204472, 5204472, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79fh11439727383.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,] 4023283 4451674 4107080 [2,] 4443307 4858240 4506974 [3,] 4610165 5033779 4610885 [4,] 4774893 5164546 4801695 [5,] 4927814 5416320 4956213 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4458926 4894071 4476461 [2,] 4761403 5173487 4745309 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4023282.9, 4443307.05, 4610164.65, 4774892.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/133wf1439727383.ps tmp/133wf1439727383.png",intern=TRUE)) character(0) > try(system("convert tmp/27f8g1439727383.ps tmp/27f8g1439727383.png",intern=TRUE)) character(0) > try(system("convert tmp/3vpcu1439727383.ps tmp/3vpcu1439727383.png",intern=TRUE)) character(0) > try(system("convert tmp/4m21m1439727383.ps tmp/4m21m1439727383.png",intern=TRUE)) character(0) > try(system("convert tmp/55u981439727383.ps tmp/55u981439727383.png",intern=TRUE)) character(0) > try(system("convert tmp/6dc921439727383.ps tmp/6dc921439727383.png",intern=TRUE)) character(0) > try(system("convert tmp/79fh11439727383.ps tmp/79fh11439727383.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.475 0.399 2.892