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(829,721,19,311,264,120,135,435,1456,127,313,1104,585,295,4073,408,224,312,571,1336,586,2279,239,198,320,112,89,407,434,268,354,150,273,728,226,310,554,5725,303,360,129,2466,1042,456,335,866,1417,994,201,224,640,1043,293,2659,436,485,610,31127,2613,432,532) > 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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 829 585 320 554 201 532 [2,] 721 295 112 5725 224 NA [3,] 19 4073 89 303 640 NA [4,] 311 408 407 360 1043 NA [5,] 264 224 434 129 293 NA [6,] 120 312 268 2466 2659 NA [7,] 135 571 354 1042 436 NA [8,] 435 1336 150 456 485 NA [9,] 1456 586 273 335 610 NA [10,] 127 2279 728 866 31127 NA [11,] 313 239 226 1417 2613 NA [12,] 1104 198 310 994 432 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -108 -290 -208 5171 23 NA [2,] -702 3778 -23 -5422 416 NA [3,] 292 -3665 318 57 403 NA [4,] -47 -184 27 -231 -750 NA [5,] -144 88 -166 2337 2366 NA [6,] 15 259 86 -1424 -2223 NA [7,] 300 765 -204 -586 49 NA [8,] 1021 -750 123 -121 125 NA [9,] -1329 1693 455 531 30517 NA [10,] 186 -2040 -502 551 -28514 NA [11,] 791 -41 84 -423 -2181 NA [12,] -519 122 244 -793 100 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/1pw651476378930.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/2p45p1476378930.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/3d0u61476378930.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/4jyaa1476378930.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,] 201 112 19 311 129 120 135 435 273 127 226 198 [2,] 320 224 89 360 224 268 354 435 335 728 239 310 [3,] 543 295 303 407 264 312 436 456 586 866 313 432 [4,] 585 721 640 408 293 2466 571 485 610 2279 1417 994 [5,] 829 721 640 408 293 2659 571 485 610 2279 2613 1104 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 372.0664 -56.17895 -86.33521 373.0833 215.2448 -1241.101 282.6683 420.6701 [2,] 713.9336 646.17895 692.33521 440.9167 312.7552 1865.101 589.3317 491.3299 [,9] [,10] [,11] [,12] [1,] 391.6857 -229.9327 -519.3718 -51.31268 [2,] 780.3143 1961.9327 1145.3718 915.31268 $out [1] 5725 4073 1043 434 1042 1336 150 1456 31127 $group [1] 2 3 4 5 7 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(201, 320, 543, 585, 829, 112, 224, 295, 721, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5uo581476378930.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,] -290 -702 57 -231 -166 -2223 -586 -121 -1329 -2040 -423 -793 [2,] -208 -702 57 -231 -144 -1424 -204 -121 455 -2040 -423 -519 [3,] -108 -23 292 -184 88 15 49 123 531 -502 -41 100 [4,] 23 416 318 -47 2337 86 300 125 1693 186 84 122 [5,] 23 416 403 27 2366 259 765 125 1693 551 791 244 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -271.22402 -812.976 107.5781 -314.01394 -1665.068 -1051.962 -307.1251 [2,] 55.22402 766.976 476.4219 -53.98606 1841.068 1081.962 405.1251 [,8] [,9] [,10] [,11] [,12] [1,] -50.82298 -343.7677 -2074.886 -399.2449 -352.929 [2,] 296.82298 1405.7677 1070.886 317.2449 552.929 $out [1] 5171 3778 -5422 -3665 -750 1021 -750 30517 -28514 -2181 $group [1] 1 2 2 3 4 8 8 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-290, -208, -108, 23, 23, -702, -702, -23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6kh801476378930.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,] 19 198.0 89.0 129.0 201.0 532 [2,] 131 267.0 188.0 347.5 362.5 532 [3,] 312 489.5 291.5 710.0 547.5 532 [4,] 775 961.0 380.5 1229.5 1828.0 532 [5,] 1456 1336.0 434.0 2466.0 2659.0 532 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18.26728 172.9619 203.6995 307.7139 -120.9244 532 [2,] 605.73272 806.0381 379.3005 1112.2861 1215.9244 532 $out [1] 4073 2279 728 5725 31127 $group [1] 2 2 3 4 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(19, 131, 312, 775, 1456, 198, 267, 489.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72omp1476378930.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,] 268.8 264.0 258.5 [2,] 506.7 307.5 422.0 [3,] 629.8 419.5 472.5 [4,] 1094.9 499.5 740.0 [5,] 1415.4 586.0 828.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 361.518 331.9275 327.4581 [2,] 898.082 507.0725 617.5419 $out [1] 7025.4 866.0 1367.0 1503.5 $group [1] 1 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(268.8, 506.7, 629.8, 1094.9, 1415.4, 264, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pw651476378930.ps tmp/1pw651476378930.png",intern=TRUE)) character(0) > try(system("convert tmp/2p45p1476378930.ps tmp/2p45p1476378930.png",intern=TRUE)) character(0) > try(system("convert tmp/3d0u61476378930.ps tmp/3d0u61476378930.png",intern=TRUE)) character(0) > try(system("convert tmp/4jyaa1476378930.ps tmp/4jyaa1476378930.png",intern=TRUE)) character(0) > try(system("convert tmp/5uo581476378930.ps tmp/5uo581476378930.png",intern=TRUE)) character(0) > try(system("convert tmp/6kh801476378930.ps tmp/6kh801476378930.png",intern=TRUE)) character(0) > try(system("convert tmp/72omp1476378930.ps tmp/72omp1476378930.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.392 0.215 2.646