R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(272567,266674,301601,322421,313776,300156,315745,299214,295184,340003,332748,316337,293572,308713,354188,334540,313285,337881,356955,323661,296034,377623,342590,300905,309470,271492,307759,326106,335576,310485,335173,298344,288269,319410,327692,315401,277720,260573,318025,300264,317640,303273,315089,275840,292823,339759,328032,344675,260952,275466,331940,347644,338063,384283,398482,347062,350731,368799,387710,362988) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 272567 293572 309470 277720 260952 NA [2,] 266674 308713 271492 260573 275466 NA [3,] 301601 354188 307759 318025 331940 NA [4,] 322421 334540 326106 300264 347644 NA [5,] 313776 313285 335576 317640 338063 NA [6,] 300156 337881 310485 303273 384283 NA [7,] 315745 356955 335173 315089 398482 NA [8,] 299214 323661 298344 275840 347062 NA [9,] 295184 296034 288269 292823 350731 NA [10,] 340003 377623 319410 339759 368799 NA [11,] 332748 342590 327692 328032 387710 NA [12,] 316337 300905 315401 344675 362988 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -5893 15141 -37978 -17147 14514 NA [2,] 34927 45475 36267 57452 56474 NA [3,] 20820 -19648 18347 -17761 15704 NA [4,] -8645 -21255 9470 17376 -9581 NA [5,] -13620 24596 -25091 -14367 46220 NA [6,] 15589 19074 24688 11816 14199 NA [7,] -16531 -33294 -36829 -39249 -51420 NA [8,] -4030 -27627 -10075 16983 3669 NA [9,] 44819 81589 31141 46936 18068 NA [10,] -7255 -35033 8282 -11727 18911 NA [11,] -16411 -41685 -12291 16643 -24722 NA [12,] -22765 8565 -37681 -83723 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/1ue971476379269.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/22eub1476379269.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/3vzz61476379269.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/4cpvg1476379269.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] [1,] 260952 260573 301601 322421 313285 300156 315089 275840 288269 319410 [2,] 272567 266674 307759 322421 313776 303273 315745 298344 292823 339759 [3,] 277720 271492 318025 326106 317640 310485 335173 299214 295184 340003 [4,] 293572 275466 331940 334540 335576 337881 356955 323661 296034 368799 [5,] 309470 275466 354188 347644 338063 384283 398482 347062 296034 377623 [,11] [,12] [1,] 327692 300905 [2,] 328032 315401 [3,] 332748 316337 [4,] 342590 344675 [5,] 342590 362988 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 262877.9 265279.6 300938.8 317542.7 302236.2 286031.1 306054.1 281325.1 [2,] 292562.1 277704.4 335111.2 334669.3 333043.8 334938.9 364291.9 317102.9 [,9] [,10] [,11] [,12] [1,] 292915.1 319483.4 322461.4 295652.1 [2,] 297452.9 360522.6 343034.6 337021.9 $out [1] 308713 300264 350731 387710 $group [1] 2 4 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(260952, 272567, 277720, 293572, 309470, 260573, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qpu91476379269.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] [1,] -37978 34927 -19648 -21255 -25091 11816 -39249 -27627 18068 -35033 -41685 [2,] -17147 36267 -17761 -9581 -14367 14199 -39249 -10075 31141 -11727 -24722 [3,] -5893 45475 15704 -8645 -13620 15589 -36829 -4030 44819 -7255 -16411 [4,] 14514 56474 18347 9470 24596 19074 -33294 3669 46936 8282 -12291 [5,] 15141 57452 20820 17376 46220 24688 -33294 16983 46936 18911 -12291 [,12] [1,] -83723 [2,] -60702 [3,] -30223 [4,] -7100 [5,] 8565 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -28264.58 31196.78 -9809.822 -22106.389 -41151.16 12144.34 -41036.79 [2,] 16478.58 59753.22 41217.822 4816.389 13911.16 19033.66 -32621.21 [,8] [,9] [,10] [,11] [,12] [1,] -13741.476 33658.29 -21393.309 -25194.713 -72568.58 [2,] 5681.476 55979.71 6883.309 -7627.287 12122.58 $out [1] -16531 -51420 81589 16643 $group [1] 7 7 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-37978, -17147, -5893, 14514, 15141, 34927, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uun91476379269.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] [1,] 266674.0 293572.0 271492.0 260573.0 275466.0 NA [2,] 297199.0 304809.0 303051.5 285271.5 335001.5 NA [3,] 307688.5 329100.5 312943.0 309181.0 349187.5 NA [4,] 319379.0 348389.0 326899.0 323028.5 376541.0 NA [5,] 340003.0 377623.0 335576.0 344675.0 398482.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 297572.1 309223.4 302066 291959.8 330241.1 NA [2,] 317804.9 348977.6 323820 326402.2 368133.9 NA $out [1] 260952 $group [1] 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(266674, 297199, 307688.5, 319379, 340003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ll5g1476379269.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,] 276583.6 271492.0 271070.0 [2,] 306716.2 297199.0 302715.5 [3,] 324931.5 316988.5 322626.5 [4,] 335907.8 329427.0 332674.5 [5,] 349118.8 340003.0 354279.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 311617 302289.1 308962 [2,] 338246 331687.9 336291 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(276583.6, 306716.2, 324931.5, 335907.8, 349118.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ue971476379269.ps tmp/1ue971476379269.png",intern=TRUE)) character(0) > try(system("convert tmp/22eub1476379269.ps tmp/22eub1476379269.png",intern=TRUE)) character(0) > try(system("convert tmp/3vzz61476379269.ps tmp/3vzz61476379269.png",intern=TRUE)) character(0) > try(system("convert tmp/4cpvg1476379269.ps tmp/4cpvg1476379269.png",intern=TRUE)) character(0) > try(system("convert tmp/5qpu91476379269.ps tmp/5qpu91476379269.png",intern=TRUE)) character(0) > try(system("convert tmp/6uun91476379269.ps tmp/6uun91476379269.png",intern=TRUE)) character(0) > try(system("convert tmp/7ll5g1476379269.ps tmp/7ll5g1476379269.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.499 0.152 2.701