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(51.02,51.06,50.9,51.23,51.29,51.3,51.3,51.3,51.46,51.47,51.77,51.82,51.82,51.84,51.9,51.94,52.22,52.27,52.27,52.28,52.53,52.73,52.72,52.67,52.67,52.65,52.69,52.73,52.84,52.83,52.83,52.84,52.82,53.09,53.4,53.43,53.43,53.42,53.6,53.69,54.05,54.04,54.04,54.08,54.05,54.39,54.38,54.46,54.46,54.69,54.91,55.52,56.01,56.07,56.07,56.09,56.29,56.45,56.87,56.87,56.87,56.87,56.8,56.89,57.01,57.03,57.03,57.03,57.06,57.25,57.24,57.31) > par1 = '12' > par1 <- '12' > #'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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 51.02 51.82 52.67 53.43 54.46 56.87 NA [2,] 51.06 51.84 52.65 53.42 54.69 56.87 NA [3,] 50.90 51.90 52.69 53.60 54.91 56.80 NA [4,] 51.23 51.94 52.73 53.69 55.52 56.89 NA [5,] 51.29 52.22 52.84 54.05 56.01 57.01 NA [6,] 51.30 52.27 52.83 54.04 56.07 57.03 NA [7,] 51.30 52.27 52.83 54.04 56.07 57.03 NA [8,] 51.30 52.28 52.84 54.08 56.09 57.03 NA [9,] 51.46 52.53 52.82 54.05 56.29 57.06 NA [10,] 51.47 52.73 53.09 54.39 56.45 57.25 NA [11,] 51.77 52.72 53.40 54.38 56.87 57.24 NA [12,] 51.82 52.67 53.43 54.46 56.87 57.31 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.04 0.02 -0.02 -0.01 0.23 0.00 NA [2,] -0.16 0.06 0.04 0.18 0.22 -0.07 NA [3,] 0.33 0.04 0.04 0.09 0.61 0.09 NA [4,] 0.06 0.28 0.11 0.36 0.49 0.12 NA [5,] 0.01 0.05 -0.01 -0.01 0.06 0.02 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.00 0.01 0.01 0.04 0.02 0.00 NA [8,] 0.16 0.25 -0.02 -0.03 0.20 0.03 NA [9,] 0.01 0.20 0.27 0.34 0.16 0.19 NA [10,] 0.30 -0.01 0.31 -0.01 0.42 -0.01 NA [11,] 0.05 -0.05 0.03 0.08 0.00 0.07 NA [12,] 0.00 0.00 0.00 0.00 0.00 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/1vto71381930586.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/2ez9k1381930586.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/3v5fa1381930586.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/4yh2m1381930586.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] [1,] 51.02 51.060 50.900 51.23 51.290 51.300 51.300 51.30 51.460 51.47 51.77 [2,] 51.82 51.840 51.900 51.94 52.220 52.270 52.270 52.28 52.530 52.73 52.72 [3,] 53.05 53.035 53.145 53.21 53.445 53.435 53.435 53.46 53.435 53.74 53.89 [4,] 54.46 54.690 54.910 55.52 56.010 56.070 56.070 56.09 56.290 56.45 56.87 [5,] 56.87 56.870 56.800 56.89 57.010 57.030 57.030 57.03 57.060 57.25 57.24 [,12] [1,] 51.820 [2,] 52.670 [3,] 53.945 [4,] 56.870 [5,] 57.310 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 51.34711 51.19666 51.20345 50.90078 51.00033 50.98388 50.98388 51.00243 [2,] 54.75289 54.87334 55.08655 55.51922 55.88967 55.88612 55.88612 55.91757 [,9] [,10] [,11] [,12] [1,] 51.00968 51.34048 51.21312 51.23586 [2,] 55.86032 56.13952 56.56688 56.65414 $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(51.02, 51.82, 53.05, 54.46, 56.87, 51.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5ftof1381930586.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.02 -0.16 0.04 0.06 -0.010 0 0.00 -0.030 0.010 -0.010 -0.05 0 [2,] -0.01 -0.07 0.04 0.11 -0.010 0 0.00 -0.020 0.160 -0.010 0.00 0 [3,] 0.01 0.05 0.09 0.20 0.015 0 0.01 0.095 0.195 0.145 0.04 0 [4,] 0.04 0.18 0.33 0.36 0.050 0 0.02 0.200 0.270 0.310 0.07 0 [5,] 0.04 0.22 0.61 0.49 0.060 0 0.04 0.250 0.340 0.420 0.08 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.02225161 -0.1112581 -0.09705937 0.03874193 -0.02370194 0 [2,] 0.04225161 0.2112581 0.27705937 0.36125807 0.05370194 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.002900646 -0.04690711 0.1240464 -0.06141034 -0.005152261 0 [2,] 0.022900646 0.23690711 0.2659536 0.35141034 0.085152261 0 $out [1] 0.23 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0200000000000031, -0.00999999999999801, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6wtq31381930586.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] [1,] 50.900 51.82 52.650 53.420 54.460 56.80 NA [2,] 51.145 51.92 52.710 53.645 55.215 56.88 NA [3,] 51.300 52.27 52.830 54.045 56.070 57.03 NA [4,] 51.465 52.60 52.965 54.230 56.370 57.15 NA [5,] 51.820 52.73 53.090 54.460 56.870 57.31 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 51.15405 51.95985 52.71369 53.77818 55.5432 56.90685 NA [2,] 51.44595 52.58015 52.94631 54.31182 56.5968 57.15315 NA $out [1] 53.40 53.43 $group [1] 3 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(50.9, 51.145, 51.3, 51.465, 51.82, 51.82, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7juww1381930586.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,] 53.37833 53.0350 53.11750 [2,] 53.56667 53.1775 53.47000 [3,] 53.92333 53.4350 53.98625 [4,] 54.13250 53.6000 54.27188 [5,] 54.42667 53.9450 54.56875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 53.66525 53.24229 53.62051 [2,] 54.18141 53.62771 54.35199 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(53.3783333333333, 53.5666666666667, 53.9233333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vto71381930586.ps tmp/1vto71381930586.png",intern=TRUE)) character(0) > try(system("convert tmp/2ez9k1381930586.ps tmp/2ez9k1381930586.png",intern=TRUE)) character(0) > try(system("convert tmp/3v5fa1381930586.ps tmp/3v5fa1381930586.png",intern=TRUE)) character(0) > try(system("convert tmp/4yh2m1381930586.ps tmp/4yh2m1381930586.png",intern=TRUE)) character(0) > try(system("convert tmp/5ftof1381930586.ps tmp/5ftof1381930586.png",intern=TRUE)) character(0) > try(system("convert tmp/6wtq31381930586.ps tmp/6wtq31381930586.png",intern=TRUE)) character(0) > try(system("convert tmp/7juww1381930586.ps tmp/7juww1381930586.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.135 0.562 3.689