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(5452304,5431998,5411406,5368792,5790356,5768048,5452304,5242380,5262686,5262686,5285280,5325892,5389098,5389098,5348486,5242380,5790356,5873868,5747742,5452304,5578716,5389098,5474612,5515510,5558124,5452304,5474612,5325892,5790356,5937074,5810948,5578716,5831254,5558124,5810948,5790356,5853562,5621330,5873868,5853562,6232512,6146998,5810948,5641636,5873868,5558124,5790356,5831254,5916768,5727436,5831254,5894460,6126692,5937074,5684536,5411406,5664230,4969250,5305586,5494918,5684536,5411406,5411406,5411406,5558124,5348486,5073354,4843124,5010148,4358068,4757610,4989842,5032456,4800224,4820530,4757610,4969250,4820530,4527380,4315454,4673812,3895606,4400968,4631198,4631198,4358068,4105530,4085224,4315454,4105530,3706274,3431142,3726580,3031886,3663374,3999424,4105530,3873298,3579862,3789786,3873298,3810092,3178318,2885168,3094806,2463318,3115398,3347630,3536962,3221218,2925780,3094806,3178318,3011294,2379806,2104674,2357212,1662518,2420418,2885168) > 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,] 5452304 5389098 5558124 5853562 5916768 5684536 5032456 4631198 4105530 [2,] 5431998 5389098 5452304 5621330 5727436 5411406 4800224 4358068 3873298 [3,] 5411406 5348486 5474612 5873868 5831254 5411406 4820530 4105530 3579862 [4,] 5368792 5242380 5325892 5853562 5894460 5411406 4757610 4085224 3789786 [5,] 5790356 5790356 5790356 6232512 6126692 5558124 4969250 4315454 3873298 [6,] 5768048 5873868 5937074 6146998 5937074 5348486 4820530 4105530 3810092 [7,] 5452304 5747742 5810948 5810948 5684536 5073354 4527380 3706274 3178318 [8,] 5242380 5452304 5578716 5641636 5411406 4843124 4315454 3431142 2885168 [9,] 5262686 5578716 5831254 5873868 5664230 5010148 4673812 3726580 3094806 [10,] 5262686 5389098 5558124 5558124 4969250 4358068 3895606 3031886 2463318 [11,] 5285280 5474612 5810948 5790356 5305586 4757610 4400968 3663374 3115398 [12,] 5325892 5515510 5790356 5831254 5494918 4989842 4631198 3999424 3347630 [,10] [,11] [1,] 3536962 NA [2,] 3221218 NA [3,] 2925780 NA [4,] 3094806 NA [5,] 3178318 NA [6,] 3011294 NA [7,] 2379806 NA [8,] 2104674 NA [9,] 2357212 NA [10,] 1662518 NA [11,] 2420418 NA [12,] 2885168 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -20306 0 -105820 -232232 -189332 -273130 -232232 -273130 -232232 [2,] -20592 -40612 22308 252538 103818 0 20306 -252538 -293436 [3,] -42614 -106106 -148720 -20306 63206 0 -62920 -20306 209924 [4,] 421564 547976 464464 378950 232232 146718 211640 230230 83512 [5,] -22308 83512 146718 -85514 -189618 -209638 -148720 -209924 -63206 [6,] -315744 -126126 -126126 -336050 -252538 -275132 -293150 -399256 -631774 [7,] -209924 -295438 -232232 -169312 -273130 -230230 -211926 -275132 -293150 [8,] 20306 126412 252538 232232 252824 167024 358358 295438 209638 [9,] 0 -189618 -273130 -315744 -694980 -652080 -778206 -694694 -631488 [10,] 22594 85514 252824 232232 336336 399542 505362 631488 652080 [11,] 40612 40898 -20592 40898 189332 232232 230230 336050 232232 [12,] 63206 42614 63206 85514 189618 42614 0 106106 189332 [,10] [,11] [1,] -315744 NA [2,] -295438 NA [3,] 169026 NA [4,] 83512 NA [5,] -167024 NA [6,] -631488 NA [7,] -275132 NA [8,] 252538 NA [9,] -694694 NA [10,] 757900 NA [11,] 464750 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/1g0za1439648474.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/2obou1439648474.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/34poi1439648474.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/4whi01439648474.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,] 3536962 3221218 2925780 3094806 3178318 3011294 2379806 2104674 2357212 [2,] 4631198 4358068 4105530 4085224 4315454 4105530 3706274 3431142 3726580 [3,] 5420701 5400252 5379946 5284136 5674240 5558267 5262829 5042752 5136417 [4,] 5684536 5452304 5474612 5411406 5790356 5937074 5747742 5452304 5664230 [5,] 5916768 5727436 5873868 5894460 6232512 6146998 5810948 5641636 5873868 [,10] [,11] [,12] [1,] 1662518 2420418 2885168 [2,] 3031886 3663374 3999424 [3,] 4663659 5021445 5157867 [4,] 5389098 5474612 5515510 [5,] 5558124 5810948 5831254 $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,] 4894411 4853528 4695898 4621523 4937320 4643155 4242830 4032899 4168290 [2,] 5946991 5946976 6063994 5946749 6411160 6473379 6282828 6052605 6104544 [,10] [,11] [,12] [1,] 3485902 4116478 4400370 [2,] 5841416 5926412 5915364 $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(3536962, 4631198, 5420701, 5684536, 5916768, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zsun1439648474.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,] -315744 -295438 -148720 83512 -209924 -399256 -295438 126412 -778206 [2,] -273130 -252538 -62920 146718 -189618 -399256 -275132 167024 -694694 [3,] -232232 -10296 -20306 231231 -117117 -304447 -252681 242385 -641784 [4,] -105820 22308 63206 421564 -22308 -252538 -211926 252824 -273130 [5,] 0 252538 209924 547976 146718 -126126 -169312 358358 0 [,10] [,11] [,12] [1,] 22594 -20592 0 [2,] 232232 40898 42614 [3,] 367939 209781 63206 [4,] 631488 232232 106106 [5,] 757900 464750 189618 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -315826.7 -147620 -83323.58 93906.98 -200711.75 -377753.2 -284261.2 [2,] -148637.3 127028 42711.58 368555.02 -33522.25 -231140.8 -221100.8 [,8] [,9] [,10] [,11] [,12] [1,] 199515.9 -852414.2 168454.8 114182.9 29766.88 [2,] 285254.1 -431153.8 567423.2 305379.1 96645.12 $out [1] -631774 -631488 20306 $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(-315744, -273130, -232232, -105820, 0, -295438, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62mak1439648474.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,] 5242380 5242380 5325892 5558124 4969250 4358068 4315454 3031886 2463318 [2,] 5273983 5389098 5516368 5715996 5453162 4916483 4464174 3684824 3105102 [3,] 5390099 5463458 5684536 5842408 5705986 5210920 4715711 4042324 3463746 [4,] 5452304 5663229 5810948 5873868 5905614 5411406 4820530 4210492 3841695 [5,] 5452304 5873868 5937074 5873868 6126692 5684536 5032456 4631198 4105530 [,10] [,11] [1,] 1662518 NA [2,] 2368509 NA [3,] 2905474 NA [4,] 3136562 NA [5,] 3536962 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,] 5308766 5338425 5550176 5770402 5499620 4985182 4553175 3802563 3127781 [2,] 5471432 5588491 5818896 5914414 5912352 5436658 4878247 4282085 3799711 [,10] [,11] [1,] 2555160 NA [2,] 3255788 NA $out [1] 5790356 5768048 6232512 6146998 3895606 $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(5242380, 5273983, 5390099, 5452304, 5452304, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7o4j61439648474.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,] 4214868 4663659 4302656 [2,] 4654893 5089584 4721592 [3,] 4829696 5273482 4830451 [4,] 5002269 5410476 5030347 [5,] 5162472 5674240 5192223 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4671256 5127122 4689625 [2,] 4988137 5419843 4971276 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4214867.8, 4654893.1, 4829696.3, 5002268.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1g0za1439648474.ps tmp/1g0za1439648474.png",intern=TRUE)) character(0) > try(system("convert tmp/2obou1439648474.ps tmp/2obou1439648474.png",intern=TRUE)) character(0) > try(system("convert tmp/34poi1439648474.ps tmp/34poi1439648474.png",intern=TRUE)) character(0) > try(system("convert tmp/4whi01439648474.ps tmp/4whi01439648474.png",intern=TRUE)) character(0) > try(system("convert tmp/5zsun1439648474.ps tmp/5zsun1439648474.png",intern=TRUE)) character(0) > try(system("convert tmp/62mak1439648474.ps tmp/62mak1439648474.png",intern=TRUE)) character(0) > try(system("convert tmp/7o4j61439648474.ps tmp/7o4j61439648474.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.455 0.442 2.924