R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570,596594,580523,564478,557560,575093,580112,574761,563250,551531,537034,544686,600991,604378,586111,563668,548604,551174,555654,547970,540324,530577,520579,518654,572273,581302,563280,547612,538712,540735,561649,558685,545732,536352,527676,530455,581744,598714,583775,571477,563278,564872,577537,572399,565430,560619,551227,553397,610893,621668,613148,598778,590623,595902,612186,603453,593362,581940,568075,567467,619423,627325,617144,602280,590816,589812) > 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,] 516922 528222 580112 555654 561649 577537 612186 NA [2,] 507561 532638 574761 547970 558685 572399 603453 NA [3,] 492622 536322 563250 540324 545732 565430 593362 NA [4,] 490243 536535 551531 530577 536352 560619 581940 NA [5,] 469357 523597 537034 520579 527676 551227 568075 NA [6,] 477580 536214 544686 518654 530455 553397 567467 NA [7,] 528379 586570 600991 572273 581744 610893 619423 NA [8,] 533590 596594 604378 581302 598714 621668 627325 NA [9,] 517945 580523 586111 563280 583775 613148 617144 NA [10,] 506174 564478 563668 547612 571477 598778 602280 NA [11,] 501866 557560 548604 538712 563278 590623 590816 NA [12,] 516141 575093 551174 540735 564872 595902 589812 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -9361 4416 -5351 -7684 -2964 -5138 -8733 NA [2,] -14939 3684 -11511 -7646 -12953 -6969 -10091 NA [3,] -2379 213 -11719 -9747 -9380 -4811 -11422 NA [4,] -20886 -12938 -14497 -9998 -8676 -9392 -13865 NA [5,] 8223 12617 7652 -1925 2779 2170 -608 NA [6,] 50799 50356 56305 53619 51289 57496 51956 NA [7,] 5211 10024 3387 9029 16970 10775 7902 NA [8,] -15645 -16071 -18267 -18022 -14939 -8520 -10181 NA [9,] -11771 -16045 -22443 -15668 -12298 -14370 -14864 NA [10,] -4308 -6918 -15064 -8900 -8199 -8155 -11464 NA [11,] 14275 17533 2570 2023 1594 5279 -1004 NA [12,] 12081 5019 4480 20914 12665 16284 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/1im1m1445635913.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/2qh1l1445635913.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/3deoi1445635913.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/41bh01445635913.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] [1,] 516922.0 507561 536322 530577.0 520579.0 518654.0 572273.0 581302 563280.0 [2,] 541938.0 540304 538323 533464.5 522088.0 524554.5 577008.5 588948 571901.5 [3,] 561649.0 558685 545732 536535.0 527676.0 536214.0 586570.0 598714 583775.0 [4,] 578824.5 573580 564340 556075.0 544130.5 549041.5 605942.0 613023 599629.5 [5,] 612186.0 603453 593362 581940.0 568075.0 567467.0 619423.0 627325 617144.0 [,10] [,11] [,12] [1,] 547612.0 501866.0 516141.0 [2,] 555640.0 543658.0 545954.5 [3,] 564478.0 557560.0 564872.0 [4,] 585127.5 576950.5 582452.5 [5,] 602280.0 590816.0 595902.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,] 539621 538813.1 530195.1 523032.4 514512.6 521590.8 569291.4 584336.8 [2,] 583677 578556.9 561268.9 550037.6 540839.4 550837.2 603848.6 613091.2 [,9] [,10] [,11] [,12] [1,] 567216.3 546868.5 537678.3 543076 [2,] 600333.7 582087.5 577441.7 586668 $out [1] 492622 490243 469357 477580 528379 533590 517945 506174 $group [1] 3 4 5 6 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(516922, 541938, 561649, 578824.5, 612186, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56qol1445635913.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] [1,] -9361.0 -14939.0 -11719.0 -20886 -1925.0 50356 3387.0 -18267.0 -16045.0 [2,] -8208.5 -12232.0 -10584.5 -14181 781.0 51044 6556.5 -17046.5 -15856.5 [3,] -5351.0 -10091.0 -9380.0 -12938 2779.0 51956 9029.0 -15645.0 -14864.0 [4,] -4051.0 -7307.5 -3595.0 -9695 7937.5 54962 10399.5 -12560.0 -13334.0 [5,] -2964.0 -6969.0 213.0 -8676 12617.0 57496 10775.0 -8520.0 -11771.0 [,10] [,11] [,12] [1,] -11464.0 -1004.0 4480 [2,] -10182.0 1808.5 5019 [3,] -8199.0 2570.0 12373 [4,] -7536.5 9777.0 16284 [5,] -4308.0 17533.0 20914 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7833.792 -13031.832 -13554.017 -15616.97 -1494.746 49616.23 6734.022 [2,] -2868.208 -7150.168 -5205.983 -10259.03 7052.746 54295.77 11323.978 [,8] [,9] [,10] [,11] [,12] [1,] -18324.27 -16370.4 -9778.85 -2188.66 5106.711 [2,] -12965.73 -13357.6 -6619.15 7328.66 19639.289 $out [1] 4416 3684 16970 -22443 -15064 $group [1] 1 2 7 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-9361, -8208.5, -5351, -4051, -2964, -14939, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l1zw1445635913.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,] 469357.0 523597.0 537034.0 518654.0 527676.0 551227.0 567467 NA [2,] 491432.5 534426.0 549889.0 534644.5 541042.0 563024.5 585876 NA [3,] 506867.5 547047.5 563459.0 544173.5 562463.5 584080.0 597821 NA [4,] 517433.5 577808.0 583111.5 559467.0 576610.5 604835.5 614665 NA [5,] 533590.0 596594.0 604378.0 581302.0 598714.0 621668.0 627325 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 495008.3 527260.7 548306 532851.8 546240.5 565009.7 584690.1 NA [2,] 518726.7 566834.3 578612 555495.2 578686.5 603150.3 610951.9 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(469357, 491432.5, 506867.5, 517433.5, 533590, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7bom51445635913.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,] 528220.7 527676.0 533109.2 [2,] 544631.4 541133.5 548050.6 [3,] 559267.8 560167.0 560342.8 [4,] 572599.5 574323.5 578074.6 [5,] 594795.9 598714.0 600985.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 546511.3 545028.8 546648.6 [2,] 572024.2 575305.2 574036.9 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(528220.714285714, 544631.357142857, 559267.785714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1im1m1445635913.ps tmp/1im1m1445635913.png",intern=TRUE)) character(0) > try(system("convert tmp/2qh1l1445635913.ps tmp/2qh1l1445635913.png",intern=TRUE)) character(0) > try(system("convert tmp/3deoi1445635913.ps tmp/3deoi1445635913.png",intern=TRUE)) character(0) > try(system("convert tmp/41bh01445635913.ps tmp/41bh01445635913.png",intern=TRUE)) character(0) > try(system("convert tmp/56qol1445635913.ps tmp/56qol1445635913.png",intern=TRUE)) character(0) > try(system("convert tmp/6l1zw1445635913.ps tmp/6l1zw1445635913.png",intern=TRUE)) character(0) > try(system("convert tmp/7bom51445635913.ps tmp/7bom51445635913.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.569 0.476 3.070