R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" 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.47,0.47,0.47,0.47,0.47,0.47,0.48,0.48,0.48,0.48,0.48,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.51,0.51,0.5,0.51,0.5,0.51,0.51,0.52,0.53,0.53,0.53,0.53,0.53,0.54,0.55,0.54,0.55,0.55,0.55,0.54,0.55,0.55,0.55,0.55,0.56,0.56,0.56,0.56,0.55,0.55,0.56,0.56,0.56,0.56,0.56,0.55,0.55,0.55,0.54,0.54,0.54,0.54,0.55,0.54,0.54,0.54) > par1 = '6' > par1 <- '6' > #'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] 12 > 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] 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.47 0.48 0.49 0.5 0.50 0.50 0.53 0.55 0.55 0.55 0.56 0.54 NA [2,] 0.47 0.48 0.49 0.5 0.50 0.51 0.53 0.55 0.55 0.55 0.55 0.54 NA [3,] 0.47 0.48 0.49 0.5 0.51 0.51 0.53 0.55 0.56 0.56 0.55 0.55 NA [4,] 0.47 0.48 0.49 0.5 0.51 0.52 0.54 0.54 0.56 0.56 0.55 0.54 NA [5,] 0.47 0.48 0.49 0.5 0.50 0.53 0.55 0.55 0.56 0.56 0.54 0.54 NA [6,] 0.47 0.49 0.49 0.5 0.51 0.53 0.54 0.55 0.56 0.56 0.54 0.54 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.00 0.00 0.00 0 0.00 0.01 0.00 0.00 0.00 0.00 -0.01 0.00 NA [2,] 0.00 0.00 0.00 0 0.01 0.00 0.00 0.00 0.01 0.01 0.00 0.01 NA [3,] 0.00 0.00 0.00 0 0.00 0.01 0.01 -0.01 0.00 0.00 0.00 -0.01 NA [4,] 0.00 0.00 0.00 0 -0.01 0.01 0.01 0.01 0.00 0.00 -0.01 0.00 NA [5,] 0.00 0.01 0.00 0 0.01 0.00 -0.01 0.00 0.00 0.00 0.00 0.00 NA [6,] 0.01 0.00 0.01 0 -0.01 0.00 0.01 0.00 -0.01 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/19na31350652535.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/2jayx1350652535.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/3zbte1350652535.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/4qs681350652535.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] [1,] 0.470 0.470 0.470 0.470 0.470 0.470 [2,] 0.495 0.495 0.495 0.495 0.495 0.495 [3,] 0.515 0.520 0.520 0.530 0.535 0.535 [4,] 0.550 0.550 0.550 0.545 0.550 0.545 [5,] 0.560 0.550 0.560 0.560 0.560 0.560 $n [1] 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.4899141 0.4949141 0.4949141 0.5071947 0.5099141 0.5121947 [2,] 0.5400859 0.5450859 0.5450859 0.5528053 0.5600859 0.5578053 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" Warning message: In bxp(list(stats = c(0.47, 0.495, 0.515, 0.55, 0.56, 0.47, 0.495, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/568wa1350652535.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] [1,] 0 0.00 0 0.000 0 0.000 [2,] 0 0.00 0 0.000 0 0.000 [3,] 0 0.00 0 0.000 0 0.000 [4,] 0 0.01 0 0.005 0 0.005 [5,] 0 0.01 0 0.010 0 0.010 $n [1] 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 -0.004561067 0 -0.002280534 0 -0.00238194 [2,] 0 0.004561067 0 0.002280534 0 0.00238194 $out [1] 0.01 -0.01 0.01 0.01 -0.01 -0.01 -0.01 -0.01 0.01 0.01 -0.01 -0.01 [13] -0.01 $group [1] 1 1 3 3 3 3 4 4 5 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0.01, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l71w1350652535.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] [,9] [,10] [,11] [,12] [,13] [1,] 0.47 0.48 0.49 0.5 0.500 0.500 0.530 0.55 0.55 0.55 0.54 0.54 NA [2,] 0.47 0.48 0.49 0.5 0.500 0.510 0.530 0.55 0.55 0.55 0.54 0.54 NA [3,] 0.47 0.48 0.49 0.5 0.505 0.515 0.535 0.55 0.56 0.56 0.55 0.54 NA [4,] 0.47 0.48 0.49 0.5 0.510 0.530 0.540 0.55 0.56 0.56 0.55 0.54 NA [5,] 0.47 0.48 0.49 0.5 0.510 0.530 0.550 0.55 0.56 0.56 0.56 0.54 NA $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.47 0.48 0.49 0.5 0.4985497 0.5020994 0.5285497 0.55 0.5535497 0.5535497 [2,] 0.47 0.48 0.49 0.5 0.5114503 0.5279006 0.5414503 0.55 0.5664503 0.5664503 [,11] [,12] [,13] [1,] 0.5435497 0.54 NA [2,] 0.5564503 0.54 NA $out [1] 0.49 0.54 0.55 $group [1] 2 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(0.47, 0.47, 0.47, 0.47, 0.47, 0.48, 0.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7w5be1350652535.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.5183333 0.515 0.52000 [2,] 0.5183333 0.520 0.52000 [3,] 0.5216667 0.525 0.52375 [4,] 0.5225000 0.535 0.52375 [5,] 0.5233333 0.535 0.52375 $n [1] 6 6 6 $conf [,1] [,2] [,3] [1,] 0.5189790 0.5153245 0.5213311 [2,] 0.5243543 0.5346755 0.5261689 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(0.518333333333333, 0.518333333333333, 0.521666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19na31350652535.ps tmp/19na31350652535.png",intern=TRUE)) character(0) > try(system("convert tmp/2jayx1350652535.ps tmp/2jayx1350652535.png",intern=TRUE)) character(0) > try(system("convert tmp/3zbte1350652535.ps tmp/3zbte1350652535.png",intern=TRUE)) character(0) > try(system("convert tmp/4qs681350652535.ps tmp/4qs681350652535.png",intern=TRUE)) character(0) > try(system("convert tmp/568wa1350652535.ps tmp/568wa1350652535.png",intern=TRUE)) character(0) > try(system("convert tmp/6l71w1350652535.ps tmp/6l71w1350652535.png",intern=TRUE)) character(0) > try(system("convert tmp/7w5be1350652535.ps tmp/7w5be1350652535.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.599 0.583 4.183