R version 3.0.3 (2014-03-06) -- "Warm Puppy" Copyright (C) 2014 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(449,446,447,451,465,460,433,431,437,442,449,450,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) > 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,] 449 435 442 454 409 409 442 NA [2,] 446 431 436 439 397 404 443 NA [3,] 447 434 444 441 397 412 453 NA [4,] 451 439 454 446 401 418 471 NA [5,] 465 455 469 459 413 434 476 NA [6,] 460 452 471 456 413 431 476 NA [7,] 433 426 443 433 390 406 461 NA [8,] 431 428 437 424 385 416 462 NA [9,] 437 433 444 430 397 424 460 NA [10,] 442 438 451 428 398 427 463 NA [11,] 449 442 457 424 406 438 467 NA [12,] 450 446 460 419 412 444 468 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -3 -4 -6 -15 -12 -5 1 NA [2,] 1 3 8 2 0 8 10 NA [3,] 4 5 10 5 4 6 18 NA [4,] 14 16 15 13 12 16 5 NA [5,] -5 -3 2 -3 0 -3 0 NA [6,] -27 -26 -28 -23 -23 -25 -15 NA [7,] -2 2 -6 -9 -5 10 1 NA [8,] 6 5 7 6 12 8 -2 NA [9,] 5 5 7 -2 1 3 3 NA [10,] 7 4 6 -4 8 11 4 NA [11,] 1 4 3 -5 6 6 1 NA [12,] -15 -4 -6 -10 -3 -2 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/16duj1395070429.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/2myzj1395070429.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/34g3b1395070429.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/4p88v1395070429.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.0 397.0 397.0 401.0 413.0 413.0 390 416 424.0 427.0 406 412.0 [2,] 422.0 417.5 423.0 428.5 444.5 441.5 416 420 427.0 427.5 431 431.5 [3,] 442.0 436.0 441.0 446.0 459.0 456.0 433 428 433.0 438.0 442 446.0 [4,] 445.5 441.0 445.5 452.5 467.0 465.5 438 434 440.5 446.5 453 455.0 [5,] 454.0 446.0 453.0 471.0 476.0 476.0 461 437 460.0 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,] 427.9662 421.9662 427.5634 431.6676 445.5634 441.6676 419.862 419.6394 [2,] 456.0338 450.0338 454.4366 460.3324 472.4366 470.3324 446.138 436.3606 [,9] [,10] [,11] [,12] [1,] 424.938 426.6535 428.862 431.9662 [2,] 441.062 449.3465 455.138 460.0338 $out [1] 385 462 397 398 $group [1] 8 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(409, 422, 442, 445.5, 454, 397, 417.5, 436, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5x3xa1395070429.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.0 12.0 -5 -28.0 -9.0 5.0 -2 4.0 -5 -15 [2,] -9.0 1.5 4.5 12.5 -3 -26.5 -5.5 5.5 2 4.0 1 -10 [3,] -5.0 3.0 5.0 14.0 -3 -25.0 -2.0 6.0 3 6.0 3 -5 [4,] -3.5 8.0 8.0 15.5 0 -23.0 1.5 7.5 5 7.5 5 -3 [5,] 1.0 10.0 10.0 16.0 2 -23.0 10.0 8.0 7 11.0 6 -2 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8.284511 -0.8816951 2.909856 12.20845 -4.791552 -27.09014 -6.180287 [2,] -1.715489 6.8816951 7.090144 15.79155 -1.208448 -22.90986 2.180287 [,8] [,9] [,10] [,11] [,12] [1,] 4.805632 1.208448 3.909856 0.6112645 -9.5152261 [2,] 7.194368 4.791552 8.090144 5.3887355 -0.4847739 $out [1] 18 5 -15 12 -2 -4 $group [1] 3 4 6 8 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-15, -9, -5, -3.5, 1, 0, 1.5, 3, 8, 10, 4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6blii1395070429.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,] 431.0 426.0 436.0 419 385.0 404.0 442.0 NA [2,] 439.5 432.0 442.5 426 397.0 410.5 456.5 NA [3,] 448.0 436.5 447.5 436 399.5 421.0 462.5 NA [4,] 450.5 444.0 458.5 450 410.5 432.5 469.5 NA [5,] 465.0 455.0 471.0 459 413.0 444.0 476.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 442.9828 431.0267 440.2023 425.0534 393.3426 410.9657 456.5706 NA [2,] 453.0172 441.9733 454.7977 446.9466 405.6574 431.0343 468.4294 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(431, 439.5, 448, 450.5, 465, 426, 432, 436.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jhw31395070429.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,] 426.1429 428.0 427.000 [2,] 430.0714 434.5 431.500 [3,] 434.7857 441.5 435.625 [4,] 441.5714 446.0 442.625 [5,] 453.0000 459.0 455.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 429.5405 436.2548 430.5508 [2,] 440.0309 446.7452 440.6992 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(426.142857142857, 430.071428571429, 434.785714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16duj1395070429.ps tmp/16duj1395070429.png",intern=TRUE)) character(0) > try(system("convert tmp/2myzj1395070429.ps tmp/2myzj1395070429.png",intern=TRUE)) character(0) > try(system("convert tmp/34g3b1395070429.ps tmp/34g3b1395070429.png",intern=TRUE)) character(0) > try(system("convert tmp/4p88v1395070429.ps tmp/4p88v1395070429.png",intern=TRUE)) character(0) > try(system("convert tmp/5x3xa1395070429.ps tmp/5x3xa1395070429.png",intern=TRUE)) character(0) > try(system("convert tmp/6blii1395070429.ps tmp/6blii1395070429.png",intern=TRUE)) character(0) > try(system("convert tmp/7jhw31395070429.ps tmp/7jhw31395070429.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.539 1.159 6.729