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(97.78,97.73,97.61,97.69,97.68,97.67,97.67,97.96,98.27,99.52,99.59,99.75,99.75,99.8,99.99,100.25,100.08,100.08,100.08,100.06,101,101.81,101.82,101.96,101.96,101.93,102.03,102.11,102.07,102.34,102.34,102.33,102.77,103.08,103.38,103.44,99.1,99.15,99.21,99.01,99.08,99.11,100.11,100.31,100.55,101.38,101.49,101.5,100.69,100.8,100.58,100.34,100.38,100.33,101.06,101.15,101.36,101.98,102.24,102.34) > 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,] 97.78 99.75 101.96 99.10 100.69 NA [2,] 97.73 99.80 101.93 99.15 100.80 NA [3,] 97.61 99.99 102.03 99.21 100.58 NA [4,] 97.69 100.25 102.11 99.01 100.34 NA [5,] 97.68 100.08 102.07 99.08 100.38 NA [6,] 97.67 100.08 102.34 99.11 100.33 NA [7,] 97.67 100.08 102.34 100.11 101.06 NA [8,] 97.96 100.06 102.33 100.31 101.15 NA [9,] 98.27 101.00 102.77 100.55 101.36 NA [10,] 99.52 101.81 103.08 101.38 101.98 NA [11,] 99.59 101.82 103.38 101.49 102.24 NA [12,] 99.75 101.96 103.44 101.50 102.34 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.05 0.05 -0.03 0.05 0.11 NA [2,] -0.12 0.19 0.10 0.06 -0.22 NA [3,] 0.08 0.26 0.08 -0.20 -0.24 NA [4,] -0.01 -0.17 -0.04 0.07 0.04 NA [5,] -0.01 0.00 0.27 0.03 -0.05 NA [6,] 0.00 0.00 0.00 1.00 0.73 NA [7,] 0.29 -0.02 -0.01 0.20 0.09 NA [8,] 0.31 0.94 0.44 0.24 0.21 NA [9,] 1.25 0.81 0.31 0.83 0.62 NA [10,] 0.07 0.01 0.30 0.11 0.26 NA [11,] 0.16 0.14 0.06 0.01 0.10 NA [12,] 0.00 0.00 -4.34 -0.81 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/1obid1457435884.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/29nxr1457435884.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/3g45x1457435884.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/4rscr1457435884.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,] 97.78 97.73 97.61 97.69 97.68 97.67 100.08 100.06 100.55 101.38 [2,] 99.10 99.15 99.21 99.01 99.08 99.11 100.08 100.06 100.55 101.38 [3,] 99.75 99.80 99.99 100.25 100.08 100.08 100.11 100.31 101.00 101.81 [4,] 100.69 100.80 100.58 100.34 100.38 100.33 101.06 101.15 101.36 101.98 [5,] 101.96 101.93 102.03 102.11 102.07 100.33 102.34 102.33 101.36 101.98 [,11] [,12] [1,] 101.49 101.50 [2,] 101.49 101.50 [3,] 101.82 101.96 [4,] 102.24 102.34 [5,] 102.24 103.44 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.62651 98.63411 99.02196 99.31023 99.16142 99.21795 99.41753 [2,] 100.87349 100.96589 100.95804 101.18977 100.99858 100.94205 100.80247 [,8] [,9] [,10] [,11] [,12] [1,] 99.53981 100.4277 101.386 101.2901 101.3665 [2,] 101.08019 101.5723 102.234 102.3499 102.5535 $out [1] 102.34 97.67 97.96 98.27 102.77 99.52 103.08 99.59 103.38 99.75 $group [1] 6 7 8 9 9 10 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(97.78, 99.1, 99.75, 100.69, 101.96, 97.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/518vy1457435884.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,] -0.05 -0.22 -0.24 -0.04 -0.05 0.00 -0.02 0.21 0.31 0.01 0.01 -4.340 [2,] -0.03 -0.12 -0.20 -0.04 -0.01 0.00 -0.01 0.24 0.62 0.07 0.06 -2.575 [3,] 0.05 0.06 0.08 -0.01 0.00 0.00 0.09 0.31 0.81 0.11 0.10 -0.405 [4,] 0.05 0.10 0.08 0.04 0.03 0.73 0.20 0.44 0.83 0.26 0.14 0.000 [5,] 0.11 0.19 0.26 0.07 0.03 1.00 0.29 0.44 0.83 0.30 0.16 0.000 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.006527798 -0.09545145 -0.1178473 -0.0665278 -0.0282639 -0.5158162 [2,] 0.106527798 0.21545145 0.2778473 0.0465278 0.0282639 0.5158162 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.05838547 0.1686805 0.6616145 -0.02425352 0.0434722 -2.43925 [2,] 0.23838547 0.4513195 0.9583855 0.24425352 0.1565278 1.62925 $out [1] -0.17 0.27 0.94 1.25 $group [1] 4 5 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0499999999999972, -0.0299999999999869, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6i5ye1457435884.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,] 97.610 99.750 101.930 99.010 100.33 NA [2,] 97.675 100.025 102.050 99.105 100.48 NA [3,] 97.755 100.080 102.335 99.660 100.93 NA [4,] 98.895 101.405 102.925 100.965 101.67 NA [5,] 99.750 101.960 103.440 101.500 102.34 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 97.19855 99.45057 101.9359 98.81164 100.3872 NA [2,] 98.31145 100.70943 102.7341 100.50836 101.4728 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.61, 97.675, 97.755, 98.895, 99.75, 99.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78jlz1457435884.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,] 99.856 99.750 99.6750 [2,] 99.881 100.035 99.8125 [3,] 100.079 100.180 100.2725 [4,] 101.172 101.405 101.3175 [5,] 101.798 101.960 101.9200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.49017 99.55513 99.58606 [2,] 100.66783 100.80487 100.95894 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(99.856, 99.881, 100.079, 101.172, 101.798, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1obid1457435884.ps tmp/1obid1457435884.png",intern=TRUE)) character(0) > try(system("convert tmp/29nxr1457435884.ps tmp/29nxr1457435884.png",intern=TRUE)) character(0) > try(system("convert tmp/3g45x1457435884.ps tmp/3g45x1457435884.png",intern=TRUE)) character(0) > try(system("convert tmp/4rscr1457435884.ps tmp/4rscr1457435884.png",intern=TRUE)) character(0) > try(system("convert tmp/518vy1457435884.ps tmp/518vy1457435884.png",intern=TRUE)) character(0) > try(system("convert tmp/6i5ye1457435884.ps tmp/6i5ye1457435884.png",intern=TRUE)) character(0) > try(system("convert tmp/78jlz1457435884.ps tmp/78jlz1457435884.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.476 0.436 2.947