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(133448.00 + ,132951.00 + ,132447.00 + ,131404.00 + ,141722.00 + ,141176.00 + ,133448.00 + ,128310.00 + ,128807.00 + ,128807.00 + ,129360.00 + ,130354.00 + ,131901.00 + ,131901.00 + ,130907.00 + ,128310.00 + ,141722.00 + ,143766.00 + ,140679.00 + ,133448.00 + ,136542.00 + ,131901.00 + ,133994.00 + ,134995.00 + ,136038.00 + ,133448.00 + ,133994.00 + ,130354.00 + ,141722.00 + ,145313.00 + ,142226.00 + ,136542.00 + ,142723.00 + ,136038.00 + ,142226.00 + ,141722.00 + ,143269.00 + ,137585.00 + ,143766.00 + ,143269.00 + ,152544.00 + ,150451.00 + ,142226.00 + ,138082.00 + ,143766.00 + ,136038.00 + ,141722.00 + ,142723.00 + ,144816.00 + ,140182.00 + ,142723.00 + ,144270.00 + ,149954.00 + ,145313.00 + ,139132.00 + ,132447.00 + ,138635.00 + ,121625.00 + ,129857.00 + ,134491.00 + ,139132.00 + ,132447.00 + ,132447.00 + ,132447.00 + ,136038.00 + ,130907.00 + ,124173.00 + ,118538.00 + ,122626.00 + ,106666.00 + ,116445.00 + ,122129.00 + ,123172.00 + ,117488.00 + ,117985.00 + ,116445.00 + ,121625.00 + ,117985.00 + ,110810.00 + ,105623.00 + ,114394.00 + ,95347.00 + ,107716.00 + ,113351.00 + ,113351.00 + ,106666.00 + ,100485.00 + ,99988.00 + ,105623.00 + ,100485.00 + ,90713.00 + ,83979.00 + ,91210.00 + ,74207.00 + ,89663.00 + ,97888.00 + ,100485.00 + ,94801.00 + ,87619.00 + ,92757.00 + ,94801.00 + ,93254.00 + ,77791.00 + ,70616.00 + ,75747.00 + ,60291.00 + ,76251.00 + ,81935.00 + ,86569.00 + ,78841.00 + ,71610.00 + ,75747.00 + ,77791.00 + ,73703.00 + ,58247.00 + ,51513.00 + ,57694.00 + ,40691.00 + ,59241.00 + ,70616.00) > 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] [,10] [1,] 133448 131901 136038 143269 144816 139132 123172 113351 100485 86569 [2,] 132951 131901 133448 137585 140182 132447 117488 106666 94801 78841 [3,] 132447 130907 133994 143766 142723 132447 117985 100485 87619 71610 [4,] 131404 128310 130354 143269 144270 132447 116445 99988 92757 75747 [5,] 141722 141722 141722 152544 149954 136038 121625 105623 94801 77791 [6,] 141176 143766 145313 150451 145313 130907 117985 100485 93254 73703 [7,] 133448 140679 142226 142226 139132 124173 110810 90713 77791 58247 [8,] 128310 133448 136542 138082 132447 118538 105623 83979 70616 51513 [9,] 128807 136542 142723 143766 138635 122626 114394 91210 75747 57694 [10,] 128807 131901 136038 136038 121625 106666 95347 74207 60291 40691 [11,] 129360 133994 142226 141722 129857 116445 107716 89663 76251 59241 [12,] 130354 134995 141722 142723 134491 122129 113351 97888 81935 70616 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -497 0 -2590 -5684 -4634 -6685 -5684 -6685 -5684 -7728 NA [2,] -504 -994 546 6181 2541 0 497 -6181 -7182 -7231 NA [3,] -1043 -2597 -3640 -497 1547 0 -1540 -497 5138 4137 NA [4,] 10318 13412 11368 9275 5684 3591 5180 5635 2044 2044 NA [5,] -546 2044 3591 -2093 -4641 -5131 -3640 -5138 -1547 -4088 NA [6,] -7728 -3087 -3087 -8225 -6181 -6734 -7175 -9772 -15463 -15456 NA [7,] -5138 -7231 -5684 -4144 -6685 -5635 -5187 -6734 -7175 -6734 NA [8,] 497 3094 6181 5684 6188 4088 8771 7231 5131 6181 NA [9,] 0 -4641 -6685 -7728 -17010 -15960 -19047 -17003 -15456 -17003 NA [10,] 553 2093 6188 5684 8232 9779 12369 15456 15960 18550 NA [11,] 994 1001 -504 1001 4634 5684 5635 8225 5684 11375 NA [12,] 1547 1043 1547 2093 4641 1043 0 2597 4634 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/1ljv91439653003.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/2y7ep1439653003.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/3h13s1439653003.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/4faoy1439653003.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,] 86569.0 78841 71610 75747 77791 73703.0 58247.0 51513 57694.0 [2,] 113351.0 106666 100485 99988 105623 100485.0 90713.0 83979 91210.0 [3,] 132674.5 132174 131677 129332 138880 136041.5 128810.5 123424 125716.5 [4,] 139132.0 133448 133994 132447 141722 145313.0 140679.0 133448 138635.0 [5,] 144816.0 140182 143766 144270 152544 150451.0 142226.0 138082 143766.0 [,10] [,11] [,12] [1,] 40691.0 59241.0 70616.0 [2,] 74207.0 89663.0 97888.0 [3,] 114145.5 122902.5 126241.5 [4,] 131901.0 133994.0 134995.0 [5,] 136038.0 142226.0 142723.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 119793.3 118792.6 114934.6 113114.2 120843.5 113643.6 103845.5 98707.32 [2,] 145555.7 145555.4 148419.4 145549.8 156916.5 158439.4 153775.5 148140.68 [,9] [,10] [,11] [,12] [1,] 102021.1 85319.28 100753 107701.4 [2,] 149411.9 142971.72 145052 144781.6 $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(86569, 113351, 132674.5, 139132, 144816, 78841, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58nau1439653003.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,] -7728 -7231 -3640 2044.0 -5138.0 -9772.0 -7231.0 3094.0 -19047 553.0 [2,] -6685 -6181 -1540 3591.0 -4641.0 -9772.0 -6734.0 4088.0 -17003 5684.0 [3,] -5684 -252 -497 5659.5 -2866.5 -7451.5 -6184.5 5932.5 -15708 9005.5 [4,] -2590 546 1547 10318.0 -546.0 -6181.0 -5187.0 6188.0 -6685 15456.0 [5,] 0 6181 5138 13412.0 3591.0 -3087.0 -4144.0 8771.0 0 18550.0 [,11] [,12] [1,] -504.0 0 [2,] 1001.0 1043 [3,] 5134.5 1547 [4,] 5684.0 2597 [5,] 11375.0 4641 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7730.025 -3613.077 -2039.388 2298.423 -4912.5253 -9245.707 -6957.443 [2,] -3637.975 3109.077 1045.388 9020.577 -820.4747 -5657.293 -5411.557 [,8] [,9] [,10] [,11] [,12] [1,] 4883.256 -20863.28 4123.019 2794.686 728.56 [2,] 6981.744 -10552.72 13887.981 7474.314 2365.44 $out [1] -15463 -15456 497 $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(-7728, -6685, -5684, -2590, 0, -7231, -6181, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6eq4q1439653003.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,] 128310.0 128310.0 130354 136038 121625 106666.0 105623.0 74207 60291.0 [2,] 129083.5 131901.0 135016 139902 133469 120333.5 109263.0 90188 75999.0 [3,] 131925.5 133721.0 139132 142996 139657 127540.0 115419.5 98938 84777.0 [4,] 133448.0 138610.5 142226 143766 144543 132447.0 117985.0 103054 94027.5 [5,] 133448.0 143766.0 145313 143766 149954 139132.0 123172.0 113351 100485.0 [,10] [,11] [1,] 40691.0 NA [2,] 57970.5 NA [3,] 71113.0 NA [4,] 76769.0 NA [5,] 86569.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 129934.8 130660.8 135843.5 141233.6 134606.1 122015 111441.3 93069.73 [2,] 133916.2 136781.2 142420.5 144758.4 144707.9 133065 119397.7 104806.27 [,9] [,10] [,11] [1,] 76554.08 62538.88 NA [2,] 92999.92 79687.12 NA $out [1] 141722 141176 152544 150451 95347 $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(128310, 129083.5, 131925.5, 133448, 133448, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7aaco1439653003.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,] 103161.1 114145.5 105309.8 [2,] 113930.9 124570.2 115563.4 [3,] 118209.4 129071.2 118227.8 [4,] 122433.1 132424.2 123120.4 [5,] 126354.2 138880.0 127082.4 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 114331.4 125489.0 114781.0 [2,] 122087.3 132653.5 121674.6 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(103161.1, 113930.95, 118209.35, 122433.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ljv91439653003.ps tmp/1ljv91439653003.png",intern=TRUE)) character(0) > try(system("convert tmp/2y7ep1439653003.ps tmp/2y7ep1439653003.png",intern=TRUE)) character(0) > try(system("convert tmp/3h13s1439653003.ps tmp/3h13s1439653003.png",intern=TRUE)) character(0) > try(system("convert tmp/4faoy1439653003.ps tmp/4faoy1439653003.png",intern=TRUE)) character(0) > try(system("convert tmp/58nau1439653003.ps tmp/58nau1439653003.png",intern=TRUE)) character(0) > try(system("convert tmp/6eq4q1439653003.ps tmp/6eq4q1439653003.png",intern=TRUE)) character(0) > try(system("convert tmp/7aaco1439653003.ps tmp/7aaco1439653003.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.479 0.456 2.963