R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(324,336,327,302,299,311,315,264,278,278,287,279,324,354,354,360,363,385,412,370,389,395,417,404,456,478,468,437,432,441,449,386,396,394,403,373,409,430,415,392,401,400,447,392,427,444,448,427,480,490,482,490,485,498,544,483,508,529,547,543,608,638,661,650,654,678,725,644,670,662,641,642) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 324 324 456 409 480 608 NA [2,] 336 354 478 430 490 638 NA [3,] 327 354 468 415 482 661 NA [4,] 302 360 437 392 490 650 NA [5,] 299 363 432 401 485 654 NA [6,] 311 385 441 400 498 678 NA [7,] 315 412 449 447 544 725 NA [8,] 264 370 386 392 483 644 NA [9,] 278 389 396 427 508 670 NA [10,] 278 395 394 444 529 662 NA [11,] 287 417 403 448 547 641 NA [12,] 279 404 373 427 543 642 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 12 30 22 21 10 30 NA [2,] -9 0 -10 -15 -8 23 NA [3,] -25 6 -31 -23 8 -11 NA [4,] -3 3 -5 9 -5 4 NA [5,] 12 22 9 -1 13 24 NA [6,] 4 27 8 47 46 47 NA [7,] -51 -42 -63 -55 -61 -81 NA [8,] 14 19 10 35 25 26 NA [9,] 0 6 -2 17 21 -8 NA [10,] 9 22 9 4 18 -21 NA [11,] -8 -13 -30 -21 -4 1 NA [12,] 45 52 36 53 65 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/1lqqn1413132957.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/2txkp1413132957.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/3umzx1413132957.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/4lpji1413132957.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,] 324.0 336 327.0 302.0 299.0 311.0 315 264 278.0 278.0 287.0 279.0 [2,] 324.0 354 354.0 360.0 363.0 385.0 412 370 389.0 394.0 403.0 373.0 [3,] 432.5 454 441.5 414.5 416.5 420.5 448 389 411.5 419.5 432.5 415.5 [4,] 480.0 490 482.0 490.0 485.0 498.0 544 483 508.0 529.0 547.0 543.0 [5,] 608.0 638 661.0 650.0 654.0 498.0 725 644 670.0 662.0 641.0 642.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 331.875 366.2756 358.9359 330.6458 337.8061 347.6114 362.8557 316.1114 [2,] 533.125 541.7244 524.0641 498.3542 495.1939 493.3886 533.1443 461.8886 [,9] [,10] [,11] [,12] [1,] 334.7412 332.4206 339.6153 305.8445 [2,] 488.2588 506.5794 525.3847 525.1555 $out [1] 678 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(324, 324, 432.5, 480, 608, 336, 354, 454, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55kyz1413132957.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,] 10.0 -15.0 -31 -5 -1.0 4.0 -81 10 -8 4 -30.0 36 [2,] 12.0 -10.0 -25 -5 9.0 8.0 -63 14 -2 4 -21.0 45 [3,] 21.5 -8.5 -17 0 12.5 36.5 -58 22 3 9 -10.5 52 [4,] 30.0 0.0 6 4 22.0 47.0 -51 26 17 18 -4.0 53 [5,] 30.0 0.0 8 9 24.0 47.0 -42 35 21 22 1.0 65 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.889419 -14.950323 -36.996001 -5.805291 4.11458 11.34374 -65.74039 [2,] 33.110581 -2.049677 2.996001 5.805291 20.88542 61.65626 -50.25961 [,8] [,9] [,10] [,11] [,12] [1,] 14.25961 -9.255614 -0.03045219 -21.4655491 46.34722 [2,] 29.74039 15.255614 18.03045219 0.4655491 57.65278 $out [1] 23 -21 $group [1] 2 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(10, 12, 21.5, 30, 30, -15, -10, -8.5, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j5qr1413132957.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] [1,] 264.0 324.0 373.0 392.0 480 608.0 NA [2,] 278.5 357.0 395.0 400.5 484 641.5 NA [3,] 300.5 377.5 434.5 421.0 494 652.0 NA [4,] 319.5 399.5 452.5 437.0 536 666.0 NA [5,] 336.0 417.0 478.0 448.0 547 678.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 281.7996 358.1155 408.2739 404.3521 470.2825 640.8254 NA [2,] 319.2004 396.8845 460.7261 437.6479 517.7175 663.1746 NA $out [1] 725 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(264, 278.5, 300.5, 319.5, 336, 324, 357, 377.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/743m71413132957.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,] 423.1667 389 409.6250 [2,] 438.7500 415 422.2500 [3,] 447.5000 420 433.1250 [4,] 453.2500 437 449.1875 [5,] 457.1667 454 470.5000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 440.8865 409.9657 420.8386 [2,] 454.1135 430.0343 445.4114 $out [1] 482 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(423.166666666667, 438.75, 447.5, 453.25, 457.166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lqqn1413132957.ps tmp/1lqqn1413132957.png",intern=TRUE)) character(0) > try(system("convert tmp/2txkp1413132957.ps tmp/2txkp1413132957.png",intern=TRUE)) character(0) > try(system("convert tmp/3umzx1413132957.ps tmp/3umzx1413132957.png",intern=TRUE)) character(0) > try(system("convert tmp/4lpji1413132957.ps tmp/4lpji1413132957.png",intern=TRUE)) character(0) > try(system("convert tmp/55kyz1413132957.ps tmp/55kyz1413132957.png",intern=TRUE)) character(0) > try(system("convert tmp/6j5qr1413132957.ps tmp/6j5qr1413132957.png",intern=TRUE)) character(0) > try(system("convert tmp/743m71413132957.ps tmp/743m71413132957.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.425 0.386 2.841