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(86.5,86.6,98.8,84.4,91.4,95.7,78.5,81.7,94.3,98.5,95.4,91.7,92.8,90.6,102.2,91.8,95,102,88.9,89.6,97.9,108.6,100.8,95.1,101,100.9,102.5,105.4,98.4,105.3,96.5,88.1,107.9,107.1,92.5,95.7,85.2,85.5,94.7,86.2,88.8,93.4,83.4,82.9,96.7,96.2,92.8,92.8,90.2,95.9,107.5,98,95,108.5,91.8,91.7,108.3,105.1,104.8,103.2,98.6,102.4,121.2,102.6,108.9,105.5,90.8,99.6,111.6,104.7,103.1,101.7,98.8,101.4,114.2,96.9,98.3,104.8,94.4,94.5,102.4,105.5,101.2,99.5) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.5 92.8 101.0 85.2 90.2 98.6 98.8 NA [2,] 86.6 90.6 100.9 85.5 95.9 102.4 101.4 NA [3,] 98.8 102.2 102.5 94.7 107.5 121.2 114.2 NA [4,] 84.4 91.8 105.4 86.2 98.0 102.6 96.9 NA [5,] 91.4 95.0 98.4 88.8 95.0 108.9 98.3 NA [6,] 95.7 102.0 105.3 93.4 108.5 105.5 104.8 NA [7,] 78.5 88.9 96.5 83.4 91.8 90.8 94.4 NA [8,] 81.7 89.6 88.1 82.9 91.7 99.6 94.5 NA [9,] 94.3 97.9 107.9 96.7 108.3 111.6 102.4 NA [10,] 98.5 108.6 107.1 96.2 105.1 104.7 105.5 NA [11,] 95.4 100.8 92.5 92.8 104.8 103.1 101.2 NA [12,] 91.7 95.1 95.7 92.8 103.2 101.7 99.5 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.1 -2.2 -0.1 0.3 5.7 3.8 2.6 NA [2,] 12.2 11.6 1.6 9.2 11.6 18.8 12.8 NA [3,] -14.4 -10.4 2.9 -8.5 -9.5 -18.6 -17.3 NA [4,] 7.0 3.2 -7.0 2.6 -3.0 6.3 1.4 NA [5,] 4.3 7.0 6.9 4.6 13.5 -3.4 6.5 NA [6,] -17.2 -13.1 -8.8 -10.0 -16.7 -14.7 -10.4 NA [7,] 3.2 0.7 -8.4 -0.5 -0.1 8.8 0.1 NA [8,] 12.6 8.3 19.8 13.8 16.6 12.0 7.9 NA [9,] 4.2 10.7 -0.8 -0.5 -3.2 -6.9 3.1 NA [10,] -3.1 -7.8 -14.6 -3.4 -0.3 -1.6 -4.3 NA [11,] -3.7 -5.7 3.2 0.0 -1.6 -1.4 -1.7 NA [12,] 1.1 5.9 -10.5 -2.6 -4.6 -2.9 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/19gz71384333657.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/27utu1384333657.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/3dpdu1384333657.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/40b6o1384333657.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,] 85.20 85.50 94.70 84.4 88.80 93.40 78.50 81.7 94.3 96.2 92.50 [2,] 88.35 88.60 100.50 89.0 93.20 98.85 86.15 85.5 97.3 101.6 94.10 [3,] 92.80 95.90 102.50 96.9 95.00 104.80 90.80 89.6 102.4 105.1 100.80 [4,] 98.70 101.15 110.85 100.3 98.35 105.40 93.10 93.1 108.1 106.3 102.15 [5,] 101.00 102.40 121.20 105.4 98.40 108.50 96.50 99.6 111.6 108.6 104.80 [,12] [1,] 91.70 [2,] 93.95 [3,] 95.70 [4,] 100.60 [5,] 103.20 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.61915 88.40534 96.31915 90.15182 91.9245 100.8884 86.64957 85.0614 [2,] 98.98085 103.39466 108.68085 103.64818 98.0755 108.7116 94.95043 94.1386 [,9] [,10] [,11] [,12] [1,] 95.95041 102.2932 95.99267 91.72873 [2,] 108.84959 107.9068 105.60733 99.67127 $out [1] 108.9 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(85.2, 88.35, 92.8, 98.7, 101, 85.5, 88.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kvl81384333657.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,] -2.2 9.2 -18.60 -7.00 4.30 -17.2 -0.50 7.90 -6.90 -7.80 -5.7 -10.50 [2,] 0.0 10.4 -15.85 -0.80 4.45 -15.7 -0.30 10.15 -2.00 -6.05 -2.7 -4.60 [3,] 0.3 11.6 -10.40 2.60 6.50 -13.1 0.10 12.60 -0.50 -3.40 -1.6 -2.75 [4,] 3.2 12.5 -9.00 4.75 6.95 -10.2 1.95 15.20 3.65 -2.35 -0.7 1.10 [5,] 5.7 12.8 -8.50 7.00 7.00 -8.8 3.20 19.80 10.70 -0.30 0.0 5.90 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.610988 10.34591 -14.490709 -0.7143705 5.00704 -16.384511 -1.243664 [2,] 2.210988 12.85409 -6.309291 5.9143705 7.99296 -9.815489 1.443664 [,8] [,9] [,10] [,11] [,12] [1,] 9.584221 -3.874089 -5.60958 -2.7943677 -6.4266841 [2,] 15.615779 2.874089 -1.19042 -0.4056323 0.9266841 $out [1] 1.6 18.8 2.9 13.5 -3.4 -8.4 8.8 -14.6 3.2 $group [1] 2 2 3 5 5 7 7 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.2, 0, 0.299999999999997, 3.20000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68xrd1384333657.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] [1,] 78.50 88.90 88.10 82.90 90.2 98.60 94.40 NA [2,] 85.45 91.20 96.10 85.35 93.4 100.65 97.60 NA [3,] 91.55 95.05 100.95 90.80 100.6 102.85 100.35 NA [4,] 95.55 101.40 105.35 94.05 106.3 107.20 103.60 NA [5,] 98.80 108.60 107.90 96.70 108.5 111.60 105.50 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.94332 90.39771 96.73101 86.83187 94.71622 99.8625 97.61336 NA [2,] 96.15668 99.70229 105.16899 94.76813 106.48378 105.8375 103.08664 NA $out [1] 121.2 90.8 114.2 $group [1] 6 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(78.5, 85.45, 91.55, 95.55, 98.8, 88.9, 91.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fhbz1384333657.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.18571 89.60 89.3000 [2,] 94.02857 93.90 94.0875 [3,] 96.82143 96.40 96.5250 [4,] 102.45000 102.45 102.4125 [5,] 105.87143 105.10 105.6750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 92.98036 92.50029 92.72791 [2,] 100.66250 100.29971 100.32209 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(89.1857142857143, 94.0285714285714, 96.8214285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19gz71384333657.ps tmp/19gz71384333657.png",intern=TRUE)) character(0) > try(system("convert tmp/27utu1384333657.ps tmp/27utu1384333657.png",intern=TRUE)) character(0) > try(system("convert tmp/3dpdu1384333657.ps tmp/3dpdu1384333657.png",intern=TRUE)) character(0) > try(system("convert tmp/40b6o1384333657.ps tmp/40b6o1384333657.png",intern=TRUE)) character(0) > try(system("convert tmp/5kvl81384333657.ps tmp/5kvl81384333657.png",intern=TRUE)) character(0) > try(system("convert tmp/68xrd1384333657.ps tmp/68xrd1384333657.png",intern=TRUE)) character(0) > try(system("convert tmp/7fhbz1384333657.ps tmp/7fhbz1384333657.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.637 0.759 4.378