R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(3200944,3153170,3741498,3918719,4403449,4400407,4847473,4716136,4297440,4272253,3271834,3168388,2911748,2720999,3199918,3672623,3892013,3850845,4532467,4484739,4014972,3983758,3158459,3100569,2935404,2855719,3465611,3006985,4095110,4104793,4730788,4642726,4246919,4308032,3508154,3236641,3257275,3045631,3657692,4125747,4472507,4513455,5150896,5057815,4681742,4603682,3580181,3534002,3422762,3295209,3868093,4189245,4544332,4612845,5221595,5137505,4760439,4643697,3692267,3587603) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3200944 2911748 2935404 3257275 3422762 NA [2,] 3153170 2720999 2855719 3045631 3295209 NA [3,] 3741498 3199918 3465611 3657692 3868093 NA [4,] 3918719 3672623 3006985 4125747 4189245 NA [5,] 4403449 3892013 4095110 4472507 4544332 NA [6,] 4400407 3850845 4104793 4513455 4612845 NA [7,] 4847473 4532467 4730788 5150896 5221595 NA [8,] 4716136 4484739 4642726 5057815 5137505 NA [9,] 4297440 4014972 4246919 4681742 4760439 NA [10,] 4272253 3983758 4308032 4603682 4643697 NA [11,] 3271834 3158459 3508154 3580181 3692267 NA [12,] 3168388 3100569 3236641 3534002 3587603 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -47774 -190749 -79685 -211644 -127553 NA [2,] 588328 478919 609892 612061 572884 NA [3,] 177221 472705 -458626 468055 321152 NA [4,] 484730 219390 1088125 346760 355087 NA [5,] -3042 -41168 9683 40948 68513 NA [6,] 447066 681622 625995 637441 608750 NA [7,] -131337 -47728 -88062 -93081 -84090 NA [8,] -418696 -469767 -395807 -376073 -377066 NA [9,] -25187 -31214 61113 -78060 -116742 NA [10,] -1000419 -825299 -799878 -1023501 -951430 NA [11,] -103446 -57890 -271513 -46179 -104664 NA [12,] -256640 -165165 20634 -111240 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/1ru471393881996.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/2rddx1393881996.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/3j8q81393881996.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/4bg2c1393881996.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,] 2911748 2720999 3199918 3006985 3892013 3850845 4532467 4484739 4014972 [2,] 2935404 2855719 3465611 3672623 4095110 4104793 4730788 4642726 4246919 [3,] 3200944 3045631 3657692 3918719 4403449 4400407 4847473 4716136 4297440 [4,] 3257275 3153170 3741498 4125747 4472507 4513455 5150896 5057815 4681742 [5,] 3422762 3295209 3868093 4189245 4544332 4612845 5221595 5137505 4760439 [,10] [,11] [,12] [1,] 3983758 3158459 3100569 [2,] 4272253 3271834 3168388 [3,] 4308032 3508154 3236641 [4,] 4603682 3580181 3534002 [5,] 4643697 3692267 3587603 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2973511 2835453 3462751 3598543 4136781 4111647 4550626 4422835 3990195 [2,] 3428377 3255809 3852633 4238895 4670117 4689167 5144320 5009437 4604685 [,10] [,11] [,12] [1,] 4073845 3290277 2978299 [2,] 4542219 3726031 3494983 $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(2911748, 2935404, 3200944, 3257275, 3422762, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5x7fo1393881996.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] [1,] -211644 572884 177221 219390 -41168 608750 -93081 -469767 -116742 -1023501 [2,] -190749 572884 177221 346760 -3042 608750 -93081 -418696 -78060 -1000419 [3,] -127553 588328 321152 355087 9683 625995 -88062 -395807 -31214 -951430 [4,] -79685 609892 468055 484730 40948 637441 -84090 -377066 -25187 -825299 [5,] -47774 612061 472705 484730 68513 637441 -84090 -376073 -25187 -799878 [,11] [,12] [1,] -104664 -256640.0 [2,] -104664 -210902.5 [3,] -103446 -138202.5 [4,] -57890 -45303.0 [5,] -46179 20634.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -206030.54 562178.2 115649.4 257597.7 -21400.22 605722 -94415.02 -425222.7 [2,] -49075.46 614477.8 526654.6 452576.3 40766.22 646268 -81708.98 -366391.3 [,9] [,10] [,11] [,12] [1,] -68573.929 -1075169.4 -136496.39 -269026.105 [2,] 6145.929 -827690.6 -70395.61 -7378.895 $out [1] 478919 -458626 1088125 447066 681622 -131337 -47728 61113 -271513 $group [1] 2 3 4 6 6 7 7 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-211644, -190749, -127553, -79685, -47774, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uo211393881996.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] [1,] 3153170 2720999 2855719 3045631 3295209 NA [2,] 3236389 3129514 3121813 3557092 3639935 NA [3,] 4095486 3761734 3801632 4299127 4366788 NA [4,] 4401928 3999365 4277476 4642712 4702068 NA [5,] 4847473 4532467 4730788 5150896 5221595 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3563876 3364989 3274527 3803968 3882343 NA [2,] 4627096 4158479 4328737 4794286 4851234 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(3153170, 3236389, 4095486, 4401928, 4847473, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sdta1393881996.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,] 3014146 3045631 3004444 [2,] 3383810 3372398 3388601 [3,] 4032073 4108080 4091497 [4,] 4381293 4401928 4451149 [5,] 4896644 4847473 4940842 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3577114 3638504 3606862 [2,] 4487032 4577655 4576132 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3014145.6, 3383809.8, 4032073, 4381293.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ru471393881996.ps tmp/1ru471393881996.png",intern=TRUE)) character(0) > try(system("convert tmp/2rddx1393881996.ps tmp/2rddx1393881996.png",intern=TRUE)) character(0) > try(system("convert tmp/3j8q81393881996.ps tmp/3j8q81393881996.png",intern=TRUE)) character(0) > try(system("convert tmp/4bg2c1393881996.ps tmp/4bg2c1393881996.png",intern=TRUE)) character(0) > try(system("convert tmp/5x7fo1393881996.ps tmp/5x7fo1393881996.png",intern=TRUE)) character(0) > try(system("convert tmp/6uo211393881996.ps tmp/6uo211393881996.png",intern=TRUE)) character(0) > try(system("convert tmp/7sdta1393881996.ps tmp/7sdta1393881996.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.815 0.878 5.714