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(81432,81935,82229,82963,82975,82892,82692,82648,83479,84176,84589,84857,84586,84635,84927,85563,86962,87780,88515,88800,89218,89626,89939,90663,91302,91560,92290,93281,94535,94855,95536,96008,96627,96738,96212,94198,93123,93022,93993,94876,95251,96216,96632,97023,97799,98001,98069,98172,98448,98157,98009,98020,97802,98006,98262,98629,99043,99289,99682,99979) > 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,] 81432 84586 91302 93123 98448 NA [2,] 81935 84635 91560 93022 98157 NA [3,] 82229 84927 92290 93993 98009 NA [4,] 82963 85563 93281 94876 98020 NA [5,] 82975 86962 94535 95251 97802 NA [6,] 82892 87780 94855 96216 98006 NA [7,] 82692 88515 95536 96632 98262 NA [8,] 82648 88800 96008 97023 98629 NA [9,] 83479 89218 96627 97799 99043 NA [10,] 84176 89626 96738 98001 99289 NA [11,] 84589 89939 96212 98069 99682 NA [12,] 84857 90663 94198 98172 99979 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 503 49 258 -101 -291 NA [2,] 294 292 730 971 -148 NA [3,] 734 636 991 883 11 NA [4,] 12 1399 1254 375 -218 NA [5,] -83 818 320 965 204 NA [6,] -200 735 681 416 256 NA [7,] -44 285 472 391 367 NA [8,] 831 418 619 776 414 NA [9,] 697 408 111 202 246 NA [10,] 413 313 -526 68 393 NA [11,] 268 724 -2014 103 297 NA [12,] -271 639 -1075 276 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/11ycj1457472061.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/2kvzn1457472061.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/31k8a1457472061.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/46vcx1457472061.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,] 81432 81935 82229 82963 82975 82892 82692 82648 83479 84176 84589 84857 [2,] 84586 84635 84927 85563 86962 87780 88515 88800 89218 89626 89939 90663 [3,] 91302 91560 92290 93281 94535 94855 95536 96008 96627 96738 96212 94198 [4,] 93123 93022 93993 94876 95251 96216 96632 97023 97799 98001 98069 98172 [5,] 98448 98157 98009 98020 97802 98006 98262 98629 99043 99289 99682 99979 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85269.78 85633.77 85883.99 86700.46 88678.01 88894.14 89800.55 [2,] 97334.22 97486.23 98696.01 99861.54 100391.99 100815.86 101271.45 [,8] [,9] [,10] [,11] [,12] [1,] 90197.65 90563.69 90820.25 90467.36 88892.16 [2,] 101818.35 102690.31 102655.75 101956.64 99503.84 $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(81432, 84586, 91302, 93123, 98448, 81935, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lx931457472061.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,] -291 -148 636 -218 -83 -200 285 414 111 68 103 -1075.0 [2,] -101 292 636 12 204 256 285 418 202 68 103 -673.0 [3,] 49 294 734 375 320 416 367 619 246 313 268 2.5 [4,] 258 730 883 1254 818 681 391 776 408 393 297 457.5 [5,] 503 971 991 1399 965 735 472 831 697 413 297 639.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -204.6685 -15.4897 559.4704 -502.5941 -113.8509 115.6961 292.1007 366.0381 [2,] 302.6685 603.4897 908.5296 1252.5941 753.8509 716.3039 441.8993 871.9619 [,9] [,10] [,11] [,12] [1,] 100.4409 83.35582 130.9201 -890.595 [2,] 391.5591 542.64418 405.0799 895.595 $out [1] 11 -44 -526 724 -2014 $group [1] 3 7 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-291, -101, 49, 258, 503, -148, 292, 294, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6r3j11457472061.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,] 81432.0 84586.0 91302.0 93022.0 97802.0 NA [2,] 82438.5 85245.0 92785.5 94434.5 98014.5 NA [3,] 82927.5 88147.5 94695.0 96424.0 98355.0 NA [4,] 83827.5 89422.0 96110.0 97900.0 99166.0 NA [5,] 84857.0 90663.0 96738.0 98172.0 99979.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 82293.97 86242.34 93178.67 94843.36 97829.79 NA [2,] 83561.03 90052.66 96211.33 98004.64 98880.21 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(81432, 82438.5, 82927.5, 83827.5, 84857, 84586, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79rhx1457472061.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,] 89778.2 91302.0 88828.50 [2,] 90615.1 92785.5 89839.75 [3,] 92138.6 94695.0 92285.75 [4,] 93399.6 96110.0 93661.00 [5,] 93698.2 96738.0 94417.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 90868.57 93178.67 90542.85 [2,] 93408.63 96211.33 94028.65 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(89778.2, 90615.1, 92138.6, 93399.6, 93698.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11ycj1457472061.ps tmp/11ycj1457472061.png",intern=TRUE)) character(0) > try(system("convert tmp/2kvzn1457472061.ps tmp/2kvzn1457472061.png",intern=TRUE)) character(0) > try(system("convert tmp/31k8a1457472061.ps tmp/31k8a1457472061.png",intern=TRUE)) character(0) > try(system("convert tmp/46vcx1457472061.ps tmp/46vcx1457472061.png",intern=TRUE)) character(0) > try(system("convert tmp/5lx931457472061.ps tmp/5lx931457472061.png",intern=TRUE)) character(0) > try(system("convert tmp/6r3j11457472061.ps tmp/6r3j11457472061.png",intern=TRUE)) character(0) > try(system("convert tmp/79rhx1457472061.ps tmp/79rhx1457472061.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.886 0.542 3.461