R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(164.88,164.88,164.57,164.53,165.03,165.92,165.92,165.92,165.92,166.12,166.34,165.48,165.61,165.61,165.94,165.88,166.23,166.32,166.43,166.43,166.2,166.21,168.02,168.68,168.65,168.65,168.75,168.8,168.58,168.98,169,169,168.94,169.96,171.59,172.41,172.65,172.65,172.65,172.38,171.95,171.95,171.87,171.87,171.91,171.99,172.15,172.73,173.2,164.97,164.97,164.43,163.16,162.98,161.69,162.19,162,162.22,164.08,164.58,164.68) > 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] 61 > (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] 6 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 164.88 165.61 168.65 172.65 173.20 164.68 [2,] 164.88 165.61 168.65 172.65 164.97 NA [3,] 164.57 165.94 168.75 172.65 164.97 NA [4,] 164.53 165.88 168.80 172.38 164.43 NA [5,] 165.03 166.23 168.58 171.95 163.16 NA [6,] 165.92 166.32 168.98 171.95 162.98 NA [7,] 165.92 166.43 169.00 171.87 161.69 NA [8,] 165.92 166.43 169.00 171.87 162.19 NA [9,] 165.92 166.20 168.94 171.91 162.00 NA [10,] 166.12 166.21 169.96 171.99 162.22 NA [11,] 166.34 168.02 171.59 172.15 164.08 NA [12,] 165.48 168.68 172.41 172.73 164.58 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.00 0.00 0.00 0.00 -8.23 NA [2,] -0.31 0.33 0.10 0.00 0.00 NA [3,] -0.04 -0.06 0.05 -0.27 -0.54 NA [4,] 0.50 0.35 -0.22 -0.43 -1.27 NA [5,] 0.89 0.09 0.40 0.00 -0.18 NA [6,] 0.00 0.11 0.02 -0.08 -1.29 NA [7,] 0.00 0.00 0.00 0.00 0.50 NA [8,] 0.00 -0.23 -0.06 0.04 -0.19 NA [9,] 0.20 0.01 1.02 0.08 0.22 NA [10,] 0.22 1.81 1.63 0.16 1.86 NA [11,] -0.86 0.66 0.82 0.58 0.50 NA [12,] 0.13 -0.03 0.24 0.47 0.10 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/1gui21413039301.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/2t1641413039301.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/3rva31413039301.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/4xny91413039301.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,] 164.68 164.88 164.57 164.43 163.16 162.98 161.69 162.19 162.00 162.22 [2,] 164.88 164.97 164.97 164.53 165.03 165.92 165.92 165.92 165.92 166.12 [3,] 167.13 165.61 165.94 165.88 166.23 166.32 166.43 166.43 166.20 166.21 [4,] 172.65 168.65 168.75 168.80 168.58 168.98 169.00 169.00 168.94 169.96 [5,] 173.20 172.65 172.65 172.38 171.95 171.95 171.87 171.87 171.91 171.99 [,11] [,12] [1,] 164.08 164.58 [2,] 166.34 165.48 [3,] 168.02 168.68 [4,] 171.59 172.41 [5,] 172.15 172.73 $n [1] 6 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 162.1181 163.0097 163.2691 162.8628 163.7216 164.1578 164.2537 164.2537 [2,] 172.1419 168.2103 168.6109 168.8972 168.7384 168.4822 168.6063 168.6063 [,9] [,10] [,11] [,12] [1,] 164.0661 163.4967 164.3104 163.7833 [2,] 168.3339 168.9233 171.7296 173.5767 $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(164.68, 164.88, 167.13, 172.65, 173.2, 164.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fqzp1413039301.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.0 -0.54 -1.27 -0.18 -0.08 0 -0.23 0.01 0.16 0.50 -0.03 [2,] 0 0.0 -0.27 -0.43 0.00 -0.08 0 -0.19 0.08 0.22 0.50 0.10 [3,] 0 0.0 -0.06 -0.22 0.09 0.00 0 -0.06 0.20 1.63 0.58 0.13 [4,] 0 0.1 -0.04 0.35 0.40 0.02 0 0.00 0.22 1.81 0.66 0.24 [5,] 0 0.1 0.05 0.50 0.89 0.11 0 0.04 0.22 1.86 0.82 0.24 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 -0.07065975 -0.2225174 -0.771146 -0.192639 -0.07065975 0 [2,] 0 0.07065975 0.1025174 0.331146 0.372639 0.07065975 0 [,8] [,9] [,10] [,11] [,12] [1,] -0.19425352 0.1010764 0.50651 0.4669444 0.03107635 [2,] 0.07425352 0.2989236 2.75349 0.6930556 0.22892365 $out [1] -8.23 -0.31 0.33 -1.29 0.50 1.02 -0.86 0.47 $group [1] 1 2 2 6 7 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0, 0, 0.0999999999999943, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61qo11413039301.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,] 164.53 165.61 168.58 171.87 161.690 164.68 [2,] 164.88 165.91 168.70 171.93 162.205 164.68 [3,] 165.70 166.22 168.96 172.07 163.620 164.68 [4,] 165.92 166.43 169.48 172.65 164.775 164.68 [5,] 166.34 166.43 169.96 172.73 164.970 164.68 $n [1] 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 165.2256 165.9828 168.6042 171.7416 162.4478 164.68 [2,] 166.1744 166.4572 169.3158 172.3984 164.7922 164.68 $out [1] 168.02 168.68 171.59 172.41 173.20 $group [1] 2 2 3 3 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(164.53, 164.88, 165.7, 165.92, 166.34, 165.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7eesr1413039301.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,] 166.9820 165.610 166.6650 [2,] 167.0380 166.070 166.8350 [3,] 167.2650 166.275 167.4550 [4,] 167.8272 166.780 168.1981 [5,] 168.7760 167.130 168.9650 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 166.9051 165.9512 166.8333 [2,] 167.6249 166.5988 168.0767 $out [1] 168.02 168.68 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(166.982, 167.038, 167.265, 167.827166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gui21413039301.ps tmp/1gui21413039301.png",intern=TRUE)) character(0) > try(system("convert tmp/2t1641413039301.ps tmp/2t1641413039301.png",intern=TRUE)) character(0) > try(system("convert tmp/3rva31413039301.ps tmp/3rva31413039301.png",intern=TRUE)) character(0) > try(system("convert tmp/4xny91413039301.ps tmp/4xny91413039301.png",intern=TRUE)) character(0) > try(system("convert tmp/5fqzp1413039301.ps tmp/5fqzp1413039301.png",intern=TRUE)) character(0) > try(system("convert tmp/61qo11413039301.ps tmp/61qo11413039301.png",intern=TRUE)) character(0) > try(system("convert tmp/7eesr1413039301.ps tmp/7eesr1413039301.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.479 0.412 2.922