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.41,1.43,1.43,1.45,1.49,1.54,1.54,1.55,1.55,1.55,1.55,1.56,1.56,1.59,1.62,1.62,1.64,1.65,1.64,1.65,1.65,1.65,1.66,1.67,1.68,1.68,1.68,1.71,1.71,1.71,1.71,1.71,1.72,1.79,1.8,1.8,1.84,1.9,1.9,1.92,1.93,1.93,1.94,1.94,1.95,1.95,1.96,1.95,1.95,1.94,1.94,1.93,1.93,1.9,1.91,1.9,1.91,1.91,1.91,1.91,1.93,1.94,1.93,1.91,1.88,1.88,1.89,1.9,1.92,1.93,1.96,1.96) > 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.41 1.56 1.68 1.84 1.95 1.93 NA [2,] 1.43 1.59 1.68 1.90 1.94 1.94 NA [3,] 1.43 1.62 1.68 1.90 1.94 1.93 NA [4,] 1.45 1.62 1.71 1.92 1.93 1.91 NA [5,] 1.49 1.64 1.71 1.93 1.93 1.88 NA [6,] 1.54 1.65 1.71 1.93 1.90 1.88 NA [7,] 1.54 1.64 1.71 1.94 1.91 1.89 NA [8,] 1.55 1.65 1.71 1.94 1.90 1.90 NA [9,] 1.55 1.65 1.72 1.95 1.91 1.92 NA [10,] 1.55 1.65 1.79 1.95 1.91 1.93 NA [11,] 1.55 1.66 1.80 1.96 1.91 1.96 NA [12,] 1.56 1.67 1.80 1.95 1.91 1.96 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.02 0.03 0.00 0.06 -0.01 0.01 NA [2,] 0.00 0.03 0.00 0.00 0.00 -0.01 NA [3,] 0.02 0.00 0.03 0.02 -0.01 -0.02 NA [4,] 0.04 0.02 0.00 0.01 0.00 -0.03 NA [5,] 0.05 0.01 0.00 0.00 -0.03 0.00 NA [6,] 0.00 -0.01 0.00 0.01 0.01 0.01 NA [7,] 0.01 0.01 0.00 0.00 -0.01 0.01 NA [8,] 0.00 0.00 0.01 0.01 0.01 0.02 NA [9,] 0.00 0.00 0.07 0.00 0.00 0.01 NA [10,] 0.00 0.01 0.01 0.01 0.00 0.03 NA [11,] 0.01 0.01 0.00 -0.01 0.00 0.00 NA [12,] 0.00 0.01 0.04 0.00 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/wessaorg/rcomp/tmp/1h33n1350633211.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/2i7d21350633211.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/3gi6p1350633211.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/4x53i1350633211.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.41 1.43 1.43 1.45 1.490 1.540 1.54 1.550 1.550 1.55 1.550 1.560 [2,] 1.56 1.59 1.62 1.62 1.640 1.650 1.64 1.650 1.650 1.65 1.660 1.670 [3,] 1.76 1.79 1.79 1.81 1.795 1.795 1.80 1.805 1.815 1.85 1.855 1.855 [4,] 1.93 1.94 1.93 1.92 1.930 1.900 1.91 1.900 1.920 1.93 1.960 1.950 [5,] 1.95 1.94 1.94 1.93 1.930 1.930 1.94 1.940 1.950 1.95 1.960 1.960 $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.521338 1.564239 1.59004 1.61649 1.607941 1.633742 1.625841 1.643742 [2,] 1.998662 2.015761 1.98996 2.00351 1.982059 1.956258 1.974159 1.966258 [,9] [,10] [,11] [,12] [1,] 1.640841 1.669391 1.66149 1.674391 [2,] 1.989159 2.030609 2.04851 2.035609 $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(1.41, 1.56, 1.76, 1.93, 1.95, 1.43, 1.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5i38x1350633211.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.010 0 -0.02 0.000 0.00 -0.010 -0.010 0.00 0.00 0.00 -0.01 0.00 [2,] 0.000 0 -0.01 0.000 0.00 0.000 0.000 0.00 0.00 0.00 0.00 0.00 [3,] 0.015 0 0.01 0.005 0.00 0.005 0.005 0.01 0.00 0.01 0.00 0.01 [4,] 0.030 0 0.02 0.020 0.01 0.010 0.010 0.01 0.01 0.01 0.01 0.02 [5,] 0.060 0 0.03 0.040 0.01 0.010 0.010 0.02 0.01 0.01 0.01 0.04 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.004350969 0 -0.009350969 -0.007900646 -0.006450323 -0.001450323 [2,] 0.034350969 0 0.029350969 0.017900646 0.006450323 0.011450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.001450323 0.003549677 -0.006450323 0.003549677 -0.006450323 -0.00413195 [2,] 0.011450323 0.016450323 0.006450323 0.016450323 0.006450323 0.02413195 $out [1] 0.03 -0.01 -0.03 0.05 -0.03 0.07 0.03 $group [1] 2 2 4 5 5 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, 0, 0.015, 0.03, 0.0599999999999998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jaeq1350633211.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.41 1.590 1.680 1.900 1.900 1.880 NA [2,] 1.44 1.620 1.695 1.910 1.910 1.895 NA [3,] 1.54 1.645 1.710 1.935 1.910 1.925 NA [4,] 1.55 1.650 1.755 1.950 1.935 1.935 NA [5,] 1.56 1.670 1.800 1.960 1.950 1.960 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.489828 1.631317 1.682634 1.916756 1.898597 1.906756 NA [2,] 1.590172 1.658683 1.737366 1.953244 1.921403 1.943244 NA $out [1] 1.56 1.84 $group [1] 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.41, 1.44, 1.54, 1.55, 1.56, 1.59, 1.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7t9g41350633211.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.728333 1.7600 1.771250 [2,] 1.753333 1.7925 1.779375 [3,] 1.770000 1.8025 1.781875 [4,] 1.790000 1.8325 1.798750 [5,] 1.808333 1.8550 1.821250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.753276 1.784256 1.773038 [2,] 1.786724 1.820744 1.790712 $out [1] 1.74875 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.72833333333333, 1.75333333333333, 1.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h33n1350633211.ps tmp/1h33n1350633211.png",intern=TRUE)) character(0) > try(system("convert tmp/2i7d21350633211.ps tmp/2i7d21350633211.png",intern=TRUE)) character(0) > try(system("convert tmp/3gi6p1350633211.ps tmp/3gi6p1350633211.png",intern=TRUE)) character(0) > try(system("convert tmp/4x53i1350633211.ps tmp/4x53i1350633211.png",intern=TRUE)) character(0) > try(system("convert tmp/5i38x1350633211.ps tmp/5i38x1350633211.png",intern=TRUE)) character(0) > try(system("convert tmp/6jaeq1350633211.ps tmp/6jaeq1350633211.png",intern=TRUE)) character(0) > try(system("convert tmp/7t9g41350633211.ps tmp/7t9g41350633211.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.210 0.726 3.928