R version 3.0.3 (2014-03-06) -- "Warm Puppy" 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(99.7,107.5,107.5,114.5,118.7,117.8,111.7,112.3,104.9,102.4,100.3,106.6,94.2,96.9,94.7,104.9,108.3,104.7,108.3,105.2,99.2,99.3,92.3,98.6,88.4,89.5,90.5,103.5,105.1,107.1,111.6,104.6,103.3,104.6,94.1,97.7,92.4,89.5,100.1,109.6,105.5,108.9,108.8,103.9,104.3,102.1,96.6,101.4,90.4,91.8,100.4,105.3,105.1,107.6,103.7,102.7,99.2,95.6,96.3,104.1) > 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,] 99.7 94.2 88.4 92.4 90.4 NA [2,] 107.5 96.9 89.5 89.5 91.8 NA [3,] 107.5 94.7 90.5 100.1 100.4 NA [4,] 114.5 104.9 103.5 109.6 105.3 NA [5,] 118.7 108.3 105.1 105.5 105.1 NA [6,] 117.8 104.7 107.1 108.9 107.6 NA [7,] 111.7 108.3 111.6 108.8 103.7 NA [8,] 112.3 105.2 104.6 103.9 102.7 NA [9,] 104.9 99.2 103.3 104.3 99.2 NA [10,] 102.4 99.3 104.6 102.1 95.6 NA [11,] 100.3 92.3 94.1 96.6 96.3 NA [12,] 106.6 98.6 97.7 101.4 104.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 7.8 2.7 1.1 -2.9 1.4 NA [2,] 0.0 -2.2 1.0 10.6 8.6 NA [3,] 7.0 10.2 13.0 9.5 4.9 NA [4,] 4.2 3.4 1.6 -4.1 -0.2 NA [5,] -0.9 -3.6 2.0 3.4 2.5 NA [6,] -6.1 3.6 4.5 -0.1 -3.9 NA [7,] 0.6 -3.1 -7.0 -4.9 -1.0 NA [8,] -7.4 -6.0 -1.3 0.4 -3.5 NA [9,] -2.5 0.1 1.3 -2.2 -3.6 NA [10,] -2.1 -7.0 -10.5 -5.5 0.7 NA [11,] 6.3 6.3 3.6 4.8 7.8 NA [12,] -12.4 -10.2 -5.3 -11.0 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/1tf0e1394996740.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/2bnt21394996740.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/3av1h1394996740.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/4n44p1394996740.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,] 88.4 89.5 90.5 103.5 105.1 104.7 103.7 102.7 99.2 95.6 92.3 97.7 [2,] 90.4 89.5 94.7 104.9 105.1 107.1 108.3 103.9 99.2 99.3 94.1 98.6 [3,] 92.4 91.8 100.1 105.3 105.5 107.6 108.8 104.6 103.3 102.1 96.3 101.4 [4,] 94.2 96.9 100.4 109.6 108.3 108.9 111.6 105.2 104.3 102.4 96.6 104.1 [5,] 99.7 107.5 107.5 114.5 108.3 108.9 111.7 105.2 104.9 104.6 100.3 106.6 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.71493 86.57118 96.07239 101.979 103.2389 106.3281 106.4682 103.6814 [2,] 95.08507 97.02882 104.12761 108.621 107.7611 108.8719 111.1318 105.5186 [,9] [,10] [,11] [,12] [1,] 99.69635 99.90955 94.53351 97.51371 [2,] 106.90365 104.29045 98.06649 105.28629 $out [1] 118.7 117.8 112.3 $group [1] 5 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(88.4, 90.4, 92.4, 94.2, 99.7, 89.5, 89.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f1kg1394996740.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,] 1.1 -2.2 4.9 -4.1 -3.6 -6.1 -7.0 -7.4 -3.6 -10.5 3.6 -12.40 [2,] 1.1 0.0 7.0 -0.2 -0.9 -3.9 -4.9 -6.0 -2.5 -7.0 4.8 -11.70 [3,] 1.4 1.0 9.5 1.6 2.0 -0.1 -3.1 -3.5 -2.2 -5.5 6.3 -10.60 [4,] 2.7 8.6 10.2 3.4 2.5 3.6 -1.0 -1.3 0.1 -2.1 6.3 -7.75 [5,] 2.7 10.6 13.0 4.2 3.4 4.5 0.6 0.4 1.3 0.7 7.8 -5.30 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.269444 -5.076738 7.238888 -0.9437509 -0.4024314 -5.399481 -5.8557302 [2,] 2.530556 7.076738 11.761112 4.1437509 4.4024314 5.199481 -0.3442698 [,8] [,9] [,10] [,11] [,12] [1,] -6.8210082 -4.0371535 -8.962328 5.240104 -13.7205 [2,] -0.1789918 -0.3628465 -2.037672 7.359896 -7.4795 $out [1] 7.8 -2.9 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.09999999999999, 1.09999999999999, 1.39999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62v211394996740.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,] 99.70 92.30 88.40 89.50 90.40 NA [2,] 103.65 95.80 92.30 98.35 95.95 NA [3,] 107.50 99.25 103.40 103.00 101.55 NA [4,] 113.40 105.05 104.85 107.15 104.60 NA [5,] 118.70 108.30 111.60 109.60 107.60 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.053 95.03101 97.67586 98.98626 97.60468 NA [2,] 111.947 103.46899 109.12414 107.01374 105.49532 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(99.7, 103.65, 107.5, 113.4, 118.7, 92.3, 95.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7s5cb1394996740.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.02 91.8 92.300 [2,] 97.28 98.2 96.450 [3,] 101.93 102.7 101.550 [4,] 108.05 105.4 106.975 [5,] 109.22 108.8 109.950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.01773 99.41603 96.74948 [2,] 106.84227 105.98397 106.35052 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.02, 97.28, 101.93, 108.05, 109.22, 91.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tf0e1394996740.ps tmp/1tf0e1394996740.png",intern=TRUE)) character(0) > try(system("convert tmp/2bnt21394996740.ps tmp/2bnt21394996740.png",intern=TRUE)) character(0) > try(system("convert tmp/3av1h1394996740.ps tmp/3av1h1394996740.png",intern=TRUE)) character(0) > try(system("convert tmp/4n44p1394996740.ps tmp/4n44p1394996740.png",intern=TRUE)) character(0) > try(system("convert tmp/5f1kg1394996740.ps tmp/5f1kg1394996740.png",intern=TRUE)) character(0) > try(system("convert tmp/62v211394996740.ps tmp/62v211394996740.png",intern=TRUE)) character(0) > try(system("convert tmp/7s5cb1394996740.ps tmp/7s5cb1394996740.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.232 1.875 10.124