R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(435,431,434,439,455,452,426,428,433,438,442,446,442,436,444,454,469,471,443,437,444,451,457,460,454,439,441,446,459,456,433,424,430,428,424,419,409,397,397,401,413,413,390,385,397,398,406,412,409,404,412,418,434,431,406,416,424,427,438,444,442,443,453,471,476,476,461,462,460,463,467,468,465,459,465,471,472,472,456,455,456,462,463,461) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 435 442 454 409 409 442 465 NA [2,] 431 436 439 397 404 443 459 NA [3,] 434 444 441 397 412 453 465 NA [4,] 439 454 446 401 418 471 471 NA [5,] 455 469 459 413 434 476 472 NA [6,] 452 471 456 413 431 476 472 NA [7,] 426 443 433 390 406 461 456 NA [8,] 428 437 424 385 416 462 455 NA [9,] 433 444 430 397 424 460 456 NA [10,] 438 451 428 398 427 463 462 NA [11,] 442 457 424 406 438 467 463 NA [12,] 446 460 419 412 444 468 461 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -4 -6 -15 -12 -5 1 -6 NA [2,] 3 8 2 0 8 10 6 NA [3,] 5 10 5 4 6 18 6 NA [4,] 16 15 13 12 16 5 1 NA [5,] -3 2 -3 0 -3 0 0 NA [6,] -26 -28 -23 -23 -25 -15 -16 NA [7,] 2 -6 -9 -5 10 1 -1 NA [8,] 5 7 6 12 8 -2 1 NA [9,] 5 7 -2 1 3 3 6 NA [10,] 4 6 -4 8 11 4 1 NA [11,] 4 3 -5 6 6 1 -2 NA [12,] -4 -6 -10 -3 -2 -3 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/1w62f1358296772.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/2zqk51358296772.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/3jt5p1358296772.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/4sftw1358296772.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] [,11] [,12] [1,] 409 397.0 397.0 401.0 413.0 413.0 390.0 385 397 398.0 406 412.0 [2,] 422 417.5 423.0 428.5 444.5 441.5 416.0 420 427 427.5 431 431.5 [3,] 442 436.0 441.0 446.0 459.0 456.0 433.0 428 433 438.0 442 446.0 [4,] 448 441.0 448.5 462.5 470.5 471.5 449.5 446 450 456.5 460 460.5 [5,] 465 459.0 465.0 471.0 476.0 476.0 461.0 462 460 463.0 467 468.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 426.4732 421.9662 425.7718 425.6957 443.4732 438.0845 412.9943 412.4732 [2,] 457.5268 450.0338 456.2282 466.3043 474.5268 473.9155 453.0057 443.5268 [,9] [,10] [,11] [,12] [1,] 419.2648 420.6817 424.6817 428.6817 [2,] 446.7352 455.3183 459.3183 463.3183 $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(409, 422, 442, 448, 465, 397, 417.5, 436, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/56pxm1358296772.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] [,12] [1,] -15.0 0.0 4 1.0 -3 -28.0 -9.0 -2.0 -2.0 -4.0 -5.0 -10.0 [2,] -9.0 2.5 5 8.5 -3 -25.5 -5.5 3.0 2.0 2.5 -0.5 -6.0 [3,] -6.0 6.0 6 13.0 0 -23.0 -1.0 6.0 3.0 4.0 3.0 -3.5 [4,] -4.5 8.0 8 15.5 0 -19.5 1.5 7.5 5.5 7.0 5.0 -3.0 [5,] 1.0 10.0 10 16.0 2 -15.0 10.0 12.0 7.0 11.0 6.0 -2.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8.687327 2.715489 4.208448 8.819713 -1.791552 -26.5831 -5.180287 [2,] -3.312673 9.284511 7.791552 17.180287 1.791552 -19.4169 3.180287 [,8] [,9] [,10] [,11] [,12] [1,] 3.312673 0.9098565 1.312673 -0.2845113 -5.435097 [2,] 8.687327 5.0901435 6.687327 6.2845113 -1.564903 $out [1] 18 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-15, -9, -6, -4.5, 1, 0, 2.5, 6, 8, 10, 4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6k63l1358296772.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] [1,] 426.0 436.0 419 385.0 404.0 442.0 455.0 NA [2,] 432.0 442.5 426 397.0 410.5 456.5 457.5 NA [3,] 436.5 447.5 436 399.5 421.0 462.5 462.5 NA [4,] 444.0 458.5 450 410.5 432.5 469.5 468.0 NA [5,] 455.0 471.0 459 413.0 444.0 476.0 472.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 431.0267 440.2023 425.0534 393.3426 410.9657 456.5706 457.7109 NA [2,] 441.9733 454.7977 446.9466 405.6574 431.0343 468.4294 467.2891 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(426, 432, 436.5, 444, 455, 436, 442.5, 447.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7w7wz1358296772.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,] 429.5714 428.0 429.25 [2,] 432.7857 434.5 434.00 [3,] 437.3571 441.5 440.25 [4,] 443.5714 446.0 445.75 [5,] 454.0000 459.0 457.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 432.4377 436.2548 434.8907 [2,] 442.2766 446.7452 445.6093 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(429.571428571429, 432.785714285714, 437.357142857143, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w62f1358296772.ps tmp/1w62f1358296772.png",intern=TRUE)) character(0) > try(system("convert tmp/2zqk51358296772.ps tmp/2zqk51358296772.png",intern=TRUE)) character(0) > try(system("convert tmp/3jt5p1358296772.ps tmp/3jt5p1358296772.png",intern=TRUE)) character(0) > try(system("convert tmp/4sftw1358296772.ps tmp/4sftw1358296772.png",intern=TRUE)) character(0) > try(system("convert tmp/56pxm1358296772.ps tmp/56pxm1358296772.png",intern=TRUE)) character(0) > try(system("convert tmp/6k63l1358296772.ps tmp/6k63l1358296772.png",intern=TRUE)) character(0) > try(system("convert tmp/7w7wz1358296772.ps tmp/7w7wz1358296772.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.521 1.000 4.523