R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(4.69,4.69,4.69,4.69,4.69,4.69,4.69,4.73,4.78,4.79,4.79,4.8,4.8,4.81,5.16,5.26,5.29,5.29,5.29,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.35,5.44,5.47,5.47,5.48,5.48,5.48,5.48,5.48,5.48,5.48,5.5,5.55,5.57,5.58,5.58,5.58,5.59,5.59,5.59,5.55,5.61,5.61,5.61,5.63,5.69,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.71,5.74,5.77,5.79,5.79,5.8,5.8,5.8,5.8,5.8,5.81,5.81,5.83,5.94,5.98,5.99,6,6.02,6.02,6.02,6.02) > par1 = '7' > par1 <- '7' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 84 > (np <- floor(n / par1)) [1] 12 > 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] 12 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 4.69 4.73 5.16 5.30 5.44 5.48 5.58 5.61 5.7 5.71 5.80 5.98 NA [2,] 4.69 4.78 5.26 5.30 5.47 5.48 5.58 5.61 5.7 5.74 5.80 5.99 NA [3,] 4.69 4.79 5.29 5.30 5.47 5.48 5.59 5.63 5.7 5.77 5.80 6.00 NA [4,] 4.69 4.79 5.29 5.30 5.48 5.50 5.59 5.69 5.7 5.79 5.81 6.02 NA [5,] 4.69 4.80 5.29 5.30 5.48 5.55 5.59 5.70 5.7 5.79 5.81 6.02 NA [6,] 4.69 4.80 5.30 5.30 5.48 5.57 5.55 5.70 5.7 5.80 5.83 6.02 NA [7,] 4.69 4.81 5.30 5.35 5.48 5.58 5.61 5.70 5.7 5.80 5.94 6.02 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.00 0.05 0.10 0.00 0.03 0.00 0.00 0.00 0.00 0.03 0.00 0.01 NA [2,] 0.00 0.01 0.03 0.00 0.00 0.00 0.01 0.02 0.00 0.03 0.00 0.01 NA [3,] 0.00 0.00 0.00 0.00 0.01 0.02 0.00 0.06 0.00 0.02 0.01 0.02 NA [4,] 0.00 0.01 0.00 0.00 0.00 0.05 0.00 0.01 0.00 0.00 0.00 0.00 NA [5,] 0.00 0.00 0.01 0.00 0.00 0.02 -0.04 0.00 0.00 0.01 0.02 0.00 NA [6,] 0.00 0.01 0.00 0.05 0.00 0.01 0.06 0.00 0.00 0.00 0.11 0.00 NA [7,] 0.04 0.35 0.00 0.09 0.00 0.00 0.00 0.00 0.01 0.00 0.04 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/fisher/rcomp/tmp/1wgr61381957341.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/fisher/rcomp/tmp/22u6g1381957341.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/fisher/rcomp/tmp/3bq8a1381957341.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/fisher/rcomp/tmp/4ptzz1381957341.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] [1,] 4.690 4.69 4.690 4.690 4.690 4.69 4.690 [2,] 5.230 5.28 5.295 5.295 5.295 5.30 5.325 [3,] 5.530 5.53 5.535 5.545 5.570 5.56 5.595 [4,] 5.705 5.72 5.735 5.745 5.745 5.75 5.750 [5,] 5.980 5.99 6.000 6.020 6.020 6.02 6.020 $n [1] 12 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 5.313349 5.329313 5.334313 5.339752 5.364752 5.354752 5.401155 [2,] 5.746651 5.730687 5.735687 5.750248 5.775248 5.765248 5.788845 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" Warning message: In bxp(list(stats = c(4.69, 5.23, 5.53, 5.705, 5.98, 4.69, 5.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5e9un1381957341.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] [1,] 0.00 0.000 0.000 0.000 0.00 0.00 0.00 [2,] 0.00 0.000 0.000 0.000 0.00 0.00 0.00 [3,] 0.00 0.005 0.005 0.000 0.00 0.00 0.00 [4,] 0.03 0.015 0.020 0.005 0.01 0.03 0.04 [5,] 0.05 0.030 0.020 0.010 0.02 0.06 0.09 $n [1] 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.0136832 -0.001841601 -0.004122134 -0.002280534 -0.004561067 -0.0136832 [2,] 0.0136832 0.011841601 0.014122134 0.002280534 0.004561067 0.0136832 [,7] [1,] -0.01905552 [2,] 0.01905552 $out [1] 0.10 0.06 0.05 -0.04 0.11 0.35 $group [1] 1 3 4 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" Warning message: In bxp(list(stats = c(0, 0, 0, 0.0299999999999998, 0.0499999999999998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/63bm11381957341.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] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 4.69 4.780 5.260 5.3 5.47 5.48 5.58 5.61 5.7 5.710 5.80 5.980 NA [2,] 4.69 4.785 5.275 5.3 5.47 5.48 5.58 5.62 5.7 5.755 5.80 5.995 NA [3,] 4.69 4.790 5.290 5.3 5.48 5.50 5.59 5.69 5.7 5.790 5.81 6.020 NA [4,] 4.69 4.800 5.295 5.3 5.48 5.56 5.59 5.70 5.7 5.795 5.82 6.020 NA [5,] 4.69 4.810 5.300 5.3 5.48 5.58 5.59 5.70 5.7 5.800 5.83 6.020 NA $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 4.69 4.781042 5.278056 5.3 5.474028 5.452225 5.584028 5.642225 5.7 [2,] 4.69 4.798958 5.301944 5.3 5.485972 5.547775 5.595972 5.737775 5.7 [,10] [,11] [,12] [,13] [1,] 5.766113 5.798056 6.00507 NA [2,] 5.813887 5.821944 6.03493 NA $out [1] 4.73 5.16 5.35 5.44 5.55 5.61 5.94 $group [1] 2 3 4 5 7 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(4.69, 4.69, 4.69, 4.69, 4.69, 4.78, 4.785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7th7b1381957341.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,] 5.431667 5.5300 5.50000 [2,] 5.454583 5.5325 5.50375 [3,] 5.470833 5.5450 5.51000 [4,] 5.477500 5.5650 5.51125 [5,] 5.498333 5.5950 5.51250 $n [1] 7 7 7 $conf [,1] [,2] [,3] [1,] 5.457148 5.525592 5.505521 [2,] 5.484519 5.564408 5.514479 $out [1] 5.48375 5.53125 $group [1] 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(5.43166666666667, 5.45458333333333, 5.47083333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wgr61381957341.ps tmp/1wgr61381957341.png",intern=TRUE)) character(0) > try(system("convert tmp/22u6g1381957341.ps tmp/22u6g1381957341.png",intern=TRUE)) character(0) > try(system("convert tmp/3bq8a1381957341.ps tmp/3bq8a1381957341.png",intern=TRUE)) character(0) > try(system("convert tmp/4ptzz1381957341.ps tmp/4ptzz1381957341.png",intern=TRUE)) character(0) > try(system("convert tmp/5e9un1381957341.ps tmp/5e9un1381957341.png",intern=TRUE)) character(0) > try(system("convert tmp/63bm11381957341.ps tmp/63bm11381957341.png",intern=TRUE)) character(0) > try(system("convert tmp/7th7b1381957341.ps tmp/7th7b1381957341.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.071 0.522 3.584