R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(1.65,1.66,1.66,1.67,1.68,1.68,1.68,1.68,1.69,1.7,1.7,1.71,1.72,1.73,1.74,1.74,1.75,1.75,1.75,1.76,1.79,1.83,1.84,1.85,1.87,1.87,1.87,1.88,1.88,1.88,1.88,1.89,1.89,1.89,1.9,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.89,1.9,1.9,1.92,1.93,1.92,1.95,1.96,1.96,1.96,1.96,1.96,1.97,1.97,1.97,1.97,1.97,1.97) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.65 1.72 1.87 1.89 1.89 1.95 NA [2,] 1.66 1.73 1.87 1.89 1.89 1.96 NA [3,] 1.66 1.74 1.87 1.89 1.89 1.96 NA [4,] 1.67 1.74 1.88 1.89 1.89 1.96 NA [5,] 1.68 1.75 1.88 1.89 1.89 1.96 NA [6,] 1.68 1.75 1.88 1.89 1.89 1.96 NA [7,] 1.68 1.75 1.88 1.89 1.89 1.97 NA [8,] 1.68 1.76 1.89 1.89 1.90 1.97 NA [9,] 1.69 1.79 1.89 1.89 1.90 1.97 NA [10,] 1.70 1.83 1.89 1.89 1.92 1.97 NA [11,] 1.70 1.84 1.90 1.89 1.93 1.97 NA [12,] 1.71 1.85 1.89 1.89 1.92 1.97 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0.01 0.00 0 0.00 0.01 NA [2,] 0.00 0.01 0.00 0 0.00 0.00 NA [3,] 0.01 0.00 0.01 0 0.00 0.00 NA [4,] 0.01 0.01 0.00 0 0.00 0.00 NA [5,] 0.00 0.00 0.00 0 0.00 0.00 NA [6,] 0.00 0.00 0.00 0 0.00 0.01 NA [7,] 0.00 0.01 0.01 0 0.01 0.00 NA [8,] 0.01 0.03 0.00 0 0.00 0.00 NA [9,] 0.01 0.04 0.00 0 0.02 0.00 NA [10,] 0.00 0.01 0.01 0 0.01 0.00 NA [11,] 0.01 0.01 -0.01 0 -0.01 0.00 NA [12,] 0.01 0.02 0.00 0 0.03 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/fisher/rcomp/tmp/16ct21358278358.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/fisher/rcomp/tmp/21mw11358278358.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/fisher/rcomp/tmp/36a3m1358278358.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/fisher/rcomp/tmp/4n3tj1358278358.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,] 1.65 1.66 1.66 1.670 1.680 1.680 1.680 1.68 1.69 1.70 1.840 1.85 [2,] 1.72 1.73 1.74 1.740 1.750 1.750 1.750 1.76 1.79 1.83 1.840 1.85 [3,] 1.88 1.88 1.88 1.885 1.885 1.885 1.885 1.89 1.89 1.89 1.895 1.89 [4,] 1.89 1.89 1.89 1.890 1.890 1.890 1.890 1.90 1.90 1.92 1.930 1.92 [5,] 1.95 1.96 1.96 1.960 1.960 1.960 1.970 1.97 1.97 1.97 1.970 1.97 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.770345 1.776795 1.783245 1.788245 1.794695 1.794695 1.794695 1.799695 [2,] 1.989655 1.983205 1.976755 1.981755 1.975305 1.975305 1.975305 1.980305 [,9] [,10] [,11] [,12] [1,] 1.819046 1.831947 1.836947 1.844848 [2,] 1.960954 1.948053 1.953053 1.935152 $out [1] 1.70 1.71 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.65, 1.72, 1.88, 1.89, 1.95, 1.66, 1.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/57owm1358278358.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.000 0 0.00 0.00 0 0 0.000 0.00 0.000 0.000 -0.01 0.00 [2,] 0.000 0 0.00 0.00 0 0 0.000 0.00 0.000 0.000 -0.01 0.00 [3,] 0.005 0 0.00 0.00 0 0 0.005 0.00 0.005 0.005 0.00 0.01 [4,] 0.010 0 0.01 0.01 0 0 0.010 0.01 0.020 0.010 0.01 0.02 [5,] 0.010 0 0.01 0.01 0 0 0.010 0.01 0.040 0.010 0.01 0.03 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.001450323 0 -0.006450323 -0.006450323 0 0 -0.001450323 [2,] 0.011450323 0 0.006450323 0.006450323 0 0 0.011450323 [,8] [,9] [,10] [,11] [,12] [1,] -0.006450323 -0.007900646 -0.001450323 -0.01290065 -0.00413195 [2,] 0.006450323 0.017900646 0.011450323 0.01290065 0.02413195 $out [1] 0.01 0.01 0.03 $group [1] 2 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.005, 0.01, 0.01, 0, 0, 0, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/63vvq1358278358.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] [1,] 1.650 1.72 1.870 1.89 1.89 1.950 NA [2,] 1.665 1.74 1.875 1.89 1.89 1.960 NA [3,] 1.680 1.75 1.880 1.89 1.89 1.965 NA [4,] 1.695 1.81 1.890 1.89 1.91 1.970 NA [5,] 1.710 1.85 1.900 1.89 1.93 1.970 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.666317 1.718073 1.873158 1.89 1.880878 1.960439 NA [2,] 1.693683 1.781927 1.886842 1.89 1.899122 1.969561 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.65, 1.665, 1.68, 1.695, 1.71, 1.72, 1.74, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7q5g31358278358.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,] 1.828333 1.8800 1.823750 [2,] 1.836667 1.8825 1.831875 [3,] 1.842500 1.8850 1.836250 [4,] 1.860833 1.8900 1.867500 [5,] 1.871667 1.8950 1.887500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.831477 1.881579 1.820001 [2,] 1.853523 1.888421 1.852499 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.82833333333333, 1.83666666666667, 1.8425, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16ct21358278358.ps tmp/16ct21358278358.png",intern=TRUE)) character(0) > try(system("convert tmp/21mw11358278358.ps tmp/21mw11358278358.png",intern=TRUE)) character(0) > try(system("convert tmp/36a3m1358278358.ps tmp/36a3m1358278358.png",intern=TRUE)) character(0) > try(system("convert tmp/4n3tj1358278358.ps tmp/4n3tj1358278358.png",intern=TRUE)) character(0) > try(system("convert tmp/57owm1358278358.ps tmp/57owm1358278358.png",intern=TRUE)) character(0) > try(system("convert tmp/63vvq1358278358.ps tmp/63vvq1358278358.png",intern=TRUE)) character(0) > try(system("convert tmp/7q5g31358278358.ps tmp/7q5g31358278358.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.622 1.013 4.653