R version 3.0.1 (2013-05-16) -- "Good Sport" 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(58896,57616,56232,53708,79784,78524,58896,45848,47112,47112,48372,51040,54968,53708,45848,47112,83716,91572,70664,58896,61548,62828,69404,75856,77260,64088,65476,48372,96888,111200,78524,68016,74596,82452,94220,108656,108656,99412,95484,71928,111200,129564,113848,96888,99412,108656,121704,137420,126896,120444,120444,99412,129564,149188,133492,116516,121704,142612,151856,164888,154380,137420,133492,102080,122968,145260,120444,106008,120444,134756,142612,163624,153120,126896,129564,104744,125636,144000,122968,108656,121704,137420,134756,166168,160976,140068,141332,113848,130824,157048,137420,125636,145260,157048,147928,189724,179340,155784,149188,119056,136140,151856,132212,132212,154380,166168,159696,205420,193652,171484,162240,129564,141332,162240,146524,142612,160976,176672,159696,200228) > 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] [,11] [1,] 58896 54968 77260 108656 126896 154380 153120 160976 179340 193652 NA [2,] 57616 53708 64088 99412 120444 137420 126896 140068 155784 171484 NA [3,] 56232 45848 65476 95484 120444 133492 129564 141332 149188 162240 NA [4,] 53708 47112 48372 71928 99412 102080 104744 113848 119056 129564 NA [5,] 79784 83716 96888 111200 129564 122968 125636 130824 136140 141332 NA [6,] 78524 91572 111200 129564 149188 145260 144000 157048 151856 162240 NA [7,] 58896 70664 78524 113848 133492 120444 122968 137420 132212 146524 NA [8,] 45848 58896 68016 96888 116516 106008 108656 125636 132212 142612 NA [9,] 47112 61548 74596 99412 121704 120444 121704 145260 154380 160976 NA [10,] 47112 62828 82452 108656 142612 134756 137420 157048 166168 176672 NA [11,] 48372 69404 94220 121704 151856 142612 134756 147928 159696 159696 NA [12,] 51040 75856 108656 137420 164888 163624 166168 189724 205420 200228 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -1280 -1260 -13172 -9244 -6452 -16960 -26224 -20908 -23556 -22168 [2,] -1384 -7860 1388 -3928 0 -3928 2668 1264 -6596 -9244 [3,] -2524 1264 -17104 -23556 -21032 -31412 -24820 -27484 -30132 -32676 [4,] 26076 36604 48516 39272 30152 20888 20892 16976 17084 11768 [5,] -1260 7856 14312 18364 19624 22292 18364 26224 15716 20908 [6,] -19628 -20908 -32676 -15716 -15696 -24816 -21032 -19628 -19644 -15716 [7,] -13048 -11768 -10508 -16960 -16976 -14436 -14312 -11784 0 -3912 [8,] 1264 2652 6580 2524 5188 14436 13048 19624 22168 18364 [9,] 0 1280 7856 9244 20908 14312 15716 11788 11788 15696 [10,] 1260 6576 11768 13048 9244 7856 -2664 -9120 -6472 -16976 [11,] 2668 6452 14436 15716 13032 21012 31412 41796 45724 40532 [12,] 3928 1404 0 -10524 -10508 -10504 -5192 -10384 -11768 NA [,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 > 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/1q7g21377036824.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/26inl1377036824.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/37etc1377036824.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/41hkk1377036824.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] [,10] [1,] 54968 53708 45848 47112 79784 78524 58896 45848 47112 47112 [2,] 77260 64088 65476 53708 96888 111200 78524 68016 74596 82452 [3,] 140008 123670 125004 100746 124302 144630 121706 107332 121074 136088 [4,] 160976 140068 141332 113848 130824 151856 133492 125636 145260 157048 [5,] 193652 171484 162240 129564 141332 162240 146524 142612 160976 176672 [,11] [,12] [1,] 48372 51040 [2,] 94220 108656 [3,] 138684 164256 [4,] 151856 189724 [5,] 159696 205420 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98180.15 85707.36 87103.32 70697.66 107346.2 124316.6 94241.8 [2,] 181835.85 161632.64 162904.68 130794.34 141257.8 164943.4 149170.2 [,8] [,9] [,10] [,11] [,12] [1,] 78542.75 85767.45 98816.86 109886.8 123751.2 [2,] 136121.25 156380.55 173359.14 167481.2 204760.8 $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(54968, 77260, 140008, 160976, 193652, 53708, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/568yl1377036824.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] [,11] [1,] -26224 -9244 -32676 11768 7856 -24816 -16976 1264 0 -16976 2668 [2,] -22168 -6596 -30132 17084 14312 -21032 -14436 2652 7856 -6472 13032 [3,] -15066 -2656 -24188 23484 18364 -19636 -12416 9814 11788 3918 18364 [4,] -6452 1264 -17104 36604 20908 -15716 -10508 18364 15696 9244 40532 [5,] -1260 2668 1264 48516 26224 -15696 -10508 22168 20908 13048 45724 [,12] [1,] -11768 [2,] -10508 [3,] -10384 [4,] 0 [5,] 3928 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -22918.34 -6583.169 -30697.31 13731.03 15068.38 -22292.09 -14378.59 [2,] -7213.66 1271.169 -17678.69 33236.97 21659.62 -16979.91 -10453.41 [,8] [,9] [,10] [,11] [,12] [1,] 1963.658 7870.823 -3934.34 4623.904 -15918.213 [2,] 17664.342 15705.177 11770.34 32104.096 -4849.787 $out [1] -1260 -32676 0 -3912 $group [1] 5 6 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-26224, -22168, -15066, -6452, -1260, -9244, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6clqk1377036824.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] [,10] [,11] [1,] 45848 45848 48372 71928 99412 102080 104744 113848 119056 129564 NA [2,] 47742 54338 66746 98150 120444 120444 122336 134122 134176 144568 NA [3,] 54970 62188 77892 108656 128230 134124 128230 143296 153118 161608 NA [4,] 58896 73260 95554 117776 145900 143936 140710 157048 162932 174078 NA [5,] 58896 91572 111200 137420 164888 163624 166168 189724 205420 200228 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 49882.59 53557.55 64752.48 99704.45 116619.3 123409.1 119849.5 132839.3 [2,] 60057.41 70818.45 91031.52 117607.55 139840.7 144838.9 136610.5 153752.7 [,9] [,10] [,11] [1,] 140002.2 148148.3 NA [2,] 166233.8 175067.7 NA $out [1] 79784 78524 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(45848, 47742, 54970, 58896, 58896, 45848, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7l3z31377036824.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,] 88982.4 100746 84917.5 [2,] 110321.8 121390 106168.8 [3,] 114248.6 124653 112875.5 [4,] 124919.4 139346 124100.2 [5,] 146302.4 164256 149841.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 107590.5 116463.1 104696.8 [2,] 120906.7 132842.9 121054.2 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(88982.4, 110321.8, 114248.6, 124919.4, 146302.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1q7g21377036824.ps tmp/1q7g21377036824.png",intern=TRUE)) character(0) > try(system("convert tmp/26inl1377036824.ps tmp/26inl1377036824.png",intern=TRUE)) character(0) > try(system("convert tmp/37etc1377036824.ps tmp/37etc1377036824.png",intern=TRUE)) character(0) > try(system("convert tmp/41hkk1377036824.ps tmp/41hkk1377036824.png",intern=TRUE)) character(0) > try(system("convert tmp/568yl1377036824.ps tmp/568yl1377036824.png",intern=TRUE)) character(0) > try(system("convert tmp/6clqk1377036824.ps tmp/6clqk1377036824.png",intern=TRUE)) character(0) > try(system("convert tmp/7l3z31377036824.ps tmp/7l3z31377036824.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.824 0.799 4.603