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(102.54,101.29,101.49,101.71,101.98,102.11,102.11,103.13,103.43,103.8,103.99,104.03,104.03,102.58,102.65,102.81,102.98,103.12,103.12,104.33,104.41,104.66,104.81,104.9,100.15,98.74,98.74,98.96,99.34,99.4,99.5,100.5,100.77,101.08,101.39,101.43,101.43,101.29,101.33,101.15,101.25,101.13,101.07,101.33,101.61,101.29,101.39,101.46,101.81,101.78,101.93,102.01,102.03,102.14,101.81,101.52,101.38,101.5,101.65,101.64) > 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,] 102.54 104.03 100.15 101.43 101.81 NA [2,] 101.29 102.58 98.74 101.29 101.78 NA [3,] 101.49 102.65 98.74 101.33 101.93 NA [4,] 101.71 102.81 98.96 101.15 102.01 NA [5,] 101.98 102.98 99.34 101.25 102.03 NA [6,] 102.11 103.12 99.40 101.13 102.14 NA [7,] 102.11 103.12 99.50 101.07 101.81 NA [8,] 103.13 104.33 100.50 101.33 101.52 NA [9,] 103.43 104.41 100.77 101.61 101.38 NA [10,] 103.80 104.66 101.08 101.29 101.50 NA [11,] 103.99 104.81 101.39 101.39 101.65 NA [12,] 104.03 104.90 101.43 101.46 101.64 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.25 -1.45 -1.41 -0.14 -0.03 NA [2,] 0.20 0.07 0.00 0.04 0.15 NA [3,] 0.22 0.16 0.22 -0.18 0.08 NA [4,] 0.27 0.17 0.38 0.10 0.02 NA [5,] 0.13 0.14 0.06 -0.12 0.11 NA [6,] 0.00 0.00 0.10 -0.06 -0.33 NA [7,] 1.02 1.21 1.00 0.26 -0.29 NA [8,] 0.30 0.08 0.27 0.28 -0.14 NA [9,] 0.37 0.25 0.31 -0.32 0.12 NA [10,] 0.19 0.15 0.31 0.10 0.15 NA [11,] 0.04 0.09 0.04 0.07 -0.01 NA [12,] 0.00 -4.75 0.00 0.35 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/1dl981476390974.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/2qqmd1476390974.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/3gmzw1476390974.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/4u1na1476390974.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,] 100.15 101.29 101.33 101.15 101.25 101.13 101.07 100.50 100.77 101.08 [2,] 101.43 101.29 101.33 101.15 101.25 101.13 101.07 101.33 101.38 101.29 [3,] 101.81 101.29 101.49 101.71 101.98 102.11 101.81 101.52 101.61 101.50 [4,] 102.54 101.78 101.93 102.01 102.03 102.14 102.11 103.13 103.43 103.80 [5,] 104.03 101.78 102.65 102.81 102.98 103.12 103.12 104.33 104.41 104.66 [,11] [,12] [1,] 101.39 101.43 [2,] 101.39 101.46 [3,] 101.65 101.64 [4,] 103.99 104.03 [5,] 104.81 104.90 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.0257 100.9438 101.066 101.1023 101.4289 101.3963 101.0751 100.2481 [2,] 102.5943 101.6362 101.914 102.3177 102.5311 102.8237 102.5449 102.7919 [,9] [,10] [,11] [,12] [1,] 100.1615 99.72644 99.81285 99.82404 [2,] 103.0585 103.27356 103.48715 103.45596 $out [1] 102.58 98.74 98.74 98.96 99.34 99.40 99.50 $group [1] 2 2 3 4 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(100.15, 101.43, 101.81, 102.54, 104.03, 101.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kpqa1476390974.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,] -1.45 0.00 0.08 0.02 0.06 -0.06 -0.29 -0.14 0.12 0.10 0.04 -4.750 [2,] -1.41 0.04 0.08 0.10 0.06 -0.06 0.26 0.08 0.12 0.15 0.04 -2.375 [3,] -1.25 0.07 0.16 0.17 0.11 0.00 1.00 0.27 0.25 0.15 0.04 0.000 [4,] -0.14 0.15 0.22 0.27 0.13 0.00 1.02 0.28 0.31 0.19 0.07 0.175 [5,] -0.03 0.20 0.22 0.38 0.14 0.00 1.21 0.30 0.37 0.19 0.09 0.350 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -2.1473788 -0.007725723 0.06107635 0.04987843 0.06053818 -0.04239585 [2,] -0.3526212 0.147725723 0.25892365 0.29012157 0.15946182 0.04239585 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.4629859 0.1286805 0.1157465 0.1217361 0.01880208 -2.0145 [2,] 1.5370141 0.4113195 0.3842535 0.1782639 0.06119792 2.0145 $out [1] -0.18 -0.12 0.10 -0.33 -0.32 0.31 -0.01 $group [1] 3 5 6 6 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.45, -1.41000000000001, -1.25, -0.140000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62fvd1476390974.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,] 101.290 102.580 98.740 101.07 101.380 NA [2,] 101.845 102.895 99.150 101.20 101.580 NA [3,] 102.325 103.575 99.825 101.31 101.795 NA [4,] 103.615 104.535 100.925 101.41 101.970 NA [5,] 104.030 104.900 101.430 101.61 102.140 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 101.5177 102.827 99.01541 101.2142 101.6171 NA [2,] 103.1323 104.323 100.63459 101.4058 101.9729 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(101.29, 101.845, 102.325, 103.615, 104.03, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qc2w1476390974.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,] 101.136 101.290 101.5350 [2,] 101.422 101.510 101.6100 [3,] 101.786 101.645 101.8125 [4,] 102.393 101.810 102.4750 [5,] 102.692 102.110 102.7450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.3431 101.5082 101.418 [2,] 102.2289 101.7818 102.207 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.136, 101.422, 101.786, 102.393, 102.692, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dl981476390974.ps tmp/1dl981476390974.png",intern=TRUE)) character(0) > try(system("convert tmp/2qqmd1476390974.ps tmp/2qqmd1476390974.png",intern=TRUE)) character(0) > try(system("convert tmp/3gmzw1476390974.ps tmp/3gmzw1476390974.png",intern=TRUE)) character(0) > try(system("convert tmp/4u1na1476390974.ps tmp/4u1na1476390974.png",intern=TRUE)) character(0) > try(system("convert tmp/5kpqa1476390974.ps tmp/5kpqa1476390974.png",intern=TRUE)) character(0) > try(system("convert tmp/62fvd1476390974.ps tmp/62fvd1476390974.png",intern=TRUE)) character(0) > try(system("convert tmp/7qc2w1476390974.ps tmp/7qc2w1476390974.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.428 0.239 2.701