R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(65,65.3,62.9,63.5,62.1,59.3,61.6,61.5,60.1,59.5,62.7,65.5,63.8,63.8,62.7,62.3,62.4,64.8,66.4,65.1,67.4,68.8,68.6,71.5,75,84.3,84,79.1,78.8,82.7,85.3,84.5,80.8,70.1,68.2,68.1,72.3,73.1,71.5,74.1,80.3,80.6,81.4,87.4,89.3,93.2,92.8,96.8,100.3,95.6,89,87.4,86.7,92.8,98.6,100.8,105.5,107.8,113.7,120.3) > 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,] 65.0 63.8 75.0 72.3 100.3 NA [2,] 65.3 63.8 84.3 73.1 95.6 NA [3,] 62.9 62.7 84.0 71.5 89.0 NA [4,] 63.5 62.3 79.1 74.1 87.4 NA [5,] 62.1 62.4 78.8 80.3 86.7 NA [6,] 59.3 64.8 82.7 80.6 92.8 NA [7,] 61.6 66.4 85.3 81.4 98.6 NA [8,] 61.5 65.1 84.5 87.4 100.8 NA [9,] 60.1 67.4 80.8 89.3 105.5 NA [10,] 59.5 68.8 70.1 93.2 107.8 NA [11,] 62.7 68.6 68.2 92.8 113.7 NA [12,] 65.5 71.5 68.1 96.8 120.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.3 0.0 9.3 0.8 -4.7 NA [2,] -2.4 -1.1 -0.3 -1.6 -6.6 NA [3,] 0.6 -0.4 -4.9 2.6 -1.6 NA [4,] -1.4 0.1 -0.3 6.2 -0.7 NA [5,] -2.8 2.4 3.9 0.3 6.1 NA [6,] 2.3 1.6 2.6 0.8 5.8 NA [7,] -0.1 -1.3 -0.8 6.0 2.2 NA [8,] -1.4 2.3 -3.7 1.9 4.7 NA [9,] -0.6 1.4 -10.7 3.9 2.3 NA [10,] 3.2 -0.2 -1.9 -0.4 5.9 NA [11,] 2.8 2.9 -0.1 4.0 6.6 NA [12,] -1.7 3.5 4.2 3.5 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/www/rcomp/tmp/1svek1336391961.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/www/rcomp/tmp/2yocl1336391961.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/www/rcomp/tmp/3yjy01336391961.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/www/rcomp/tmp/4jinb1336391961.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,] 63.8 63.8 62.7 62.3 62.1 59.3 61.6 61.5 60.1 59.5 62.7 65.5 [2,] 65.0 65.3 62.9 63.5 62.4 64.8 66.4 65.1 67.4 68.8 68.2 68.1 [3,] 72.3 73.1 71.5 74.1 78.8 80.6 81.4 84.5 80.8 70.1 68.6 71.5 [4,] 75.0 84.3 84.0 79.1 80.3 82.7 85.3 87.4 89.3 93.2 92.8 96.8 [5,] 75.0 95.6 89.0 87.4 86.7 92.8 98.6 100.8 105.5 107.8 113.7 120.3 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 65.23403 59.67465 56.59079 63.07708 66.1519 67.9519 68.04531 68.74288 [2,] 79.36597 86.52535 86.40921 85.12292 91.4481 93.2481 94.75469 100.25712 [,9] [,10] [,11] [,12] [1,] 65.32552 52.85902 51.2177 51.22065 [2,] 96.27448 87.34098 85.9823 91.77935 $out [1] 100.3 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(63.8, 65, 72.3, 75, 75, 63.8, 65.3, 73.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5pmki1336391961.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 -2.4 -1.6 -1.4 -2.8 0.8 -1.3 -3.7 -0.6 -1.9 2.8 -1.70 [2,] 0.0 -2.4 -1.6 -0.7 0.3 1.6 -0.8 -1.4 -0.6 -0.4 2.8 0.90 [3,] 0.3 -1.6 -0.4 -0.3 2.4 2.3 -0.1 1.9 1.4 -0.2 2.9 3.50 [4,] 0.8 -1.1 0.6 0.1 3.9 2.6 2.2 2.3 2.3 3.2 4.0 3.85 [5,] 0.8 -0.3 2.6 0.1 6.1 2.6 6.0 4.7 3.9 5.9 4.0 4.20 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.265278 -2.5185767 -1.954514 -0.865278 -0.1437509 1.593403 -2.219792 [2,] 0.865278 -0.6814233 1.154514 0.265278 4.9437509 3.006597 2.019792 [,8] [,9] [,10] [,11] [,12] [1,] -0.7144107 -0.6491327 -2.743751 2.052083 1.1695 [2,] 4.5144107 3.4491327 2.343751 3.747917 5.8305 $out [1] 9.3 -4.7 -6.6 -4.9 6.2 5.8 -10.7 -0.1 6.6 $group [1] 1 1 2 3 4 6 9 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.299999999999997, 0.799999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/62rzo1336391961.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,] 59.30 62.30 68.10 71.50 86.70 NA [2,] 60.80 63.25 72.55 73.60 90.90 NA [3,] 62.40 64.95 79.95 81.00 99.45 NA [4,] 64.25 68.00 84.15 91.05 106.65 NA [5,] 65.50 71.50 85.30 96.80 120.30 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 60.82643 62.78349 74.65916 73.04094 92.26632 NA [2,] 63.97357 67.11651 85.24084 88.95906 106.63368 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(59.3, 60.8, 62.4, 64.25, 65.5, 62.3, 63.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/71ndj1336391961.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,] 73.28 68.6 70.000 [2,] 74.67 71.5 72.400 [3,] 77.54 73.6 75.325 [4,] 80.25 80.7 79.425 [5,] 84.44 84.5 82.450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 74.99492 69.40382 72.12085 [2,] 80.08508 77.79618 78.52915 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(73.28, 74.67, 77.54, 80.25, 84.44, 68.6, 71.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1svek1336391961.ps tmp/1svek1336391961.png",intern=TRUE)) character(0) > try(system("convert tmp/2yocl1336391961.ps tmp/2yocl1336391961.png",intern=TRUE)) character(0) > try(system("convert tmp/3yjy01336391961.ps tmp/3yjy01336391961.png",intern=TRUE)) character(0) > try(system("convert tmp/4jinb1336391961.ps tmp/4jinb1336391961.png",intern=TRUE)) character(0) > try(system("convert tmp/5pmki1336391961.ps tmp/5pmki1336391961.png",intern=TRUE)) character(0) > try(system("convert tmp/62rzo1336391961.ps tmp/62rzo1336391961.png",intern=TRUE)) character(0) > try(system("convert tmp/71ndj1336391961.ps tmp/71ndj1336391961.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.630 1.170 2.782