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(2.39,2.4,2.42,2.42,2.44,2.44,2.44,2.45,2.46,2.47,2.48,2.48,2.49,2.5,2.51,2.52,2.52,2.52,2.54,2.54,2.54,2.56,2.57,2.58,2.58,2.58,2.58,2.59,2.6,2.61,2.61,2.62,2.63,2.65,2.67,2.68,2.67,2.68,2.68,2.68,2.68,2.69,2.69,2.69,2.7,2.71,2.72,2.71,2.72,2.73,2.74,2.74,2.75,2.75,2.76,2.75,2.78,2.79,2.8,2.81,2.81,2.82,2.82,2.83,2.83,2.84,2.84,2.84,2.86,2.87,2.88,2.88) > 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,] 2.39 2.49 2.58 2.67 2.72 2.81 NA [2,] 2.40 2.50 2.58 2.68 2.73 2.82 NA [3,] 2.42 2.51 2.58 2.68 2.74 2.82 NA [4,] 2.42 2.52 2.59 2.68 2.74 2.83 NA [5,] 2.44 2.52 2.60 2.68 2.75 2.83 NA [6,] 2.44 2.52 2.61 2.69 2.75 2.84 NA [7,] 2.44 2.54 2.61 2.69 2.76 2.84 NA [8,] 2.45 2.54 2.62 2.69 2.75 2.84 NA [9,] 2.46 2.54 2.63 2.70 2.78 2.86 NA [10,] 2.47 2.56 2.65 2.71 2.79 2.87 NA [11,] 2.48 2.57 2.67 2.72 2.80 2.88 NA [12,] 2.48 2.58 2.68 2.71 2.81 2.88 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0.01 0.00 0.01 0.01 0.01 NA [2,] 0.02 0.01 0.00 0.00 0.01 0.00 NA [3,] 0.00 0.01 0.01 0.00 0.00 0.01 NA [4,] 0.02 0.00 0.01 0.00 0.01 0.00 NA [5,] 0.00 0.00 0.01 0.01 0.00 0.01 NA [6,] 0.00 0.02 0.00 0.00 0.01 0.00 NA [7,] 0.01 0.00 0.01 0.00 -0.01 0.00 NA [8,] 0.01 0.00 0.01 0.01 0.03 0.02 NA [9,] 0.01 0.02 0.02 0.01 0.01 0.01 NA [10,] 0.01 0.01 0.02 0.01 0.01 0.01 NA [11,] 0.00 0.01 0.01 -0.01 0.01 0.00 NA [12,] 0.01 0.00 -0.01 0.01 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/1d94n1362673567.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/2qwho1362673567.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/3bu8m1362673567.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/4xbtx1362673567.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,] 2.390 2.40 2.42 2.420 2.44 2.44 2.44 2.450 2.460 2.47 2.480 2.480 [2,] 2.490 2.50 2.51 2.520 2.52 2.52 2.54 2.540 2.540 2.56 2.570 2.580 [3,] 2.625 2.63 2.63 2.635 2.64 2.65 2.65 2.655 2.665 2.68 2.695 2.695 [4,] 2.720 2.73 2.74 2.740 2.75 2.75 2.76 2.750 2.780 2.79 2.800 2.810 [5,] 2.810 2.82 2.82 2.830 2.83 2.84 2.84 2.840 2.860 2.87 2.880 2.880 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.476643 2.481643 2.481643 2.493093 2.491643 2.501643 2.508093 2.519543 [2,] 2.773357 2.778357 2.778357 2.776907 2.788357 2.798357 2.791907 2.790457 [,9] [,10] [,11] [,12] [1,] 2.510192 2.531643 2.546643 2.546643 [2,] 2.819808 2.828357 2.843357 2.843357 $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(2.39, 2.49, 2.625, 2.72, 2.81, 2.4, 2.5, 2.63, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qmuq1362673567.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.000 0.000 0.000 0.000 0.00 -0.01 0.00 0.01 0.01 -0.010 -0.01 [2,] 0.01 0.000 0.000 0.000 0.000 0.00 0.00 0.01 0.01 0.01 0.000 0.00 [3,] 0.01 0.005 0.005 0.005 0.005 0.00 0.00 0.01 0.01 0.01 0.005 0.00 [4,] 0.01 0.010 0.010 0.010 0.010 0.01 0.01 0.02 0.02 0.01 0.010 0.01 [5,] 0.01 0.020 0.010 0.020 0.010 0.02 0.01 0.03 0.02 0.01 0.010 0.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01 -0.001450323 -0.001450323 -0.001450323 -0.001450323 -0.006450323 [2,] 0.01 0.011450323 0.011450323 0.011450323 0.011450323 0.006450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.006450323 0.003549677 0.003549677 0.01 -0.001450323 -0.007065975 [2,] 0.006450323 0.016450323 0.016450323 0.01 0.011450323 0.007065975 $out [1] 0.00 0.01 0.02 $group [1] 1 1 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.00999999999999979, 0.00999999999999979, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/620z61362673567.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,] 2.390 2.490 2.580 2.670 2.720 2.810 NA [2,] 2.420 2.515 2.585 2.680 2.740 2.825 NA [3,] 2.440 2.530 2.610 2.690 2.750 2.840 NA [4,] 2.465 2.550 2.640 2.705 2.785 2.865 NA [5,] 2.480 2.580 2.680 2.720 2.810 2.880 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.419475 2.514036 2.584914 2.678597 2.729475 2.821756 NA [2,] 2.460525 2.545964 2.635086 2.701403 2.770525 2.858244 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2.39, 2.42, 2.44, 2.465, 2.48, 2.49, 2.515, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pxm81362673567.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,] 2.610000 2.6250 2.610000 [2,] 2.627500 2.6325 2.628750 [3,] 2.644167 2.6500 2.643125 [4,] 2.668333 2.6725 2.668750 [5,] 2.690000 2.6950 2.695000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.625542 2.631756 2.624881 [2,] 2.662791 2.668244 2.661369 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2.61, 2.6275, 2.64416666666667, 2.66833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d94n1362673567.ps tmp/1d94n1362673567.png",intern=TRUE)) character(0) > try(system("convert tmp/2qwho1362673567.ps tmp/2qwho1362673567.png",intern=TRUE)) character(0) > try(system("convert tmp/3bu8m1362673567.ps tmp/3bu8m1362673567.png",intern=TRUE)) character(0) > try(system("convert tmp/4xbtx1362673567.ps tmp/4xbtx1362673567.png",intern=TRUE)) character(0) > try(system("convert tmp/5qmuq1362673567.ps tmp/5qmuq1362673567.png",intern=TRUE)) character(0) > try(system("convert tmp/620z61362673567.ps tmp/620z61362673567.png",intern=TRUE)) character(0) > try(system("convert tmp/7pxm81362673567.ps tmp/7pxm81362673567.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.354 0.555 3.898