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(15.13,15.25,15.33,15.36,15.4,15.4,15.41,15.47,15.54,15.55,15.59,15.65,15.75,15.86,15.89,15.94,15.93,15.95,15.99,15.99,16.06,16.08,16.07,16.11,16.15,16.18,16.3,16.42,16.49,16.5,16.58,16.64,16.66,16.81,16.91,16.92,16.95,17.11,17.16,17.16,17.27,17.34,17.39,17.43,17.45,17.5,17.56,17.65,17.62,17.7,17.72,17.71,17.74,17.75,17.78,17.8,17.86,17.88,17.89,17.94,17.98,18.1,18.14,18.19,18.23,18.24,18.27,18.3,18.34,18.36,18.36,18.4) > 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,] 15.13 15.75 16.15 16.95 17.62 17.98 NA [2,] 15.25 15.86 16.18 17.11 17.70 18.10 NA [3,] 15.33 15.89 16.30 17.16 17.72 18.14 NA [4,] 15.36 15.94 16.42 17.16 17.71 18.19 NA [5,] 15.40 15.93 16.49 17.27 17.74 18.23 NA [6,] 15.40 15.95 16.50 17.34 17.75 18.24 NA [7,] 15.41 15.99 16.58 17.39 17.78 18.27 NA [8,] 15.47 15.99 16.64 17.43 17.80 18.30 NA [9,] 15.54 16.06 16.66 17.45 17.86 18.34 NA [10,] 15.55 16.08 16.81 17.50 17.88 18.36 NA [11,] 15.59 16.07 16.91 17.56 17.89 18.36 NA [12,] 15.65 16.11 16.92 17.65 17.94 18.40 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.12 0.11 0.03 0.16 0.08 0.12 NA [2,] 0.08 0.03 0.12 0.05 0.02 0.04 NA [3,] 0.03 0.05 0.12 0.00 -0.01 0.05 NA [4,] 0.04 -0.01 0.07 0.11 0.03 0.04 NA [5,] 0.00 0.02 0.01 0.07 0.01 0.01 NA [6,] 0.01 0.04 0.08 0.05 0.03 0.03 NA [7,] 0.06 0.00 0.06 0.04 0.02 0.03 NA [8,] 0.07 0.07 0.02 0.02 0.06 0.04 NA [9,] 0.01 0.02 0.15 0.05 0.02 0.02 NA [10,] 0.04 -0.01 0.10 0.06 0.01 0.00 NA [11,] 0.06 0.04 0.01 0.09 0.05 0.04 NA [12,] 0.10 0.04 0.03 -0.03 0.04 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/1n21a1350633543.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/2qe2x1350633543.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/32vto1350633543.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/4h2oe1350633543.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,] 15.13 15.250 15.33 15.36 15.40 15.40 15.410 15.470 15.540 15.550 15.590 [2,] 15.75 15.860 15.89 15.94 15.93 15.95 15.990 15.990 16.060 16.080 16.070 [3,] 16.55 16.645 16.73 16.79 16.88 16.92 16.985 17.035 17.055 17.155 17.235 [4,] 17.62 17.700 17.72 17.71 17.74 17.75 17.780 17.800 17.860 17.880 17.890 [5,] 17.98 18.100 18.14 18.19 18.23 18.24 18.270 18.300 18.340 18.360 18.360 [,12] [1,] 15.650 [2,] 16.110 [3,] 17.285 [4,] 17.940 [5,] 18.400 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15.34379 15.45814 15.54959 15.64829 15.71249 15.75894 15.83039 15.86749 [2,] 17.75621 17.83186 17.91041 17.93171 18.04751 18.08106 18.13961 18.20251 [,9] [,10] [,11] [,12] [1,] 15.89394 15.99394 16.06104 16.10459 [2,] 18.21606 18.31606 18.40896 18.46541 $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(15.13, 15.75, 16.55, 17.62, 17.98, 15.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jaws1350633543.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.030 0.020 -0.01 -0.01 0.00 0.010 0.000 0.02 0.01 -0.010 0.010 0.03 [2,] 0.080 0.030 0.00 0.03 0.01 0.030 0.020 0.02 0.02 0.000 0.040 0.03 [3,] 0.115 0.045 0.04 0.04 0.01 0.035 0.035 0.05 0.02 0.025 0.045 0.04 [4,] 0.120 0.080 0.05 0.07 0.02 0.050 0.060 0.07 0.05 0.060 0.060 0.04 [5,] 0.160 0.120 0.12 0.11 0.02 0.080 0.060 0.07 0.05 0.100 0.090 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.08919871 0.01274839 0.007748385 0.01419871 0.003549677 0.02209935 [2,] 0.14080129 0.07725161 0.072251615 0.06580129 0.016450323 0.04790065 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.009198708 0.01774839 0.000649031 -0.01370194 0.03209935 0.03293403 [2,] 0.060801292 0.08225161 0.039350969 0.06370194 0.05790065 0.04706597 $out [1] 0.07 0.15 0.10 -0.03 $group [1] 5 9 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0300000000000011, 0.0799999999999983, 0.114999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6b9m91350633543.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,] 15.130 15.750 16.150 16.950 17.620 17.980 NA [2,] 15.345 15.910 16.360 17.160 17.715 18.165 NA [3,] 15.405 15.970 16.540 17.365 17.765 18.255 NA [4,] 15.545 16.065 16.735 17.475 17.870 18.350 NA [5,] 15.650 16.110 16.920 17.650 17.940 18.400 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 15.31378 15.8993 16.36896 17.22133 17.6943 18.17062 NA [2,] 15.49622 16.0407 16.71104 17.50867 17.8357 18.33938 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(15.13, 15.345, 15.405, 15.545, 15.65, 15.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7swau1350633543.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,] 16.59667 16.5500 16.65125 [2,] 16.77667 16.7600 16.80125 [3,] 16.88333 16.9525 16.88875 [4,] 17.00750 17.1050 17.00375 [5,] 17.11167 17.2850 17.09000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16.77805 16.79514 16.79639 [2,] 16.98862 17.10986 16.98111 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16.5966666666667, 16.7766666666667, 16.8833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1n21a1350633543.ps tmp/1n21a1350633543.png",intern=TRUE)) character(0) > try(system("convert tmp/2qe2x1350633543.ps tmp/2qe2x1350633543.png",intern=TRUE)) character(0) > try(system("convert tmp/32vto1350633543.ps tmp/32vto1350633543.png",intern=TRUE)) character(0) > try(system("convert tmp/4h2oe1350633543.ps tmp/4h2oe1350633543.png",intern=TRUE)) character(0) > try(system("convert tmp/5jaws1350633543.ps tmp/5jaws1350633543.png",intern=TRUE)) character(0) > try(system("convert tmp/6b9m91350633543.ps tmp/6b9m91350633543.png",intern=TRUE)) character(0) > try(system("convert tmp/7swau1350633543.ps tmp/7swau1350633543.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.377 0.748 4.117