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(49.98,50.12,50.37,50.39,50.34,50.32,50.32,50.32,50.67,50.86,50.95,51.02,51.02,51.06,50.9,51.23,51.29,51.3,51.3,51.3,51.46,51.47,51.77,51.82,51.82,51.84,51.9,51.94,52.22,52.27,52.27,52.28,52.53,52.73,52.72,52.67,52.67,52.65,52.69,52.73,52.84,52.83,52.83,52.84,52.82,53.09,53.4,53.43,53.43,53.42,53.6,53.69,54.05,54.04,54.04,54.08,54.05,54.39,54.38,54.46,54.46,54.69,54.91,55.52,56.01,56.07,56.07,56.09,56.29,56.45,56.87,56.87) > 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,] 49.98 51.02 51.82 52.67 53.43 54.46 NA [2,] 50.12 51.06 51.84 52.65 53.42 54.69 NA [3,] 50.37 50.90 51.90 52.69 53.60 54.91 NA [4,] 50.39 51.23 51.94 52.73 53.69 55.52 NA [5,] 50.34 51.29 52.22 52.84 54.05 56.01 NA [6,] 50.32 51.30 52.27 52.83 54.04 56.07 NA [7,] 50.32 51.30 52.27 52.83 54.04 56.07 NA [8,] 50.32 51.30 52.28 52.84 54.08 56.09 NA [9,] 50.67 51.46 52.53 52.82 54.05 56.29 NA [10,] 50.86 51.47 52.73 53.09 54.39 56.45 NA [11,] 50.95 51.77 52.72 53.40 54.38 56.87 NA [12,] 51.02 51.82 52.67 53.43 54.46 56.87 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.14 0.04 0.02 -0.02 -0.01 0.23 NA [2,] 0.25 -0.16 0.06 0.04 0.18 0.22 NA [3,] 0.02 0.33 0.04 0.04 0.09 0.61 NA [4,] -0.05 0.06 0.28 0.11 0.36 0.49 NA [5,] -0.02 0.01 0.05 -0.01 -0.01 0.06 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.00 0.00 0.01 0.01 0.04 0.02 NA [8,] 0.35 0.16 0.25 -0.02 -0.03 0.20 NA [9,] 0.19 0.01 0.20 0.27 0.34 0.16 NA [10,] 0.09 0.30 -0.01 0.31 -0.01 0.42 NA [11,] 0.07 0.05 -0.05 0.03 0.08 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/1ghp61350823268.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/2silv1350823268.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/3szpb1350823268.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/4mu2f1350823268.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] [1,] 49.980 50.120 50.370 50.390 50.34 50.32 50.32 50.32 50.670 50.86 50.95 [2,] 51.020 51.060 50.900 51.230 51.29 51.30 51.30 51.30 51.460 51.47 51.77 [3,] 52.245 52.245 52.295 52.335 52.53 52.55 52.55 52.56 52.675 52.91 53.06 [4,] 53.430 53.420 53.600 53.690 54.05 54.04 54.04 54.08 54.050 54.39 54.38 [5,] 54.460 54.690 54.910 55.520 56.01 56.07 56.07 56.09 56.290 56.45 56.87 [,12] [1,] 51.02 [2,] 51.82 [3,] 53.05 [4,] 54.46 [5,] 56.87 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 50.69047 50.72272 50.55341 50.74822 50.74971 50.78261 50.78261 50.76681 [2,] 53.79953 53.76728 54.03659 53.92178 54.31029 54.31739 54.31739 54.35319 [,9] [,10] [,11] [,12] [1,] 51.00437 51.02651 51.37647 51.34711 [2,] 54.34563 54.79349 54.74353 54.75289 $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(49.98, 51.02, 52.245, 53.43, 54.46, 50.12, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rdg01350823268.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.02 -0.16 0.020 -0.050 -0.02 0 0.00 -0.03 0.010 -0.010 -0.05 0 [2,] -0.01 0.04 0.040 0.060 -0.01 0 0.00 -0.02 0.160 -0.010 0.00 0 [3,] 0.03 0.12 0.065 0.195 0.00 0 0.01 0.18 0.195 0.195 0.04 0 [4,] 0.14 0.22 0.330 0.360 0.05 0 0.02 0.25 0.270 0.310 0.07 0 [5,] 0.23 0.25 0.610 0.490 0.06 0 0.04 0.35 0.340 0.420 0.08 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.06675484 0.003894186 -0.1220594 0.00149031 -0.03870194 0 [2,] 0.12675484 0.236105814 0.2520594 0.38850969 0.03870194 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.002900646 0.005841279 0.1240464 -0.01141034 -0.005152261 0 [2,] 0.022900646 0.354158721 0.2659536 0.40141034 0.085152261 0 $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.0200000000000031, -0.00999999999999801, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m9ef1350823268.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,] 49.980 50.900 51.82 52.650 53.420 54.460 NA [2,] 50.320 51.145 51.92 52.710 53.645 55.215 NA [3,] 50.355 51.300 52.27 52.830 54.045 56.070 NA [4,] 50.765 51.465 52.60 52.965 54.230 56.370 NA [5,] 51.020 51.820 52.73 53.090 54.460 56.870 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 50.15203 51.15405 51.95985 52.71369 53.77818 55.5432 NA [2,] 50.55797 51.44595 52.58015 52.94631 54.31182 56.5968 NA $out [1] 53.40 53.43 $group [1] 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(49.98, 50.32, 50.355, 50.765, 51.02, 50.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/76ccl1350823268.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,] 52.23000 52.2450 52.2300 [2,] 52.48917 52.3150 52.3450 [3,] 52.80500 52.5500 52.6400 [4,] 53.06750 52.7925 52.8300 [5,] 53.37833 53.0600 53.1175 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 52.54122 52.33221 52.41879 [2,] 53.06878 52.76779 52.86121 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(52.23, 52.4891666666667, 52.805, 53.0675, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ghp61350823268.ps tmp/1ghp61350823268.png",intern=TRUE)) character(0) > try(system("convert tmp/2silv1350823268.ps tmp/2silv1350823268.png",intern=TRUE)) character(0) > try(system("convert tmp/3szpb1350823268.ps tmp/3szpb1350823268.png",intern=TRUE)) character(0) > try(system("convert tmp/4mu2f1350823268.ps tmp/4mu2f1350823268.png",intern=TRUE)) character(0) > try(system("convert tmp/5rdg01350823268.ps tmp/5rdg01350823268.png",intern=TRUE)) character(0) > try(system("convert tmp/6m9ef1350823268.ps tmp/6m9ef1350823268.png",intern=TRUE)) character(0) > try(system("convert tmp/76ccl1350823268.ps tmp/76ccl1350823268.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.461 0.587 4.035