R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(340.4,343.2,345,346.6,348.7,351.1,352.7,354.8,359.8,364.4,366.2,368.8,369.6,370.6,374.2,378.1,381,383.2,387.3,391.4,395.1,399.1,403,406.3,410.2,413.3,418.4,421.4,422.5,425.5,427.3,430.7,433.2,437.5,439.9,443,445.6,446.2,449.3,453.9,458,461.2,463.7,466,468.3,471.7,474.7,477.3,479.8,482.6,485.6,488.5,492,494.8,498.3,502.1,505.8,511.7,516.6,521.3,526.1,530.4,534.7,538.4,544.6,547.7,551.4,554.3,557.5,560.7,563.8,566.2,567.2,569.3,570.9,573,575.1,578.1,581,584.4) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 80 > (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] 7 7 7 7 7 7 7 7 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 340.4 369.6 410.2 445.6 479.8 526.1 567.2 [2,] 343.2 370.6 413.3 446.2 482.6 530.4 569.3 [3,] 345.0 374.2 418.4 449.3 485.6 534.7 570.9 [4,] 346.6 378.1 421.4 453.9 488.5 538.4 573.0 [5,] 348.7 381.0 422.5 458.0 492.0 544.6 575.1 [6,] 351.1 383.2 425.5 461.2 494.8 547.7 578.1 [7,] 352.7 387.3 427.3 463.7 498.3 551.4 581.0 [8,] 354.8 391.4 430.7 466.0 502.1 554.3 584.4 [9,] 359.8 395.1 433.2 468.3 505.8 557.5 NA [10,] 364.4 399.1 437.5 471.7 511.7 560.7 NA [11,] 366.2 403.0 439.9 474.7 516.6 563.8 NA [12,] 368.8 406.3 443.0 477.3 521.3 566.2 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.8 1.0 3.1 0.6 2.8 4.3 2.1 [2,] 1.8 3.6 5.1 3.1 3.0 4.3 1.6 [3,] 1.6 3.9 3.0 4.6 2.9 3.7 2.1 [4,] 2.1 2.9 1.1 4.1 3.5 6.2 2.1 [5,] 2.4 2.2 3.0 3.2 2.8 3.1 3.0 [6,] 1.6 4.1 1.8 2.5 3.5 3.7 2.9 [7,] 2.1 4.1 3.4 2.3 3.8 2.9 3.4 [8,] 5.0 3.7 2.5 2.3 3.7 3.2 NA [9,] 4.6 4.0 4.3 3.4 5.9 3.2 NA [10,] 1.8 3.9 2.4 3.0 4.9 3.1 NA [11,] 2.6 3.3 3.1 2.6 4.7 2.4 NA [12,] 0.8 3.9 2.6 2.5 4.8 1.0 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/1gyuw1457453631.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/2jdqt1457453631.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/3kuya1457453631.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/4q44f1457453631.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] [1,] 340.40 343.20 345.00 346.60 348.70 351.10 352.70 354.80 359.80 364.4 366.2 [2,] 389.90 391.95 396.30 399.75 401.75 404.35 407.30 411.05 395.10 399.1 403.0 [3,] 445.60 446.20 449.30 453.90 458.00 461.20 463.70 466.00 450.75 454.6 457.3 [4,] 502.95 506.50 510.15 513.45 518.30 521.25 524.85 528.20 505.80 511.7 516.6 [5,] 567.20 569.30 570.90 573.00 575.10 578.10 581.00 584.40 557.50 560.7 563.8 [,12] [1,] 368.80 [2,] 406.30 [3,] 460.15 [4,] 521.30 [5,] 566.20 $n [1] 7 7 7 7 7 7 7 7 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 378.0884 377.7926 381.3106 386.0002 388.3982 391.3892 393.501 396.0399 [2,] 513.1116 514.6074 517.2894 521.7998 527.6018 531.0108 533.899 535.9601 [,9] [,10] [,11] [,12] [1,] 379.3449 381.9694 384.0243 385.9713 [2,] 522.1551 527.2306 530.5757 534.3287 $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(340.4, 389.9, 445.6, 502.95, 567.2, 343.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59f1y1457453631.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,] 0.60 1.60 1.6 1.1 2.20 1.60 2.1 2.30 3.20 1.80 2.40 0.80 [2,] 1.55 2.40 2.5 2.1 2.60 2.15 2.6 2.50 3.40 2.40 2.60 1.00 [3,] 2.80 3.10 3.0 2.9 3.00 2.90 3.4 3.45 4.15 3.05 2.85 2.55 [4,] 2.95 3.95 3.8 3.8 3.05 3.60 3.6 3.70 4.60 3.90 3.30 3.90 [5,] 4.30 5.10 4.6 6.2 3.20 4.10 4.1 5.00 5.90 4.90 3.30 4.80 $n [1] 7 7 7 7 7 7 7 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.963943 2.174365 2.223661 1.884787 2.731267 2.034083 2.802816 2.675961 [2,] 3.636057 4.025635 3.776339 3.915213 3.268733 3.765917 3.997184 4.224039 [,9] [,10] [,11] [,12] [1,] 3.375961 2.082452 2.398477 0.6794063 [2,] 4.924039 4.017548 3.301523 4.4205937 $out [1] 4.7 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.599999999999966, 1.54999999999995, 2.80000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kg7q1457453631.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,] 340.4 369.60 410.20 445.60 479.80 526.10 567.20 [2,] 345.8 376.15 419.90 451.60 487.05 536.55 570.10 [3,] 351.9 385.25 426.40 462.45 496.55 549.55 574.05 [4,] 362.1 397.10 435.35 470.00 508.75 559.10 579.55 [5,] 368.8 406.30 443.00 477.30 521.30 566.20 584.40 $n [1] 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 344.4655 375.6946 419.3532 454.0576 486.6525 539.2648 568.7711 [2,] 359.3345 394.8054 433.4468 470.8424 506.4475 559.8352 579.3289 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(340.4, 345.8, 351.9, 362.1, 368.8, 369.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7x2wr1457453631.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,] 448.4143 445.600 446.4250 [2,] 453.6488 450.025 451.8750 [3,] 458.8940 455.950 457.8875 [4,] 463.4512 460.675 462.8438 [5,] 469.1000 466.000 469.6250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 454.4231 451.0925 452.8846 [2,] 463.3650 460.8075 462.8904 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(448.414285714286, 453.64880952381, 458.894047619048, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gyuw1457453631.ps tmp/1gyuw1457453631.png",intern=TRUE)) character(0) > try(system("convert tmp/2jdqt1457453631.ps tmp/2jdqt1457453631.png",intern=TRUE)) character(0) > try(system("convert tmp/3kuya1457453631.ps tmp/3kuya1457453631.png",intern=TRUE)) character(0) > try(system("convert tmp/4q44f1457453631.ps tmp/4q44f1457453631.png",intern=TRUE)) character(0) > try(system("convert tmp/59f1y1457453631.ps tmp/59f1y1457453631.png",intern=TRUE)) character(0) > try(system("convert tmp/6kg7q1457453631.ps tmp/6kg7q1457453631.png",intern=TRUE)) character(0) > try(system("convert tmp/7x2wr1457453631.ps tmp/7x2wr1457453631.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.645 0.419 3.099