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(55.64,56.13,56.69,56.8,56.93,57,57.01,57.21,57.17,57.36,57.29,57.26,57.29,57.68,58.19,58.34,58.46,58.67,58.72,58.74,58.77,58.84,59.13,59.12,59.12,59.33,59.49,59.67,59.7,59.73,59.74,59.62,59.6,59.98,60.05,60.06,60.1,60.18,60.38,60.52,60.78,60.72,60.72,60.86,60.99,61.11,61.17,61.19,61.19,61.22,61.19,60.82,60.6,60.15,60.14,60.2,60.36,60.38,60.44,60.47) > 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] 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,] 55.64 57.29 59.12 60.10 61.19 NA [2,] 56.13 57.68 59.33 60.18 61.22 NA [3,] 56.69 58.19 59.49 60.38 61.19 NA [4,] 56.80 58.34 59.67 60.52 60.82 NA [5,] 56.93 58.46 59.70 60.78 60.60 NA [6,] 57.00 58.67 59.73 60.72 60.15 NA [7,] 57.01 58.72 59.74 60.72 60.14 NA [8,] 57.21 58.74 59.62 60.86 60.20 NA [9,] 57.17 58.77 59.60 60.99 60.36 NA [10,] 57.36 58.84 59.98 61.11 60.38 NA [11,] 57.29 59.13 60.05 61.17 60.44 NA [12,] 57.26 59.12 60.06 61.19 60.47 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.49 0.39 0.21 0.08 0.03 NA [2,] 0.56 0.51 0.16 0.20 -0.03 NA [3,] 0.11 0.15 0.18 0.14 -0.37 NA [4,] 0.13 0.12 0.03 0.26 -0.22 NA [5,] 0.07 0.21 0.03 -0.06 -0.45 NA [6,] 0.01 0.05 0.01 0.00 -0.01 NA [7,] 0.20 0.02 -0.12 0.14 0.06 NA [8,] -0.04 0.03 -0.02 0.13 0.16 NA [9,] 0.19 0.07 0.38 0.12 0.02 NA [10,] -0.07 0.29 0.07 0.06 0.06 NA [11,] -0.03 -0.01 0.01 0.02 0.03 NA [12,] 0.03 0.00 0.04 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/wessaorg/rcomp/tmp/1pjdu1393881666.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/26r3j1393881666.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/3j5r41393881666.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/4bnaz1393881666.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,] 55.64 56.13 56.69 56.80 56.93 57.00 57.01 57.21 57.17 57.36 57.29 57.26 [2,] 57.29 57.68 58.19 58.34 58.46 58.67 58.72 58.74 58.77 58.84 59.13 59.12 [3,] 59.12 59.33 59.49 59.67 59.70 59.73 59.74 59.62 59.60 59.98 60.05 60.06 [4,] 60.10 60.18 60.38 60.52 60.60 60.15 60.14 60.20 60.36 60.38 60.44 60.47 [5,] 61.19 61.22 61.19 60.82 60.78 60.72 60.72 60.86 60.99 61.11 61.17 61.19 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 57.13446 57.56351 57.94255 58.12962 58.18788 58.68424 58.73663 58.58837 [2,] 61.10554 61.09649 61.03745 61.21038 61.21212 60.77576 60.74337 60.65163 [,9] [,10] [,11] [,12] [1,] 58.47651 58.89184 59.12436 59.10609 [2,] 60.72349 61.06816 60.97564 61.01391 $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(55.64, 57.29, 59.12, 60.1, 61.19, 56.13, 57.68, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56dhu1393881666.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.03 -0.03 0.11 0.03 -0.06 -0.01 -0.12 -0.04 0.02 0.06 -0.03 0.000 [2,] 0.08 0.16 0.11 0.03 -0.06 0.00 0.02 -0.02 0.07 0.06 -0.01 0.000 [3,] 0.21 0.20 0.14 0.12 0.03 0.01 0.06 0.03 0.12 0.06 0.01 0.015 [4,] 0.39 0.51 0.15 0.13 0.07 0.01 0.14 0.13 0.19 0.07 0.02 0.035 [5,] 0.49 0.56 0.18 0.26 0.21 0.01 0.20 0.16 0.19 0.07 0.03 0.040 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.009045219 -0.04730912 0.1117361 0.04934025 -0.06185767 0.002934025 [2,] 0.429045219 0.44730912 0.1682639 0.19065975 0.12185767 0.017065975 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.0247917 -0.07598962 0.0352083 0.05293403 -0.01119792 -0.01265 [2,] 0.1447917 0.13598962 0.2047917 0.06706597 0.03119792 0.04265 $out [1] -0.37 -0.22 -0.45 0.05 0.38 -0.07 0.29 $group [1] 3 4 5 6 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0300000000000011, 0.0799999999999983, 0.210000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6h1a71393881666.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,] 56.130 57.680 59.120 60.10 60.140 NA [2,] 56.745 58.265 59.545 60.45 60.280 NA [3,] 57.005 58.695 59.685 60.75 60.455 NA [4,] 57.235 58.805 59.860 61.05 61.005 NA [5,] 57.360 59.130 60.060 61.19 61.220 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 56.78151 58.4487 59.54133 60.47634 60.12432 NA [2,] 57.22849 58.9413 59.82867 61.02366 60.78568 NA $out [1] 55.64 57.29 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(56.13, 56.745, 57.005, 57.235, 57.36, 57.68, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ezzi1393881666.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,] 58.908 59.120 59.2850 [2,] 59.209 59.545 59.3475 [3,] 59.280 59.685 59.4500 [4,] 59.456 59.860 59.5875 [5,] 59.620 60.060 59.7950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 59.16734 59.54133 59.34053 [2,] 59.39266 59.82867 59.55947 $out [1] 58.668 58.695 58.930 $group [1] 1 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(58.908, 59.209, 59.28, 59.456, 59.62, 59.12, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pjdu1393881666.ps tmp/1pjdu1393881666.png",intern=TRUE)) character(0) > try(system("convert tmp/26r3j1393881666.ps tmp/26r3j1393881666.png",intern=TRUE)) character(0) > try(system("convert tmp/3j5r41393881666.ps tmp/3j5r41393881666.png",intern=TRUE)) character(0) > try(system("convert tmp/4bnaz1393881666.ps tmp/4bnaz1393881666.png",intern=TRUE)) character(0) > try(system("convert tmp/56dhu1393881666.ps tmp/56dhu1393881666.png",intern=TRUE)) character(0) > try(system("convert tmp/6h1a71393881666.ps tmp/6h1a71393881666.png",intern=TRUE)) character(0) > try(system("convert tmp/7ezzi1393881666.ps tmp/7ezzi1393881666.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.978 0.892 5.897