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(20.89,21.04,21.07,21.12,21.25,21.24,21.24,21.22,21.29,21.25,21.15,21.16,21.16,21.52,21.59,21.6,21.68,21.67,21.67,21.65,21.74,21.72,21.84,21.94,21.94,21.95,21.96,22.1,22.13,22.18,22.18,22.27,22.3,22.04,22.05,22.06,22.06,22.06,21.97,22.03,22.08,22.13,22.13,22.4,22.4,22.12,22.22,22.14,22.14,22.19,22.29,22.24,22.26,22.29,22.29,22.29,22.29,22.35,22.39,22.43,22.43,22.11,22.12,22.05,22.05,22.08,22.08,22.09,22.09,22.24,22.25,22.24) > 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,] 20.89 21.16 21.94 22.06 22.14 22.43 NA [2,] 21.04 21.52 21.95 22.06 22.19 22.11 NA [3,] 21.07 21.59 21.96 21.97 22.29 22.12 NA [4,] 21.12 21.60 22.10 22.03 22.24 22.05 NA [5,] 21.25 21.68 22.13 22.08 22.26 22.05 NA [6,] 21.24 21.67 22.18 22.13 22.29 22.08 NA [7,] 21.24 21.67 22.18 22.13 22.29 22.08 NA [8,] 21.22 21.65 22.27 22.40 22.29 22.09 NA [9,] 21.29 21.74 22.30 22.40 22.29 22.09 NA [10,] 21.25 21.72 22.04 22.12 22.35 22.24 NA [11,] 21.15 21.84 22.05 22.22 22.39 22.25 NA [12,] 21.16 21.94 22.06 22.14 22.43 22.24 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.15 0.36 0.01 0.00 0.05 -0.32 NA [2,] 0.03 0.07 0.01 -0.09 0.10 0.01 NA [3,] 0.05 0.01 0.14 0.06 -0.05 -0.07 NA [4,] 0.13 0.08 0.03 0.05 0.02 0.00 NA [5,] -0.01 -0.01 0.05 0.05 0.03 0.03 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -0.02 -0.02 0.09 0.27 0.00 0.01 NA [8,] 0.07 0.09 0.03 0.00 0.00 0.00 NA [9,] -0.04 -0.02 -0.26 -0.28 0.06 0.15 NA [10,] -0.10 0.12 0.01 0.10 0.04 0.01 NA [11,] 0.01 0.10 0.01 -0.08 0.04 -0.01 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/1ytl11350939294.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/2afm51350939294.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/35s4q1350939294.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/4lp3f1350939294.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,] 20.89 21.040 21.070 21.12 21.250 21.240 21.240 21.22 21.29 21.25 21.840 [2,] 21.16 21.520 21.590 21.60 21.680 21.670 21.670 21.65 21.74 21.72 21.840 [3,] 22.00 22.005 21.965 22.04 22.065 22.105 22.105 22.18 22.19 22.08 22.135 [4,] 22.14 22.110 22.120 22.10 22.130 22.180 22.180 22.29 22.30 22.24 22.250 [5,] 22.43 22.190 22.290 22.24 22.260 22.290 22.290 22.40 22.40 22.35 22.390 [,12] [1,] 21.94 [2,] 21.94 [3,] 22.10 [4,] 22.24 [5,] 22.43 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 21.36787 21.62443 21.62313 21.71748 21.77474 21.77603 21.77603 21.76718 [2,] 22.63213 22.38557 22.30687 22.36252 22.35526 22.43397 22.43397 22.59282 [,9] [,10] [,11] [,12] [1,] 21.82878 21.74458 21.87054 21.90649 [2,] 22.55122 22.41542 22.39946 22.29351 $out [1] 21.15 21.16 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(20.89, 21.16, 22, 22.14, 22.43, 21.04, 21.52, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nsc71350939294.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.00 0.01 -0.07 0.00 -0.01 0 -0.020 0.000 -0.28 -0.100 -0.08 0 [2,] 0.00 0.01 -0.05 0.02 -0.01 0 -0.020 0.000 -0.26 0.010 -0.01 0 [3,] 0.03 0.02 0.03 0.04 0.03 0 0.005 0.015 -0.03 0.025 0.01 0 [4,] 0.15 0.07 0.06 0.08 0.05 0 0.090 0.070 0.06 0.100 0.04 0 [5,] 0.36 0.10 0.14 0.13 0.05 0 0.090 0.090 0.15 0.120 0.10 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.06675484 -0.01870194 -0.04095355 0.001298062 -0.008701938 0 [2,] 0.12675484 0.05870194 0.10095355 0.078701938 0.068701938 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.06595355 -0.03015226 -0.2364103 -0.03305291 -0.02225161 0 [2,] 0.07595355 0.06015226 0.1764103 0.08305291 0.04225161 0 $out [1] -0.32 -0.09 0.27 $group [1] 1 2 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.0299999999999994, 0.149999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dn721350939294.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,] 20.890 21.520 21.94 21.970 22.19 22.05 NA [2,] 21.095 21.595 22.00 22.060 22.25 22.08 NA [3,] 21.190 21.670 22.08 22.125 22.29 22.10 NA [4,] 21.245 21.730 22.18 22.180 22.32 22.24 NA [5,] 21.290 21.840 22.30 22.220 22.39 22.43 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 21.12158 21.60843 21.9979 22.07027 22.25807 22.02702 NA [2,] 21.25842 21.73157 22.1621 22.17973 22.32193 22.17298 NA $out [1] 21.16 21.94 22.40 22.40 22.14 22.43 $group [1] 2 2 4 4 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(20.89, 21.095, 21.19, 21.245, 21.29, 21.52, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hjup1350939294.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,] 21.77000 21.9650 21.7375 [2,] 21.84500 22.0225 21.8900 [3,] 21.93167 22.0900 21.9700 [4,] 21.98500 22.1200 22.0425 [5,] 22.01833 22.1900 22.0925 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 21.86781 22.04553 21.90044 [2,] 21.99552 22.13447 22.03956 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(21.77, 21.845, 21.9316666666667, 21.985, 22.0183333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ytl11350939294.ps tmp/1ytl11350939294.png",intern=TRUE)) character(0) > try(system("convert tmp/2afm51350939294.ps tmp/2afm51350939294.png",intern=TRUE)) character(0) > try(system("convert tmp/35s4q1350939294.ps tmp/35s4q1350939294.png",intern=TRUE)) character(0) > try(system("convert tmp/4lp3f1350939294.ps tmp/4lp3f1350939294.png",intern=TRUE)) character(0) > try(system("convert tmp/5nsc71350939294.ps tmp/5nsc71350939294.png",intern=TRUE)) character(0) > try(system("convert tmp/6dn721350939294.ps tmp/6dn721350939294.png",intern=TRUE)) character(0) > try(system("convert tmp/7hjup1350939294.ps tmp/7hjup1350939294.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.369 0.628 4.025