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(20.1,20.1,20.1,20.3,20.7,20.6,20.3,19.9,19.7,19.4,19.1,18.8,18.9,18.7,18.8,19.5,19.3,19.1,19.1,19,18.8,19.2,18.9,18.7,18.5,18.4,18.3,18.3,18.3,18.5,19.2,19.4,19.1,19.5,18.8,19.3,20.4,20.9,21.1,20.6,20.4,20.8,21.1,21.6,22,22.2,22.4,22.8,22.7,22.8,22.9,22.9,22.6,21.9,20.8,20.3,20.4,21.2,21.4,20.9,20,19.5,19.2,19.3,19.4,19.5,20,20.1,19.5,18.6,18.4,18.4,19.3,19.8,19.8,19.8,20.1,20.3,19.7,20.2,20.6,21,21.4,21.9) > 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,] 20.1 18.9 18.5 20.4 22.7 20.0 19.3 NA [2,] 20.1 18.7 18.4 20.9 22.8 19.5 19.8 NA [3,] 20.1 18.8 18.3 21.1 22.9 19.2 19.8 NA [4,] 20.3 19.5 18.3 20.6 22.9 19.3 19.8 NA [5,] 20.7 19.3 18.3 20.4 22.6 19.4 20.1 NA [6,] 20.6 19.1 18.5 20.8 21.9 19.5 20.3 NA [7,] 20.3 19.1 19.2 21.1 20.8 20.0 19.7 NA [8,] 19.9 19.0 19.4 21.6 20.3 20.1 20.2 NA [9,] 19.7 18.8 19.1 22.0 20.4 19.5 20.6 NA [10,] 19.4 19.2 19.5 22.2 21.2 18.6 21.0 NA [11,] 19.1 18.9 18.8 22.4 21.4 18.4 21.4 NA [12,] 18.8 18.7 19.3 22.8 20.9 18.4 21.9 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.0 -0.2 -0.1 0.5 0.1 -0.5 0.5 NA [2,] 0.0 0.1 -0.1 0.2 0.1 -0.3 0.0 NA [3,] 0.2 0.7 0.0 -0.5 0.0 0.1 0.0 NA [4,] 0.4 -0.2 0.0 -0.2 -0.3 0.1 0.3 NA [5,] -0.1 -0.2 0.2 0.4 -0.7 0.1 0.2 NA [6,] -0.3 0.0 0.7 0.3 -1.1 0.5 -0.6 NA [7,] -0.4 -0.1 0.2 0.5 -0.5 0.1 0.5 NA [8,] -0.2 -0.2 -0.3 0.4 0.1 -0.6 0.4 NA [9,] -0.3 0.4 0.4 0.2 0.8 -0.9 0.4 NA [10,] -0.3 -0.3 -0.7 0.2 0.2 -0.2 0.4 NA [11,] -0.3 -0.2 0.5 0.4 -0.5 0.0 0.5 NA [12,] 0.1 -0.2 1.1 -0.1 -0.9 0.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/13bn21381772770.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/2r0vm1381772770.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/3eddh1381772770.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/4huzh1381772770.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,] 18.50 18.4 18.3 18.30 18.30 18.5 19.10 19.00 18.8 18.6 18.40 18.40 [2,] 19.10 19.1 19.0 19.40 19.35 19.3 19.45 19.65 19.3 19.3 18.85 18.75 [3,] 20.00 19.8 19.8 19.80 20.10 20.3 20.00 20.10 19.7 19.5 19.10 19.30 [4,] 20.25 20.5 20.6 20.45 20.55 20.7 20.55 20.25 20.5 21.1 21.40 21.40 [5,] 20.40 20.9 22.9 20.60 20.70 21.9 21.10 20.30 22.0 22.2 22.40 22.80 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 19.31324 18.96394 18.84451 19.17296 19.38338 19.46394 19.3431 19.74169 [2,] 20.68676 20.63606 20.75549 20.42704 20.81662 21.13606 20.6569 20.45831 [,9] [,10] [,11] [,12] [1,] 18.98338 18.42507 17.57718 17.71746 [2,] 20.41662 20.57493 20.62282 20.88254 $out [1] 22.7 22.8 22.9 22.6 21.6 $group [1] 1 2 4 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(18.5, 19.1, 20, 20.25, 20.4, 18.4, 19.1, 19.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hy7l1381772770.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] [1,] -0.50 -0.10 0.00 -0.3 -0.20 -1.10 -0.50 -0.60 -0.30 -0.7 -0.50 [2,] -0.15 -0.05 0.00 -0.2 -0.15 -0.45 -0.25 -0.25 -0.05 -0.3 -0.25 [3,] 0.00 0.00 0.00 0.0 0.10 0.00 0.10 -0.20 0.40 -0.2 0.00 [4,] 0.30 0.10 0.15 0.2 0.20 0.40 0.35 0.25 0.40 0.2 0.45 [5,] 0.50 0.20 0.20 0.4 0.40 0.70 0.50 0.40 0.80 0.4 0.50 [,12] [1,] -9.000000e-01 [2,] -2.000000e-01 [3,] -1.776357e-15 [4,] 9.000000e-01 [5,] 1.100000e+00 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.2687327 -0.08957758 -0.08957758 -0.2388735 -0.1090144 -0.5076063 [2,] 0.2687327 0.08957758 0.08957758 0.2388735 0.3090144 0.5076063 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.2583103 -0.49859193 0.1312673 -0.49859193 -0.4180287 -0.7095355 [2,] 0.4583103 0.09859193 0.6687327 0.09859193 0.4180287 0.7095355 $out [1] -0.3 0.7 -0.5 -0.7 -0.9 $group [1] 2 3 3 5 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.5, -0.15, 0, 0.300000000000001, 0.5, -0.0999999999999979, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67w1b1381772770.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,] 18.80 18.70 18.30 20.4 20.30 18.40 19.30 NA [2,] 19.55 18.80 18.35 20.7 20.85 18.90 19.80 NA [3,] 20.10 18.95 18.65 21.1 21.65 19.45 20.15 NA [4,] 20.30 19.15 19.25 22.1 22.75 19.75 20.80 NA [5,] 20.70 19.50 19.50 22.8 22.90 20.10 21.90 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 19.75792 18.79036 18.2395 20.46145 20.7834 19.06231 19.69389 NA [2,] 20.44208 19.10964 19.0605 21.73855 22.5166 19.83769 20.60611 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(18.8, 19.55, 20.1, 20.3, 20.7, 18.7, 18.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7b6ul1381772770.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,] 19.98571 19.10 19.6750 [2,] 20.02857 19.60 19.8500 [3,] 20.06429 19.80 19.9500 [4,] 20.10714 20.05 20.0375 [5,] 20.15714 20.30 20.2000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20.02845 19.59475 19.86448 [2,] 20.10012 20.00525 20.03552 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(19.9857142857143, 20.0285714285714, 20.0642857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13bn21381772770.ps tmp/13bn21381772770.png",intern=TRUE)) character(0) > try(system("convert tmp/2r0vm1381772770.ps tmp/2r0vm1381772770.png",intern=TRUE)) character(0) > try(system("convert tmp/3eddh1381772770.ps tmp/3eddh1381772770.png",intern=TRUE)) character(0) > try(system("convert tmp/4huzh1381772770.ps tmp/4huzh1381772770.png",intern=TRUE)) character(0) > try(system("convert tmp/5hy7l1381772770.ps tmp/5hy7l1381772770.png",intern=TRUE)) character(0) > try(system("convert tmp/67w1b1381772770.ps tmp/67w1b1381772770.png",intern=TRUE)) character(0) > try(system("convert tmp/7b6ul1381772770.ps tmp/7b6ul1381772770.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.119 1.097 6.193