R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 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(83.5,83.6,83.9,83.9,84.2,84.4,84.6,84.8,84.8,84.9,85,85.1,85.3,85.5,86.1,86.2,86.3,86.5,86.5,86.6,86.8,87.3,87.7,87.8,88.1,88.8,89.3,89.2,89.3,89.6,89.6,89.9,90.2,90.2,90.4,90.5,91.5,91.5,91.8,92.2,92.4,92.7,93.1,93.1,93.5,93.9,94.3,94.7,95.3,95.9,96.2,96.7,96.7,96.9,97.3,97.4,97.9,98.4,98.4,98.8,98.9,98.9,99.3,99.4,99.7,99.8,99.7,99.9,100.4,101.1,101.3,101.4,101.8,102.2,102.4,102.5,102.8,103,103.2,103.2,103.6,103.7,103.7,103.8,104.2,104.5,104.5,104.8,105.2,105.3,105.5,105.4,105.7,106.8,106.8,107) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 83.5 85.3 88.1 91.5 95.3 98.9 101.8 104.2 NA [2,] 83.6 85.5 88.8 91.5 95.9 98.9 102.2 104.5 NA [3,] 83.9 86.1 89.3 91.8 96.2 99.3 102.4 104.5 NA [4,] 83.9 86.2 89.2 92.2 96.7 99.4 102.5 104.8 NA [5,] 84.2 86.3 89.3 92.4 96.7 99.7 102.8 105.2 NA [6,] 84.4 86.5 89.6 92.7 96.9 99.8 103.0 105.3 NA [7,] 84.6 86.5 89.6 93.1 97.3 99.7 103.2 105.5 NA [8,] 84.8 86.6 89.9 93.1 97.4 99.9 103.2 105.4 NA [9,] 84.8 86.8 90.2 93.5 97.9 100.4 103.6 105.7 NA [10,] 84.9 87.3 90.2 93.9 98.4 101.1 103.7 106.8 NA [11,] 85.0 87.7 90.4 94.3 98.4 101.3 103.7 106.8 NA [12,] 85.1 87.8 90.5 94.7 98.8 101.4 103.8 107.0 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.1 0.2 0.7 0.0 0.6 0.0 0.4 0.3 NA [2,] 0.3 0.6 0.5 0.3 0.3 0.4 0.2 0.0 NA [3,] 0.0 0.1 -0.1 0.4 0.5 0.1 0.1 0.3 NA [4,] 0.3 0.1 0.1 0.2 0.0 0.3 0.3 0.4 NA [5,] 0.2 0.2 0.3 0.3 0.2 0.1 0.2 0.1 NA [6,] 0.2 0.0 0.0 0.4 0.4 -0.1 0.2 0.2 NA [7,] 0.2 0.1 0.3 0.0 0.1 0.2 0.0 -0.1 NA [8,] 0.0 0.2 0.3 0.4 0.5 0.5 0.4 0.3 NA [9,] 0.1 0.5 0.0 0.4 0.5 0.7 0.1 1.1 NA [10,] 0.1 0.4 0.2 0.4 0.0 0.2 0.0 0.0 NA [11,] 0.1 0.1 0.1 0.4 0.4 0.1 0.1 0.2 NA [12,] 0.2 0.3 1.0 0.6 0.1 0.4 0.4 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/1scoq1400672724.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/2up5d1400672724.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/3cfpc1400672724.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/4jjqu1400672724.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] [1,] 83.50 83.60 83.90 83.90 84.20 84.40 84.60 84.80 84.8 84.90 [2,] 86.70 87.15 87.70 87.70 87.80 88.05 88.05 88.25 88.5 88.75 [3,] 93.40 93.70 94.00 94.45 94.55 94.80 95.20 95.25 95.7 96.15 [4,] 100.35 100.55 100.85 100.95 101.25 101.40 101.45 101.55 102.0 102.40 [5,] 104.20 104.50 104.50 104.80 105.20 105.30 105.50 105.40 105.7 106.80 [,11] [,12] [1,] 85.00 85.10 [2,] 89.05 89.15 [3,] 96.35 96.75 [4,] 102.50 102.60 [5,] 106.80 107.00 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85.77491 86.21457 86.65422 87.04836 87.03664 87.3425 87.71457 [2,] 101.02509 101.18543 101.34578 101.85164 102.06336 102.2575 102.68543 [,8] [,9] [,10] [,11] [,12] [1,] 87.82043 88.15871 88.52491 88.83664 89.23664 [2,] 102.67957 103.24129 103.77509 103.86336 104.26336 $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(83.5, 86.7, 93.4, 100.35, 104.2, 83.6, 87.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s7er1400672724.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.00 0.00 -0.10 0.00 0.10 -0.1 -0.1 0.00 0.00 0.00 0.1 0.10 [2,] 0.05 0.25 0.05 0.10 0.15 0.0 0.0 0.25 0.10 0.00 0.1 0.25 [3,] 0.25 0.30 0.10 0.25 0.20 0.2 0.1 0.35 0.45 0.15 0.1 0.40 [4,] 0.50 0.45 0.35 0.30 0.25 0.3 0.2 0.45 0.60 0.30 0.3 0.50 [5,] 0.70 0.60 0.50 0.40 0.30 0.4 0.3 0.50 1.10 0.40 0.4 0.60 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.001376461 0.1882771 -0.06758431 0.1382771 0.1441386 0.03241569 [2,] 0.501376461 0.4117229 0.26758431 0.3617229 0.2558614 0.36758431 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.01172287 0.2382771 0.1706928 -0.01758431 -0.01172287 0.250704 [2,] 0.21172287 0.4617229 0.7293072 0.31758431 0.21172287 0.549296 $out [1] 1 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0499999999999972, 0.25, 0.500000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6bdkf1400672724.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] [,9] [1,] 83.50 85.30 88.10 91.5 95.30 98.90 101.80 104.20 NA [2,] 83.90 86.15 89.25 92.0 96.45 99.35 102.45 104.65 NA [3,] 84.50 86.50 89.60 92.9 97.10 99.75 103.10 105.35 NA [4,] 84.85 87.05 90.20 93.7 98.15 100.75 103.65 106.25 NA [5,] 85.10 87.80 90.50 94.7 98.80 101.40 103.80 107.00 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 84.0667 86.0895 89.1667 92.12462 96.32462 99.11145 102.5527 104.6202 NA [2,] 84.9333 86.9105 90.0333 93.67538 97.87538 100.38855 103.6473 106.0798 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(83.5, 83.9, 84.5, 84.85, 85.1, 85.3, 86.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7svuf1400672724.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,] 93.57500 93.400 93.51250 [2,] 94.27500 94.225 94.30000 [3,] 94.85625 95.000 94.70625 [4,] 95.57500 95.925 95.44375 [5,] 96.13750 96.750 95.91250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.26331 94.22462 94.18458 [2,] 95.44919 95.77538 95.22792 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.575, 94.275, 94.85625, 95.575, 96.1375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1scoq1400672724.ps tmp/1scoq1400672724.png",intern=TRUE)) character(0) > try(system("convert tmp/2up5d1400672724.ps tmp/2up5d1400672724.png",intern=TRUE)) character(0) > try(system("convert tmp/3cfpc1400672724.ps tmp/3cfpc1400672724.png",intern=TRUE)) character(0) > try(system("convert tmp/4jjqu1400672724.ps tmp/4jjqu1400672724.png",intern=TRUE)) character(0) > try(system("convert tmp/5s7er1400672724.ps tmp/5s7er1400672724.png",intern=TRUE)) character(0) > try(system("convert tmp/6bdkf1400672724.ps tmp/6bdkf1400672724.png",intern=TRUE)) character(0) > try(system("convert tmp/7svuf1400672724.ps tmp/7svuf1400672724.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.708 0.705 4.460