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(85.73,85.73,85.74,86.32,87.59,87.81,87.87,87.94,87.96,88.01,88.01,88.01,88.01,88.01,88.59,89.43,89.63,89.73,89.88,89.89,89.9,89.91,89.86,90.07,90.17,90.17,90.28,90.87,92.05,92.1,92.16,92.22,92.25,92.29,92.29,92.29,92.29,92.29,91.95,91.82,92.16,92.31,92.33,92.4,92.54,92.49,92.54,92.58,92.58,92.39,92.33,93.59,95.51,95.99,96.22,97.2,98.54,99.64,100.23,100.17) > 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,] 85.73 88.01 90.17 92.29 92.58 NA [2,] 85.73 88.01 90.17 92.29 92.39 NA [3,] 85.74 88.59 90.28 91.95 92.33 NA [4,] 86.32 89.43 90.87 91.82 93.59 NA [5,] 87.59 89.63 92.05 92.16 95.51 NA [6,] 87.81 89.73 92.10 92.31 95.99 NA [7,] 87.87 89.88 92.16 92.33 96.22 NA [8,] 87.94 89.89 92.22 92.40 97.20 NA [9,] 87.96 89.90 92.25 92.54 98.54 NA [10,] 88.01 89.91 92.29 92.49 99.64 NA [11,] 88.01 89.86 92.29 92.54 100.23 NA [12,] 88.01 90.07 92.29 92.58 100.17 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.00 0.00 0.00 0.00 -0.19 NA [2,] 0.01 0.58 0.11 -0.34 -0.06 NA [3,] 0.58 0.84 0.59 -0.13 1.26 NA [4,] 1.27 0.20 1.18 0.34 1.92 NA [5,] 0.22 0.10 0.05 0.15 0.48 NA [6,] 0.06 0.15 0.06 0.02 0.23 NA [7,] 0.07 0.01 0.06 0.07 0.98 NA [8,] 0.02 0.01 0.03 0.14 1.34 NA [9,] 0.05 0.01 0.04 -0.05 1.10 NA [10,] 0.00 -0.05 0.00 0.05 0.59 NA [11,] 0.00 0.21 0.00 0.04 -0.06 NA [12,] 0.00 0.10 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/wessaorg/rcomp/tmp/1igeh1384766164.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/2ct1r1384766164.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/3yn7m1384766164.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/42oxz1384766164.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,] 85.73 85.73 85.74 86.32 87.59 87.81 87.87 87.94 87.96 88.01 88.01 88.01 [2,] 88.01 88.01 88.59 89.43 89.63 89.73 89.88 89.89 89.90 89.91 89.86 90.07 [3,] 90.17 90.17 90.28 90.87 92.05 92.10 92.16 92.22 92.25 92.29 92.29 92.29 [4,] 92.29 92.29 91.95 91.82 92.16 92.31 92.33 92.40 92.54 92.49 92.54 92.58 [5,] 92.58 92.39 92.33 93.59 95.51 95.99 92.33 92.40 92.54 92.49 92.54 92.58 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 87.14576 87.14576 87.90583 89.18123 90.26231 90.27698 90.42884 90.44644 [2,] 93.19424 93.19424 92.65417 92.55877 93.83769 93.92302 93.89116 93.99356 [,9] [,10] [,11] [,12] [1,] 90.38458 90.46698 90.39632 90.51644 [2,] 94.11542 94.11302 94.18368 94.06356 $out [1] 96.22 97.20 98.54 99.64 100.23 100.17 $group [1] 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(85.73, 88.01, 90.17, 92.29, 92.58, 85.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5udv81384766164.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 -0.06 0.58 0.20 0.05 0.02 0.06 0.01 -0.05 -0.05 0.00 0.00 [2,] 0 -0.06 0.58 0.34 0.10 0.06 0.06 0.02 0.01 0.00 0.00 0.00 [3,] 0 0.01 0.59 1.18 0.15 0.06 0.07 0.03 0.04 0.00 0.00 0.00 [4,] 0 0.11 0.84 1.27 0.22 0.15 0.07 0.14 0.05 0.05 0.04 0.05 [5,] 0 0.11 0.84 1.92 0.22 0.23 0.07 0.14 0.05 0.05 0.04 0.10 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 -0.1101216 0.4062847 0.5228643 0.0652083 -0.003593773 0.06293403 [2,] 0 0.1301216 0.7737153 1.8371357 0.2347917 0.123593773 0.07706597 [,8] [,9] [,10] [,11] [,12] [1,] -0.0547917 0.0117361 -0.03532987 -0.0282639 -0.0395 [2,] 0.1147917 0.0682639 0.03532987 0.0282639 0.0395 $out [1] -0.19 0.58 -0.34 -0.13 1.26 0.48 0.01 0.98 1.34 1.10 0.59 0.21 [13] -0.06 $group [1] 1 2 2 3 3 5 7 7 8 9 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, -0.0600000000000023, -0.0600000000000023, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64w1j1384766164.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,] 85.730 88.010 90.170 91.820 92.330 NA [2,] 86.030 89.010 90.575 92.225 93.085 NA [3,] 87.840 89.795 92.130 92.320 96.105 NA [4,] 87.985 89.895 92.270 92.515 99.090 NA [5,] 88.010 90.070 92.290 92.580 100.230 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 86.94831 89.39135 91.3569 92.18773 93.36608 NA [2,] 88.73169 90.19865 92.9031 92.45227 98.84392 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(85.73, 86.03, 87.84, 87.985, 88.01, 88.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7xu3e1384766164.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,] 89.718 90.170 90.1500 [2,] 90.092 90.575 90.4475 [3,] 91.640 92.130 91.0625 [4,] 92.353 92.270 91.2000 [5,] 92.624 92.290 91.3250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 90.60874 91.3569 90.71928 [2,] 92.67126 92.9031 91.40572 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(89.718, 90.092, 91.64, 92.353, 92.624, 90.17, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1igeh1384766164.ps tmp/1igeh1384766164.png",intern=TRUE)) character(0) > try(system("convert tmp/2ct1r1384766164.ps tmp/2ct1r1384766164.png",intern=TRUE)) character(0) > try(system("convert tmp/3yn7m1384766164.ps tmp/3yn7m1384766164.png",intern=TRUE)) character(0) > try(system("convert tmp/42oxz1384766164.ps tmp/42oxz1384766164.png",intern=TRUE)) character(0) > try(system("convert tmp/5udv81384766164.ps tmp/5udv81384766164.png",intern=TRUE)) character(0) > try(system("convert tmp/64w1j1384766164.ps tmp/64w1j1384766164.png",intern=TRUE)) character(0) > try(system("convert tmp/7xu3e1384766164.ps tmp/7xu3e1384766164.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.519 1.005 5.500