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(0.66,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.67,0.69,0.7,0.7,0.7,0.7,0.7,0.7,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.72,0.72,0.72,0.72,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.73,0.74,0.75,0.75,0.75,0.75,0.76,0.76,0.76,0.77,0.77,0.78,0.78,0.78,0.78,0.79,0.79,0.79,0.8,0.8,0.8,0.8,0.81,0.8,0.81,0.82,0.82,0.82,0.82) > 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,] 0.66 0.67 0.71 0.73 0.75 0.79 NA [2,] 0.67 0.69 0.71 0.73 0.76 0.80 NA [3,] 0.67 0.70 0.71 0.73 0.76 0.80 NA [4,] 0.67 0.70 0.71 0.73 0.76 0.80 NA [5,] 0.67 0.70 0.72 0.73 0.77 0.80 NA [6,] 0.67 0.70 0.72 0.73 0.77 0.81 NA [7,] 0.67 0.70 0.72 0.73 0.78 0.80 NA [8,] 0.67 0.70 0.72 0.73 0.78 0.81 NA [9,] 0.67 0.71 0.73 0.74 0.78 0.82 NA [10,] 0.67 0.71 0.73 0.75 0.78 0.82 NA [11,] 0.67 0.71 0.73 0.75 0.79 0.82 NA [12,] 0.67 0.71 0.73 0.75 0.79 0.82 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0.02 0.00 0.00 0.01 0.01 NA [2,] 0.00 0.01 0.00 0.00 0.00 0.00 NA [3,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [4,] 0.00 0.00 0.01 0.00 0.01 0.00 NA [5,] 0.00 0.00 0.00 0.00 0.00 0.01 NA [6,] 0.00 0.00 0.00 0.00 0.01 -0.01 NA [7,] 0.00 0.00 0.00 0.00 0.00 0.01 NA [8,] 0.00 0.01 0.01 0.01 0.00 0.01 NA [9,] 0.00 0.00 0.00 0.01 0.00 0.00 NA [10,] 0.00 0.00 0.00 0.00 0.01 0.00 NA [11,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [12,] 0.00 0.00 0.00 0.00 0.00 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/1hfd21362672925.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/2ixh71362672925.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/38aid1362672925.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/46o0p1362672925.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,] 0.66 0.67 0.67 0.67 0.670 0.670 0.670 0.670 0.670 0.67 0.67 0.67 [2,] 0.67 0.69 0.70 0.70 0.700 0.700 0.700 0.700 0.710 0.71 0.71 0.71 [3,] 0.72 0.72 0.72 0.72 0.725 0.725 0.725 0.725 0.735 0.74 0.74 0.74 [4,] 0.75 0.76 0.76 0.76 0.770 0.770 0.780 0.780 0.780 0.78 0.79 0.79 [5,] 0.79 0.80 0.80 0.80 0.800 0.810 0.800 0.810 0.820 0.82 0.82 0.82 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.6683974 0.6748477 0.6812981 0.6812981 0.6798477 0.6798477 0.6733974 [2,] 0.7716026 0.7651523 0.7587019 0.7587019 0.7701523 0.7701523 0.7766026 [,8] [,9] [,10] [,11] [,12] [1,] 0.6733974 0.6898477 0.6948477 0.6883974 0.6883974 [2,] 0.7766026 0.7801523 0.7851523 0.7916026 0.7916026 $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(0.66, 0.67, 0.72, 0.75, 0.79, 0.67, 0.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rnlm1362672925.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 0 0.00 0 0 0 0.00 0 0 0 0 [2,] 0.00 0 0 0.00 0 0 0 0.00 0 0 0 0 [3,] 0.01 0 0 0.00 0 0 0 0.01 0 0 0 0 [4,] 0.01 0 0 0.01 0 0 0 0.01 0 0 0 0 [5,] 0.02 0 0 0.01 0 0 0 0.01 0 0 0 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.003549677 0 0 -0.006450323 0 0 0 0.003549677 0 0 [2,] 0.016450323 0 0 0.006450323 0 0 0 0.016450323 0 0 [,11] [,12] [1,] 0 0 [2,] 0 0 $out [1] 0.01 0.01 0.01 -0.01 0.01 0.01 0.01 $group [1] 2 5 6 6 7 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.01, 0.01, 0.0199999999999999, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62ryb1362672925.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,] 0.67 0.69 0.71 0.730 0.750 0.790 NA [2,] 0.67 0.70 0.71 0.730 0.760 0.800 NA [3,] 0.67 0.70 0.72 0.730 0.775 0.805 NA [4,] 0.67 0.71 0.73 0.745 0.780 0.820 NA [5,] 0.67 0.71 0.73 0.750 0.790 0.820 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.67 0.6954389 0.7108779 0.7231584 0.7658779 0.7958779 NA [2,] 0.67 0.7045611 0.7291221 0.7368416 0.7841221 0.8141221 NA $out [1] 0.66 0.67 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.67, 0.67, 0.67, 0.67, 0.67, 0.69, 0.7, 0.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74pww1362672925.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,] 0.7183333 0.7200 0.712500 [2,] 0.7283333 0.7200 0.727500 [3,] 0.7333333 0.7250 0.734375 [4,] 0.7425000 0.7375 0.743125 [5,] 0.7450000 0.7400 0.747500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.7268718 0.7170181 0.7272483 [2,] 0.7397948 0.7329819 0.7415017 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(0.718333333333333, 0.728333333333333, 0.733333333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hfd21362672925.ps tmp/1hfd21362672925.png",intern=TRUE)) character(0) > try(system("convert tmp/2ixh71362672925.ps tmp/2ixh71362672925.png",intern=TRUE)) character(0) > try(system("convert tmp/38aid1362672925.ps tmp/38aid1362672925.png",intern=TRUE)) character(0) > try(system("convert tmp/46o0p1362672925.ps tmp/46o0p1362672925.png",intern=TRUE)) character(0) > try(system("convert tmp/5rnlm1362672925.ps tmp/5rnlm1362672925.png",intern=TRUE)) character(0) > try(system("convert tmp/62ryb1362672925.ps tmp/62ryb1362672925.png",intern=TRUE)) character(0) > try(system("convert tmp/74pww1362672925.ps tmp/74pww1362672925.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.449 0.616 4.051