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(293544,282672,298980,239184,309852,304416,326160,337032,375084,326160,309852,385956,326160,244620,288108,217440,304416,250056,331596,298980,315288,353340,347904,413136,298980,250056,277236,201132,288108,222876,315288,298980,266364,380520,342468,391392,293544,271800,244620,201132,266364,239184,326160,315288,271800,364212,337032,434880,347904,212004,212004,212004,250056,250056,337032,309852,277236,347904,320724,462060,364212,212004,222876,184824,255492,293544,369648,364212,293544,342468,304416,434880,331596,266364,239184,179388,266364,320724,375084,353340,260928,375084,293544,451188,375084,271800,250056,168516,266364,255492,385956,385956,293544,380520,282672,440316,375084,277236,212004,146772,288108,277236,364212,418572,309852,347904,260928,451188) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 293544 326160 298980 293544 347904 364212 331596 375084 375084 NA [2,] 282672 244620 250056 271800 212004 212004 266364 271800 277236 NA [3,] 298980 288108 277236 244620 212004 222876 239184 250056 212004 NA [4,] 239184 217440 201132 201132 212004 184824 179388 168516 146772 NA [5,] 309852 304416 288108 266364 250056 255492 266364 266364 288108 NA [6,] 304416 250056 222876 239184 250056 293544 320724 255492 277236 NA [7,] 326160 331596 315288 326160 337032 369648 375084 385956 364212 NA [8,] 337032 298980 298980 315288 309852 364212 353340 385956 418572 NA [9,] 375084 315288 266364 271800 277236 293544 260928 293544 309852 NA [10,] 326160 353340 380520 364212 347904 342468 375084 380520 347904 NA [11,] 309852 347904 342468 337032 320724 304416 293544 282672 260928 NA [12,] 385956 413136 391392 434880 462060 434880 451188 440316 451188 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -10872 -81540 -48924 -21744 -135900 -152208 -65232 -103284 -97848 NA [2,] 16308 43488 27180 -27180 0 10872 -27180 -21744 -65232 NA [3,] -59796 -70668 -76104 -43488 0 -38052 -59796 -81540 -65232 NA [4,] 70668 86976 86976 65232 38052 70668 86976 97848 141336 NA [5,] -5436 -54360 -65232 -27180 0 38052 54360 -10872 -10872 NA [6,] 21744 81540 92412 86976 86976 76104 54360 130464 86976 NA [7,] 10872 -32616 -16308 -10872 -27180 -5436 -21744 0 54360 NA [8,] 38052 16308 -32616 -43488 -32616 -70668 -92412 -92412 -108720 NA [9,] -48924 38052 114156 92412 70668 48924 114156 86976 38052 NA [10,] -16308 -5436 -38052 -27180 -27180 -38052 -81540 -97848 -86976 NA [11,] 76104 65232 48924 97848 141336 130464 157644 157644 190260 NA [12,] -59796 -114156 -97848 -86976 -97848 -103284 -76104 -65232 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/fisher/rcomp/tmp/1xs341377073773.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/fisher/rcomp/tmp/2pld71377073773.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/fisher/rcomp/tmp/3fxgq1377073773.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/fisher/rcomp/tmp/4d28u1377073773.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,] 293544 212004 212004 146772 250056 222876 315288 298980 260928 326160 [2,] 298980 244620 222876 179388 266364 250056 326160 309852 271800 347904 [3,] 331596 266364 244620 201132 266364 255492 337032 337032 293544 353340 [4,] 364212 271800 277236 212004 288108 293544 369648 364212 309852 375084 [5,] 375084 282672 298980 239184 309852 320724 385956 418572 315288 380520 [,11] [,12] [1,] 260928 385956 [2,] 293544 413136 [3,] 309852 434880 [4,] 337032 451188 [5,] 347904 462060 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 297240.5 252049.2 215990.4 183954.2 254912.2 232588.3 314128.3 308402.4 [2,] 365951.5 280678.8 273249.6 218309.8 277815.8 278395.7 359935.7 365661.6 [,9] [,10] [,11] [,12] [1,] 273503.3 339025.2 286948.3 414839.3 [2,] 313584.7 367654.8 332755.7 454920.7 $out [1] 375084 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(293544, 298980, 331596, 364212, 375084, 212004, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5amcs1377073773.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,] -152208 -65232 -81540 65232 -65232 76104 -32616 -108720 38052 -97848 [2,] -103284 -27180 -70668 70668 -27180 76104 -21744 -92412 38052 -81540 [3,] -81540 0 -59796 86976 -10872 86976 -10872 -43488 70668 -38052 [4,] -48924 16308 -43488 86976 0 86976 0 -32616 92412 -27180 [5,] -10872 43488 -38052 97848 38052 92412 10872 38052 114156 -5436 [,11] [,12] [1,] 48924 -114156 [2,] 76104 -100566 [3,] 130464 -92412 [4,] 157644 -70668 [5,] 190260 -59796 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -110169.6 -22903.68 -74110.8 78387.12 -25186.8 81250.08 -22323.84 [2,] -52910.4 22903.68 -45481.2 95564.88 3442.8 92701.92 579.84 [,8] [,9] [,10] [,11] [,12] [1,] -74980.56 42038.4 -66681.6 87519.6 -109113.45 [2,] -11995.44 99297.6 -9422.4 173408.4 -75710.55 $out [1] 0 38052 141336 54360 21744 54360 130464 54360 -48924 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-152208, -103284, -81540, -48924, -10872, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/64nyq1377073773.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] [1,] 282672 217440 201132 201132 212004 184824 179388 168516 146772 NA [2,] 296262 269082 258210 255492 231030 239184 263646 260928 269082 NA [3,] 309852 309852 293544 282672 293544 298980 307134 288108 298980 NA [4,] 331596 339750 328878 331596 342468 364212 364212 383238 369648 NA [5,] 375084 413136 391392 434880 462060 434880 451188 440316 451188 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 293735.9 277619.9 261311.9 247960.5 242716.4 241953.9 261265.2 232321.6 [2,] 325968.1 342084.1 325776.1 317383.5 344371.6 356006.1 353002.8 343894.4 [,9] [,10] [1,] 253111.2 NA [2,] 344848.8 NA $out [1] 239184 385956 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(282672, 296262, 309852, 331596, 375084, 217440, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7x8ps1377073773.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,] 194488 201132 195696 [2,] 261230 260928 265005 [3,] 303510 301698 303057 [4,] 345186 337032 342468 [5,] 429444 434880 432162 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 265217.1 266986.5 267725.6 [2,] 341802.9 336409.5 338388.4 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1xs341377073773.ps tmp/1xs341377073773.png",intern=TRUE)) character(0) > try(system("convert tmp/2pld71377073773.ps tmp/2pld71377073773.png",intern=TRUE)) character(0) > try(system("convert tmp/3fxgq1377073773.ps tmp/3fxgq1377073773.png",intern=TRUE)) character(0) > try(system("convert tmp/4d28u1377073773.ps tmp/4d28u1377073773.png",intern=TRUE)) character(0) > try(system("convert tmp/5amcs1377073773.ps tmp/5amcs1377073773.png",intern=TRUE)) character(0) > try(system("convert tmp/64nyq1377073773.ps tmp/64nyq1377073773.png",intern=TRUE)) character(0) > try(system("convert tmp/7x8ps1377073773.ps tmp/7x8ps1377073773.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.212 0.609 3.801