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(1.44,1.45,1.45,1.47,1.49,1.5,1.5,1.5,1.5,1.5,1.5,1.51,1.52,1.51,1.51,1.51,1.52,1.52,1.52,1.52,1.52,1.53,1.53,1.53,1.53,1.54,1.54,1.55,1.56,1.55,1.56,1.56,1.56,1.56,1.57,1.56,1.57,1.58,1.58,1.58,1.6,1.61,1.61,1.61,1.6,1.59,1.56,1.57,1.55,1.59,1.62,1.63,1.62,1.56,1.56,1.54,1.54,1.52,1.56,1.59,1.61,1.56,1.51,1.48,1.49,1.48,1.47,1.47,1.46,1.45,1.45,1.45) > 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.44 1.52 1.53 1.57 1.55 1.61 NA [2,] 1.45 1.51 1.54 1.58 1.59 1.56 NA [3,] 1.45 1.51 1.54 1.58 1.62 1.51 NA [4,] 1.47 1.51 1.55 1.58 1.63 1.48 NA [5,] 1.49 1.52 1.56 1.60 1.62 1.49 NA [6,] 1.50 1.52 1.55 1.61 1.56 1.48 NA [7,] 1.50 1.52 1.56 1.61 1.56 1.47 NA [8,] 1.50 1.52 1.56 1.61 1.54 1.47 NA [9,] 1.50 1.52 1.56 1.60 1.54 1.46 NA [10,] 1.50 1.53 1.56 1.59 1.52 1.45 NA [11,] 1.50 1.53 1.57 1.56 1.56 1.45 NA [12,] 1.51 1.53 1.56 1.57 1.59 1.45 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 -0.01 0.01 0.01 0.04 -0.05 NA [2,] 0.00 0.00 0.00 0.00 0.03 -0.05 NA [3,] 0.02 0.00 0.01 0.00 0.01 -0.03 NA [4,] 0.02 0.01 0.01 0.02 -0.01 0.01 NA [5,] 0.01 0.00 -0.01 0.01 -0.06 -0.01 NA [6,] 0.00 0.00 0.01 0.00 0.00 -0.01 NA [7,] 0.00 0.00 0.00 0.00 -0.02 0.00 NA [8,] 0.00 0.00 0.00 -0.01 0.00 -0.01 NA [9,] 0.00 0.01 0.00 -0.01 -0.02 -0.01 NA [10,] 0.00 0.00 0.01 -0.03 0.04 0.00 NA [11,] 0.01 0.00 -0.01 0.01 0.03 0.00 NA [12,] 0.01 0.00 0.01 -0.02 0.02 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/14wwn1350933006.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/2er8m1350933006.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/3uynh1350933006.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/4esqe1350933006.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.52 1.45 1.450 1.47 1.49 1.480 1.47 1.47 1.46 1.450 1.450 1.450 [2,] 1.52 1.51 1.510 1.48 1.49 1.500 1.50 1.50 1.50 1.500 1.500 1.510 [3,] 1.54 1.55 1.525 1.53 1.54 1.535 1.54 1.53 1.53 1.525 1.545 1.545 [4,] 1.57 1.58 1.580 1.58 1.60 1.560 1.56 1.56 1.56 1.560 1.560 1.570 [5,] 1.61 1.59 1.620 1.63 1.62 1.610 1.61 1.61 1.60 1.590 1.570 1.590 $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.507748 1.504848 1.479848 1.465497 1.469046 1.496298 1.501298 1.491298 [2,] 1.572252 1.595152 1.570152 1.594503 1.610954 1.573702 1.578702 1.568702 [,9] [,10] [,11] [,12] [1,] 1.491298 1.486298 1.506298 1.506298 [2,] 1.568702 1.563702 1.583702 1.583702 $out [1] 1.44 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.52, 1.52, 1.54, 1.57, 1.61, 1.45, 1.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5x9y51350933006.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.01 0 0.000 0.01 -0.010 0 0 -0.01 -0.020 0.00 -0.010 0.00 [2,] -0.01 0 0.000 0.01 -0.010 0 0 -0.01 -0.010 0.00 0.000 0.00 [3,] 0.01 0 0.005 0.01 -0.005 0 0 0.00 -0.005 0.00 0.005 0.01 [4,] 0.01 0 0.010 0.02 0.010 0 0 0.00 0.000 0.01 0.010 0.01 [5,] 0.04 0 0.020 0.02 0.010 0 0 0.00 0.010 0.01 0.010 0.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.002900646 0 -0.001450323 0.003549677 -0.017900646 0 0 [2,] 0.022900646 0 0.011450323 0.016450323 0.007900646 0 0 [,8] [,9] [,10] [,11] [,12] [1,] -0.006450323 -0.011450323 -0.006450323 -0.001450323 0.002934025 [2,] 0.006450323 0.001450323 0.006450323 0.011450323 0.017065975 $out [1] -0.05 0.03 -0.05 -0.03 -0.01 -0.06 0.01 -0.01 -0.02 -0.03 0.04 0.03 [13] -0.02 $group [1] 1 2 2 3 4 5 6 6 7 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, -0.01, 0.01, 0.01, 0.04, 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/64eqp1350933006.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.44 1.510 1.530 1.560 1.520 1.450 NA [2,] 1.46 1.515 1.545 1.575 1.545 1.455 NA [3,] 1.50 1.520 1.560 1.585 1.560 1.475 NA [4,] 1.50 1.525 1.560 1.605 1.605 1.500 NA [5,] 1.51 1.530 1.570 1.610 1.630 1.560 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.481756 1.515439 1.553158 1.571317 1.532634 1.454475 NA [2,] 1.518244 1.524561 1.566842 1.598683 1.587366 1.495525 NA $out [1] 1.61 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.44, 1.46, 1.5, 1.5, 1.51, 1.51, 1.515, 1.52, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7v1r51350933006.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.525000 1.5250 1.528750 [2,] 1.531667 1.5300 1.530000 [3,] 1.535833 1.5375 1.533125 [4,] 1.536667 1.5425 1.542500 [5,] 1.538333 1.5500 1.546250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.533553 1.531799 1.527424 [2,] 1.538114 1.543201 1.538826 $out [1] 1.546667 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.525, 1.53166666666667, 1.53583333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14wwn1350933006.ps tmp/14wwn1350933006.png",intern=TRUE)) character(0) > try(system("convert tmp/2er8m1350933006.ps tmp/2er8m1350933006.png",intern=TRUE)) character(0) > try(system("convert tmp/3uynh1350933006.ps tmp/3uynh1350933006.png",intern=TRUE)) character(0) > try(system("convert tmp/4esqe1350933006.ps tmp/4esqe1350933006.png",intern=TRUE)) character(0) > try(system("convert tmp/5x9y51350933006.ps tmp/5x9y51350933006.png",intern=TRUE)) character(0) > try(system("convert tmp/64eqp1350933006.ps tmp/64eqp1350933006.png",intern=TRUE)) character(0) > try(system("convert tmp/7v1r51350933006.ps tmp/7v1r51350933006.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.659 0.702 4.352