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(37729,48191,52498,57319,44377,48081,52597,53331,39587,46278,50365,57176,39251,47946,50427,54317,41210,50592,55728,59099,47519,53203,53882,55163,45255,50423,52161,54562,40971,48014,48440,44967,27218,30269,33234,36811,27745,31891,32398,34093,28358,29532,30769,32080,23951,34628,22978,35704,23090,22111,28925,35968,28963,34074,39160,51314,34527,40722,50609,52435) > 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,] 37729 39251 45255 27745 23090 NA [2,] 48191 47946 50423 31891 22111 NA [3,] 52498 50427 52161 32398 28925 NA [4,] 57319 54317 54562 34093 35968 NA [5,] 44377 41210 40971 28358 28963 NA [6,] 48081 50592 48014 29532 34074 NA [7,] 52597 55728 48440 30769 39160 NA [8,] 53331 59099 44967 32080 51314 NA [9,] 39587 47519 27218 23951 34527 NA [10,] 46278 53203 30269 34628 40722 NA [11,] 50365 53882 33234 22978 50609 NA [12,] 57176 55163 36811 35704 52435 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 10462 8695 5168 4146 -979 NA [2,] 4307 2481 1738 507 6814 NA [3,] 4821 3890 2401 1695 7043 NA [4,] -12942 -13107 -13591 -5735 -7005 NA [5,] 3704 9382 7043 1174 5111 NA [6,] 4516 5136 426 1237 5086 NA [7,] 734 3371 -3473 1311 12154 NA [8,] -13744 -11580 -17749 -8129 -16787 NA [9,] 6691 5684 3051 10677 6195 NA [10,] 4087 679 2965 -11650 9887 NA [11,] 6811 1281 3577 12726 1826 NA [12,] -17925 -9908 -9066 -12614 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/1o3we1476393569.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/2xets1476393569.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/3vcai1476393569.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/47lvd1476393569.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,] 23090 22111 28925 34093 28358 29532 30769 44967 23951 30269 22978 35704 [2,] 27745 31891 32398 35968 28963 34074 39160 44967 27218 34628 33234 36811 [3,] 37729 47946 50427 54317 40971 48014 48440 51314 34527 40722 50365 52435 [4,] 39251 48191 52161 54562 41210 48081 52597 53331 39587 46278 50609 55163 [5,] 45255 50423 52498 57319 44377 50592 55728 59099 47519 53203 53882 57176 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 29598.89 36428.46 36462.51 41178.53 32317.3 38116.69 38945.45 45404.02 [2,] 45859.11 59463.54 64391.49 67455.47 49624.7 57911.31 57934.55 57223.98 [,9] [,10] [,11] [,12] [1,] 25787.1 32490.14 38087.87 39467.52 [2,] 43266.9 48953.86 62642.13 65402.48 $out [1] 32080 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(23090, 27745, 37729, 39251, 45255, 22111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hrj11476393569.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,] -979 507 1695 -13591 1174 426 734 -17749 5684 679 1281 -17925.0 [2,] 4146 1738 2401 -13107 3704 1237 734 -16787 5684 679 1826 -15269.5 [3,] 5168 2481 3890 -12942 5111 4516 1311 -13744 6195 2965 3577 -11261.0 [4,] 8695 4307 4821 -7005 7043 5086 3371 -11580 6691 4087 6811 -9487.0 [5,] 10462 6814 7043 -5735 9382 5136 3371 -8129 6691 4087 12726 -9066.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1953.688 665.7511 2180.034 -17253.658 2751.671 1796.306 -552.2976 [2,] 8382.312 4296.2489 5599.966 -8630.342 7470.329 7235.694 3174.2976 [,8] [,9] [,10] [,11] [,12] [1,] -17423.25 5483.456 556.9158 54.61156 -15829.175 [2,] -10064.75 6906.544 5373.0842 7099.38844 -6692.825 $out [1] -3473 12154 3051 10677 -11650 9887 $group [1] 7 7 9 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-979, 4146, 5168, 8695, 10462, 507, 1738, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6bb931476393569.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,] 37729.0 39251.0 27218.0 22978.0 22111.0 NA [2,] 45327.5 47732.5 35022.5 28051.5 28944.0 NA [3,] 49278.0 51897.5 45111.0 31330.0 35247.5 NA [4,] 52964.0 54740.0 49431.5 33245.5 45665.5 NA [5,] 57319.0 59099.0 54562.0 35704.0 52435.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 45794.94 48701.33 38538.96 28960.98 27620.71 NA [2,] 52761.06 55093.67 51683.04 33699.02 42874.29 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(37729, 45327.5, 49278, 52964, 57319, 39251, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qvkt1476393569.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,] 34560.4 34527.0 33402.50 [2,] 38444.1 40846.5 37563.75 [3,] 42136.1 48227.0 41499.50 [4,] 46295.3 50870.5 45571.75 [5,] 48158.2 54317.0 49149.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 38555.11 43654.99 37847 [2,] 45717.09 52799.01 45152 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(34560.4, 38444.1, 42136.1, 46295.3, 48158.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o3we1476393569.ps tmp/1o3we1476393569.png",intern=TRUE)) character(0) > try(system("convert tmp/2xets1476393569.ps tmp/2xets1476393569.png",intern=TRUE)) character(0) > try(system("convert tmp/3vcai1476393569.ps tmp/3vcai1476393569.png",intern=TRUE)) character(0) > try(system("convert tmp/47lvd1476393569.ps tmp/47lvd1476393569.png",intern=TRUE)) character(0) > try(system("convert tmp/5hrj11476393569.ps tmp/5hrj11476393569.png",intern=TRUE)) character(0) > try(system("convert tmp/6bb931476393569.ps tmp/6bb931476393569.png",intern=TRUE)) character(0) > try(system("convert tmp/7qvkt1476393569.ps tmp/7qvkt1476393569.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.369 0.149 2.556