R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(85.3,85.65,85.15,84.94,85.15,85.15,85.15,85.14,85.37,85.61,85.59,85.54,85.54,85.5,85.78,86.16,86.38,86.49,86.49,86,85.9,85.66,85.64,85.6,85.6,85.57,85.81,86.29,86.37,86.41,86.41,86.38,86.62,87.08,87.19,87.21,87.21,87.24,87.16,87.05,87.04,86.98,86.98,86.94,86.96,86.98,86.86,86.82,86.82,86.84,86.91,86.85,86.61,86.65,86.65,86.36,86.33,86.43,86.36,86.29,86.29,86.44,86.51,86.72,86.93,86.79,86.79) > 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] 67 > (np <- floor(n / par1)) [1] 5 > 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 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 85.30 85.54 85.60 87.21 86.82 86.29 [2,] 85.65 85.50 85.57 87.24 86.84 86.44 [3,] 85.15 85.78 85.81 87.16 86.91 86.51 [4,] 84.94 86.16 86.29 87.05 86.85 86.72 [5,] 85.15 86.38 86.37 87.04 86.61 86.93 [6,] 85.15 86.49 86.41 86.98 86.65 86.79 [7,] 85.15 86.49 86.41 86.98 86.65 86.79 [8,] 85.14 86.00 86.38 86.94 86.36 NA [9,] 85.37 85.90 86.62 86.96 86.33 NA [10,] 85.61 85.66 87.08 86.98 86.43 NA [11,] 85.59 85.64 87.19 86.86 86.36 NA [12,] 85.54 85.60 87.21 86.82 86.29 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.35 -0.04 -0.03 0.03 0.02 0.15 [2,] -0.50 0.28 0.24 -0.08 0.07 0.07 [3,] -0.21 0.38 0.48 -0.11 -0.06 0.21 [4,] 0.21 0.22 0.08 -0.01 -0.24 0.21 [5,] 0.00 0.11 0.04 -0.06 0.04 -0.14 [6,] 0.00 0.00 0.00 0.00 0.00 0.00 [7,] -0.01 -0.49 -0.03 -0.04 -0.29 NA [8,] 0.23 -0.10 0.24 0.02 -0.03 NA [9,] 0.24 -0.24 0.46 0.02 0.10 NA [10,] -0.02 -0.02 0.11 -0.12 -0.07 NA [11,] -0.05 -0.04 0.02 -0.04 -0.07 NA [12,] 0.00 0.00 0.00 0.00 0.00 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/fisher/rcomp/tmp/1pd1f1363122292.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/fisher/rcomp/tmp/2bhd01363122292.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/fisher/rcomp/tmp/3thry1363122292.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/fisher/rcomp/tmp/4r0v11363122292.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,] 85.300 85.500 85.15 86.160 86.370 86.41 86.41 86.00 85.37 85.61 85.59 [2,] 85.540 85.570 85.78 86.160 86.370 86.41 86.41 86.00 85.90 85.66 85.64 [3,] 85.945 86.045 86.16 86.505 86.495 86.57 86.57 86.36 86.33 86.43 86.36 [4,] 86.820 86.840 86.91 86.850 86.930 86.79 86.79 86.38 86.62 86.98 86.86 [5,] 87.210 87.240 87.16 87.050 87.040 86.98 86.98 86.94 86.96 87.08 87.19 [,12] [1,] 85.54 [2,] 85.60 [3,] 86.29 [4,] 86.82 [5,] 87.21 $n [1] 6 6 6 6 6 6 6 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.11936 85.22581 85.43111 86.05993 86.13378 86.32489 86.32489 86.09149 [2,] 86.77064 86.86419 86.88889 86.95007 86.85622 86.81511 86.81511 86.62851 [,9] [,10] [,11] [,12] [1,] 85.82125 85.49729 85.49795 85.42795 [2,] 86.83875 87.36271 87.22205 87.15205 $out [1] 84.94 85.15 85.15 85.15 85.14 $group [1] 4 5 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(85.3, 85.54, 85.945, 86.82, 87.21, 85.5, 85.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/53xp61363122292.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.040 -0.50 -0.210 -0.240 -0.14 0 -0.49 -0.10 -0.24 -0.12 -0.05 0 [2,] -0.030 -0.08 -0.110 -0.010 -0.06 0 -0.29 -0.03 0.02 -0.07 -0.05 0 [3,] 0.025 0.07 0.075 0.145 0.02 0 -0.04 0.02 0.10 -0.02 -0.04 0 [4,] 0.150 0.24 0.380 0.210 0.04 0 -0.03 0.23 0.24 -0.02 -0.04 0 [5,] 0.350 0.28 0.480 0.220 0.11 0 -0.01 0.24 0.46 -0.02 -0.04 0 $n [1] 6 6 6 6 6 6 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.09110581 -0.1364103 -0.2410658 0.003092894 -0.04450323 0 -0.2237153 [2,] 0.14110581 0.2764103 0.3910658 0.286907106 0.08450323 0 0.1437153 [,8] [,9] [,10] [,11] [,12] [1,] -0.1637153 -0.05545145 -0.05532987 -0.04706597 0 [2,] 0.2037153 0.25545145 0.01532987 -0.03293403 0 $out [1] 0.11 0.02 -0.07 $group [1] 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0400000000000063, -0.0300000000000011, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/678r21363122292.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] [1,] 84.940 85.50 85.570 86.820 86.29 86.290 [2,] 85.150 85.62 86.050 86.950 86.36 86.475 [3,] 85.225 85.84 86.395 86.980 86.63 86.720 [4,] 85.565 86.27 86.850 87.105 86.83 86.790 [5,] 85.650 86.49 87.210 87.240 86.91 86.930 $n [1] 12 12 12 12 12 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 85.03572 85.54353 86.03011 86.9093 86.41563 86.53189 [2,] 85.41428 86.13647 86.75989 87.0507 86.84437 86.90811 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(84.94, 85.15, 85.225, 85.565, 85.65, 85.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/72idb1363122292.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,] 86.12667 85.945 86.12125 [2,] 86.21333 86.225 86.20000 [3,] 86.31000 86.360 86.27938 [4,] 86.38183 86.500 86.54875 [5,] 86.41333 86.570 86.61125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 86.23315 86.23457 86.12031 [2,] 86.38685 86.48543 86.43844 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(86.1266666666667, 86.2133333333333, 86.31, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pd1f1363122292.ps tmp/1pd1f1363122292.png",intern=TRUE)) character(0) > try(system("convert tmp/2bhd01363122292.ps tmp/2bhd01363122292.png",intern=TRUE)) character(0) > try(system("convert tmp/3thry1363122292.ps tmp/3thry1363122292.png",intern=TRUE)) character(0) > try(system("convert tmp/4r0v11363122292.ps tmp/4r0v11363122292.png",intern=TRUE)) character(0) > try(system("convert tmp/53xp61363122292.ps tmp/53xp61363122292.png",intern=TRUE)) character(0) > try(system("convert tmp/678r21363122292.ps tmp/678r21363122292.png",intern=TRUE)) character(0) > try(system("convert tmp/72idb1363122292.ps tmp/72idb1363122292.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.721 0.579 4.287