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(96.24,95.56,95.56,95.56,95.96,95.96,95.96,95.96,95.61,95.30,95.68,97.94,97.32,97.32,97.45,98.08,98.25,98.25,97.95,97.81,97.68,98.03,98.03,98.03,98.11,98.11,98.11,97.95,97.95,97.95,97.95,97.95,97.95,97.89,97.16,97.16,97.16,97.18,97.18,96.47,97.47,97.47,97.47,97.47,96.63,96.78,96.25,96.25,96.28,95.62,95.62,96.85,96.85,96.85,96.85,96.85,96.85,96.85,96.75,97.15,98.28,98.28,98.28,98.51,98.51,98.51,96.03,96.03,96.77,96.92,96.92,96.92) > 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,] 96.24 97.32 98.11 97.16 96.28 98.28 NA [2,] 95.56 97.32 98.11 97.18 95.62 98.28 NA [3,] 95.56 97.45 98.11 97.18 95.62 98.28 NA [4,] 95.56 98.08 97.95 96.47 96.85 98.51 NA [5,] 95.96 98.25 97.95 97.47 96.85 98.51 NA [6,] 95.96 98.25 97.95 97.47 96.85 98.51 NA [7,] 95.96 97.95 97.95 97.47 96.85 96.03 NA [8,] 95.96 97.81 97.95 97.47 96.85 96.03 NA [9,] 95.61 97.68 97.95 96.63 96.85 96.77 NA [10,] 95.30 98.03 97.89 96.78 96.85 96.92 NA [11,] 95.68 98.03 97.16 96.25 96.75 96.92 NA [12,] 97.94 98.03 97.16 96.25 97.15 96.92 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.68 0.00 0.00 0.02 -0.66 0.00 NA [2,] 0.00 0.13 0.00 0.00 0.00 0.00 NA [3,] 0.00 0.63 -0.16 -0.71 1.23 0.23 NA [4,] 0.40 0.17 0.00 1.00 0.00 0.00 NA [5,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [6,] 0.00 -0.30 0.00 0.00 0.00 -2.48 NA [7,] 0.00 -0.14 0.00 0.00 0.00 0.00 NA [8,] -0.35 -0.13 0.00 -0.84 0.00 0.74 NA [9,] -0.31 0.35 -0.06 0.15 0.00 0.15 NA [10,] 0.38 0.00 -0.73 -0.53 -0.10 0.00 NA [11,] 2.26 0.00 0.00 0.00 0.40 0.00 NA [12,] -0.62 0.08 0.00 0.03 1.13 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/16y6c1350814122.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/2gens1350814122.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/3rlkl1350814122.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/4n85v1350814122.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,] 96.24 95.56 95.560 95.56 95.96 95.96 95.96 95.96 95.61 95.300 95.680 [2,] 96.28 95.62 95.620 96.47 96.85 96.85 96.03 96.03 96.63 96.780 96.250 [3,] 97.24 97.25 97.315 97.40 97.71 97.71 97.16 97.16 96.81 96.885 96.835 [4,] 98.11 98.11 98.110 98.08 98.25 98.25 97.95 97.81 97.68 97.890 97.160 [5,] 98.28 98.28 98.280 98.51 98.51 98.51 97.95 97.95 97.95 98.030 98.030 [,12] [1,] 96.250 [2,] 96.920 [3,] 97.155 [4,] 97.940 [5,] 98.030 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.05959 95.64387 95.70887 96.3615 96.80695 96.80695 95.92154 96.01184 [2,] 98.42041 98.85613 98.92113 98.4385 98.61305 98.61305 98.39846 98.30816 [,9] [,10] [,11] [,12] [1,] 96.13272 96.16901 96.24802 96.49707 [2,] 97.48728 97.60099 97.42198 97.81293 $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(96.24, 96.28, 97.24, 98.11, 98.28, 95.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5stmm1350814122.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.68 0 -0.710 0.000 0 -0.3 0 -0.840 -0.310 -0.73 0.0 0.00 [2,] -0.66 0 -0.160 0.000 0 -0.3 0 -0.350 -0.060 -0.53 0.0 0.00 [3,] 0.00 0 0.115 0.085 0 0.0 0 -0.065 0.075 -0.05 0.0 0.03 [4,] 0.00 0 0.630 0.400 0 0.0 0 0.000 0.150 0.00 0.4 0.08 [5,] 0.02 0 1.230 0.400 0 0.0 0 0.000 0.350 0.38 0.4 0.08 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.4257213 0 -0.3945755 -0.1730129 0 -0.1935097 0 -0.2907613 [2,] 0.4257213 0 0.6245755 0.3430129 0 0.1935097 0 0.1607613 [,9] [,10] [,11] [,12] [1,] -0.06045678 -0.3918671 -0.2580129 -0.0265278 [2,] 0.21045678 0.2918671 0.2580129 0.0865278 $out [1] 0.13 1.00 -2.48 -0.14 0.74 2.26 -0.62 1.13 $group [1] 2 4 6 7 8 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.679999999999993, -0.659999999999997, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q24q1350814122.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,] 95.30 97.320 97.89 96.25 96.280 96.030 NA [2,] 95.56 97.565 97.92 96.55 96.515 96.845 NA [3,] 95.82 97.990 97.95 97.17 96.850 97.600 NA [4,] 95.96 98.055 98.03 97.47 96.850 98.395 NA [5,] 96.24 98.250 98.11 97.47 97.150 98.510 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.63756 97.76651 97.89983 96.75038 96.6972 96.89303 NA [2,] 96.00244 98.21349 98.00017 97.58962 97.0028 98.30697 NA $out [1] 97.94 97.16 97.16 95.62 95.62 $group [1] 1 3 3 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(95.3, 95.56, 95.82, 95.96, 96.24, 97.32, 97.565, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7nq3f1350814122.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,] 96.79833 96.8100 96.73750 [2,] 96.98667 97.0200 96.97875 [3,] 97.03417 97.2000 97.13750 [4,] 97.23917 97.3575 97.33375 [5,] 97.49833 97.7100 97.59000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96.91900 97.04606 96.97558 [2,] 97.14933 97.35394 97.29942 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.7983333333333, 96.9866666666667, 97.0341666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16y6c1350814122.ps tmp/16y6c1350814122.png",intern=TRUE)) character(0) > try(system("convert tmp/2gens1350814122.ps tmp/2gens1350814122.png",intern=TRUE)) character(0) > try(system("convert tmp/3rlkl1350814122.ps tmp/3rlkl1350814122.png",intern=TRUE)) character(0) > try(system("convert tmp/4n85v1350814122.ps tmp/4n85v1350814122.png",intern=TRUE)) character(0) > try(system("convert tmp/5stmm1350814122.ps tmp/5stmm1350814122.png",intern=TRUE)) character(0) > try(system("convert tmp/6q24q1350814122.ps tmp/6q24q1350814122.png",intern=TRUE)) character(0) > try(system("convert tmp/7nq3f1350814122.ps tmp/7nq3f1350814122.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.421 0.628 4.039