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(323898,323268,322574,321304,334352,333712,323898,317374,318014,318014,318646,319980,319980,314086,311490,314086,323268,321934,309526,299020,297054,293126,295784,299020,297748,295090,289900,295090,299712,298380,283312,276788,270264,265010,264380,268300,263046,261082,259118,270264,271536,265010,247340,239490,227082,221820,224416,228344,228344,225118,224416,234930,243420,239490,226380,219864,206122,197634,204158,210682,210682,202194,201562,212638,219864,217260,204158,195670,177304,170150,172744,183892,184522,168184,174078,188452,194976,191046,173384,160968,146594,135448,140008,149820,147226,132852,137412,151786,159642,155082,137412,129564,117786,105368,107332,117146,118416,106638,108604,125004,128924,122346,98150,85742,69342,53004,58258,65412,64150,51670,58888,76560,84408,80488,64782,52372,39262,24186,26854,31414) > 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,] 323898 319980 297748 263046 228344 210682 184522 147226 118416 64150 [2,] 323268 314086 295090 261082 225118 202194 168184 132852 106638 51670 [3,] 322574 311490 289900 259118 224416 201562 174078 137412 108604 58888 [4,] 321304 314086 295090 270264 234930 212638 188452 151786 125004 76560 [5,] 334352 323268 299712 271536 243420 219864 194976 159642 128924 84408 [6,] 333712 321934 298380 265010 239490 217260 191046 155082 122346 80488 [7,] 323898 309526 283312 247340 226380 204158 173384 137412 98150 64782 [8,] 317374 299020 276788 239490 219864 195670 160968 129564 85742 52372 [9,] 318014 297054 270264 227082 206122 177304 146594 117786 69342 39262 [10,] 318014 293126 265010 221820 197634 170150 135448 105368 53004 24186 [11,] 318646 295784 264380 224416 204158 172744 140008 107332 58258 26854 [12,] 319980 299020 268300 228344 210682 183892 149820 117146 65412 31414 [,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] [1,] -630 -5894 -2658 -1964 -3226 -8488 -16338 -14374 -11778 -12480 [2,] -694 -2596 -5190 -1964 -702 -632 5894 4560 1966 7218 [3,] -1270 2596 5190 11146 10514 11076 14374 14374 16400 17672 [4,] 13048 9182 4622 1272 8490 7226 6524 7856 3920 7848 [5,] -640 -1334 -1332 -6526 -3930 -2604 -3930 -4560 -6578 -3920 [6,] -9814 -12408 -15068 -17670 -13110 -13102 -17662 -17670 -24196 -15706 [7,] -6524 -10506 -6524 -7850 -6516 -8488 -12416 -7848 -12408 -12410 [8,] 640 -1966 -6524 -12408 -13742 -18366 -14374 -11778 -16400 -13110 [9,] 0 -3928 -5254 -5262 -8488 -7154 -11146 -12418 -16338 -15076 [10,] 632 2658 -630 2596 6524 2594 4560 1964 5254 2668 [11,] 1334 3236 3920 3928 6524 11148 9812 9814 7154 4560 [12,] 0 -1272 -5254 0 0 630 -2594 1270 -1262 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/1y02t1374675056.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/2kuih1374675056.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/3kr0t1374675056.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/4qzmj1374675056.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,] 64150 51670 58888 76560 84408 80488 64782 52372 39262 24186 [2,] 147226 132852 137412 151786 159642 155082 137412 129564 117786 105368 [3,] 219513 213656 212989 223784 231642 228375 215269 207767 191713 183892 [4,] 297748 295090 289900 295090 299712 298380 283312 276788 270264 265010 [5,] 323898 323268 322574 321304 334352 333712 323898 317374 318014 318014 [,11] [,12] [1,] 26854 31414 [2,] 107332 117146 [3,] 188451 197287 [4,] 264380 268300 [5,] 318646 319980 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 144306.2 132595.4 136799.9 152183.6 161657.4 156777.6 142371.5 134208 [2,] 294719.8 294716.6 289178.1 295384.4 301626.6 299972.4 288166.5 281326 [,9] [,10] [,11] [,12] [1,] 115528.9 104128.5 109983.6 121764.4 [2,] 267897.1 263655.5 266918.4 272809.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(64150, 147226, 219513, 297748, 323898, 51670, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g7qg1374675056.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,] -16338 -5190 -1270 1272 -6578 -24196 -12416 -18366 -16338 -630 1334 [2,] -12480 -1964 5190 4622 -4560 -17670 -12408 -14374 -12418 1964 3920 [3,] -7191 -663 11111 7537 -3925 -15387 -8169 -12759 -7821 2627 5542 [4,] -2658 4560 14374 8490 -1334 -13102 -6524 -6524 -5254 4560 9812 [5,] -630 7218 17672 13048 -640 -9814 -6516 640 0 6524 11148 [,12] [1,] -2594 [2,] -1272 [3,] 0 [4,] 0 [5,] 1270 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -12098.463 -3922.651 6522.307 5604.393 -5536.838 -17669.35 -11108.881 [2,] -2283.537 2596.651 15699.693 9469.607 -2313.162 -13104.65 -5229.119 [,8] [,9] [,10] [,11] [,12] [1,] -16681.173 -11400.42 1329.935 2598.122 -669.92 [2,] -8836.827 -4241.58 3924.065 8485.878 669.92 $out [1] -5254 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-16338, -12480, -7191, -2658, -630, -5190, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ot5g1374675056.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,] 317374 293126 264380 221820 197634 170150 135448 105368 53004 24186 NA [2,] 318330 298037 269282 227713 208402 180598 148207 117466 67377 35338 NA [3,] 321939 310508 286606 253229 224767 201878 170784 135132 102394 55630 NA [4,] 323898 317033 296419 264028 231637 211660 186487 149506 120381 70671 NA [5,] 323898 323268 299712 271536 243420 219864 194976 159642 128924 84408 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 319399.4 301843.8 274228.6 236665.5 214169.4 187710.4 153324.2 120518.3 [2,] 324478.6 319172.2 298983.4 269792.5 235364.6 216045.6 188243.8 149745.7 [,9] [,10] [,11] [1,] 78218.52 39514.38 NA [2,] 126569.48 71745.62 NA $out [1] 334352 333712 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(317374, 318330, 321939, 323898, 323898, 293126, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7n8jq1374675056.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,] 178376.0 183892.0 183550.2 [2,] 187141.7 194500.0 192020.5 [3,] 207426.2 213322.5 212249.2 [4,] 217406.3 221648.5 223864.6 [5,] 226010.2 231642.0 230571.8 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 193622.3 200939.9 197724.9 [2,] 221230.1 225705.1 226773.6 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(178376, 187141.7, 207426.2, 217406.3, 226010.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y02t1374675056.ps tmp/1y02t1374675056.png",intern=TRUE)) character(0) > try(system("convert tmp/2kuih1374675056.ps tmp/2kuih1374675056.png",intern=TRUE)) character(0) > try(system("convert tmp/3kr0t1374675056.ps tmp/3kr0t1374675056.png",intern=TRUE)) character(0) > try(system("convert tmp/4qzmj1374675056.ps tmp/4qzmj1374675056.png",intern=TRUE)) character(0) > try(system("convert tmp/5g7qg1374675056.ps tmp/5g7qg1374675056.png",intern=TRUE)) character(0) > try(system("convert tmp/6ot5g1374675056.ps tmp/6ot5g1374675056.png",intern=TRUE)) character(0) > try(system("convert tmp/7n8jq1374675056.ps tmp/7n8jq1374675056.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.453 1.069 6.502