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(32.98,32.7,32.74,32.87,32.95,32.94,32.94,32.97,32.87,32.96,32.97,32.99,32.99,33.04,33.23,33.03,33.05,33.03,33.04,33.11,33.14,33.08,33.09,33.07,33.07,33.02,33,33.08,33.35,33.36,33.36,33.35,33.41,33.47,33.47,33.48,33.48,33.55,33.68,33.72,33.79,33.83,33.83,33.84,33.91,34.06,34.16,34.16,34.16,34.29,34.48,34.48,34.39,34.29,34.29,34.25,34.2,34.1,34.09,34.06,34.06,34.04,34.19,34.21,34.17,34.08,34.08,34.08,34.3,34.28,34.45,34.41) > 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,] 32.98 32.99 33.07 33.48 34.16 34.06 NA [2,] 32.70 33.04 33.02 33.55 34.29 34.04 NA [3,] 32.74 33.23 33.00 33.68 34.48 34.19 NA [4,] 32.87 33.03 33.08 33.72 34.48 34.21 NA [5,] 32.95 33.05 33.35 33.79 34.39 34.17 NA [6,] 32.94 33.03 33.36 33.83 34.29 34.08 NA [7,] 32.94 33.04 33.36 33.83 34.29 34.08 NA [8,] 32.97 33.11 33.35 33.84 34.25 34.08 NA [9,] 32.87 33.14 33.41 33.91 34.20 34.30 NA [10,] 32.96 33.08 33.47 34.06 34.10 34.28 NA [11,] 32.97 33.09 33.47 34.16 34.09 34.45 NA [12,] 32.99 33.07 33.48 34.16 34.06 34.41 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.28 0.05 -0.05 0.07 0.13 -0.02 NA [2,] 0.04 0.19 -0.02 0.13 0.19 0.15 NA [3,] 0.13 -0.20 0.08 0.04 0.00 0.02 NA [4,] 0.08 0.02 0.27 0.07 -0.09 -0.04 NA [5,] -0.01 -0.02 0.01 0.04 -0.10 -0.09 NA [6,] 0.00 0.01 0.00 0.00 0.00 0.00 NA [7,] 0.03 0.07 -0.01 0.01 -0.04 0.00 NA [8,] -0.10 0.03 0.06 0.07 -0.05 0.22 NA [9,] 0.09 -0.06 0.06 0.15 -0.10 -0.02 NA [10,] 0.01 0.01 0.00 0.10 -0.01 0.17 NA [11,] 0.02 -0.02 0.01 0.00 -0.03 -0.04 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/120rv1350565112.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/27jen1350565112.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/3fadv1350565112.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/4xdq01350565112.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,] 32.980 32.700 32.740 32.87 32.95 32.940 32.940 32.970 32.87 32.960 32.97 [2,] 32.990 33.020 33.000 33.03 33.05 33.030 33.040 33.110 33.14 33.080 33.09 [3,] 33.275 33.295 33.455 33.40 33.57 33.595 33.595 33.595 33.66 33.765 33.78 [4,] 34.060 34.040 34.190 34.21 34.17 34.080 34.080 34.080 34.20 34.100 34.16 [5,] 34.160 34.290 34.480 34.48 34.39 34.290 34.290 34.250 34.30 34.280 34.45 [,12] [1,] 32.99 [2,] 33.07 [3,] 33.77 [4,] 34.16 [5,] 34.41 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 32.58482 32.63707 32.68741 32.63886 32.84756 32.91772 32.92417 32.96932 [2,] 33.96518 33.95293 34.22259 34.16114 34.29244 34.27228 34.26583 34.22068 [,9] [,10] [,11] [,12] [1,] 32.97627 33.10707 33.08982 33.06691 [2,] 34.34373 34.42293 34.47018 34.47309 $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(32.98, 32.99, 33.275, 34.06, 34.16, 32.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58n2p1350565112.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.050 -0.02 0.00 -0.090 -0.100 0 -0.040 -0.100 -0.10 -0.01 -0.04 0 [2,] -0.050 0.04 0.00 -0.040 -0.090 0 -0.010 -0.050 -0.06 0.00 -0.03 0 [3,] 0.015 0.14 0.03 0.045 -0.015 0 0.005 0.045 0.02 0.01 -0.01 0 [4,] 0.070 0.19 0.08 0.080 0.010 0 0.030 0.070 0.09 0.10 0.01 0 [5,] 0.130 0.19 0.13 0.080 0.040 0 0.070 0.220 0.15 0.17 0.02 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.06240388 0.04324516 -0.02160258 -0.03240388 -0.07950323 0 [2,] 0.09240388 0.23675484 0.08160258 0.12240388 0.04950323 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.02080129 -0.03240388 -0.07675484 -0.05450323 -0.03580129 0 [2,] 0.03080129 0.12240388 0.11675484 0.07450323 0.01580129 0 $out [1] -0.28 -0.20 0.27 0.01 $group [1] 1 3 4 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0499999999999972, -0.0499999999999972, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jdjz1350565112.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,] 32.740 32.990 33.000 33.480 34.06 34.04 NA [2,] 32.870 33.035 33.075 33.700 34.13 34.08 NA [3,] 32.945 33.060 33.355 33.830 34.27 34.18 NA [4,] 32.970 33.100 33.440 33.985 34.34 34.29 NA [5,] 32.990 33.140 33.480 34.160 34.48 34.45 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 32.89939 33.03035 33.18852 33.70001 34.17422 34.08422 NA [2,] 32.99061 33.08965 33.52148 33.95999 34.36578 34.27578 NA $out [1] 32.70 33.23 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(32.74, 32.87, 32.945, 32.97, 32.99, 32.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7h8zk1350565112.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,] 33.44000 33.2750 33.46250 [2,] 33.55917 33.4275 33.56250 [3,] 33.59500 33.5950 33.58187 [4,] 33.64833 33.7125 33.64375 [5,] 33.70500 33.7800 33.66750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 33.55433 33.46501 33.54482 [2,] 33.63567 33.72499 33.61893 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(33.44, 33.5591666666667, 33.595, 33.6483333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/120rv1350565112.ps tmp/120rv1350565112.png",intern=TRUE)) character(0) > try(system("convert tmp/27jen1350565112.ps tmp/27jen1350565112.png",intern=TRUE)) character(0) > try(system("convert tmp/3fadv1350565112.ps tmp/3fadv1350565112.png",intern=TRUE)) character(0) > try(system("convert tmp/4xdq01350565112.ps tmp/4xdq01350565112.png",intern=TRUE)) character(0) > try(system("convert tmp/58n2p1350565112.ps tmp/58n2p1350565112.png",intern=TRUE)) character(0) > try(system("convert tmp/6jdjz1350565112.ps tmp/6jdjz1350565112.png",intern=TRUE)) character(0) > try(system("convert tmp/7h8zk1350565112.ps tmp/7h8zk1350565112.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.450 0.766 4.215