R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(8.27,8.25,8.22,8.21,8.12,8.16,8.15,8.1,8.09,8.02,8.03,7.98,7.95,7.92,7.96,7.96,7.94,7.83,7.77,7.8,7.78,7.78,7.8,7.81,7.95,8.02,7.99,8.01,8.03,8.05,8.05,8.06,8.07,7.99,8,8.01,8,8.09,8.1,8.12,8.29,8.32,8.36,8.38,8.48,8.45,8.41,8.38,8.38,8.34,8.41,8.34,8.22,8.27,8.18,8.19,8.19,8.13,8.06,7.99,8,7.98,7.92,7.93,7.9,7.86,7.88,7.88,7.93,7.91,7.89,7.93) > 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,] 8.27 7.95 7.95 8.00 8.38 8.00 NA [2,] 8.25 7.92 8.02 8.09 8.34 7.98 NA [3,] 8.22 7.96 7.99 8.10 8.41 7.92 NA [4,] 8.21 7.96 8.01 8.12 8.34 7.93 NA [5,] 8.12 7.94 8.03 8.29 8.22 7.90 NA [6,] 8.16 7.83 8.05 8.32 8.27 7.86 NA [7,] 8.15 7.77 8.05 8.36 8.18 7.88 NA [8,] 8.10 7.80 8.06 8.38 8.19 7.88 NA [9,] 8.09 7.78 8.07 8.48 8.19 7.93 NA [10,] 8.02 7.78 7.99 8.45 8.13 7.91 NA [11,] 8.03 7.80 8.00 8.41 8.06 7.89 NA [12,] 7.98 7.81 8.01 8.38 7.99 7.93 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.02 -0.03 0.07 0.09 -0.04 -0.02 NA [2,] -0.03 0.04 -0.03 0.01 0.07 -0.06 NA [3,] -0.01 0.00 0.02 0.02 -0.07 0.01 NA [4,] -0.09 -0.02 0.02 0.17 -0.12 -0.03 NA [5,] 0.04 -0.11 0.02 0.03 0.05 -0.04 NA [6,] -0.01 -0.06 0.00 0.04 -0.09 0.02 NA [7,] -0.05 0.03 0.01 0.02 0.01 0.00 NA [8,] -0.01 -0.02 0.01 0.10 0.00 0.05 NA [9,] -0.07 0.00 -0.08 -0.03 -0.06 -0.02 NA [10,] 0.01 0.02 0.01 -0.04 -0.07 -0.02 NA [11,] -0.05 0.01 0.01 -0.03 -0.07 0.04 NA [12,] -0.03 0.14 -0.01 0.00 0.01 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/195vq1362672885.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/20o0l1362672885.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/35y8d1362672885.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/4w75d1362672885.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] [,12] [1,] 7.95 7.920 7.920 7.930 7.900 7.830 7.77 7.80 7.78 7.780 7.800 7.810 [2,] 7.95 7.980 7.960 7.960 7.940 7.860 7.88 7.88 7.93 7.910 7.890 7.930 [3,] 8.00 8.055 8.045 8.065 8.075 8.105 8.10 8.08 8.08 8.005 8.015 7.985 [4,] 8.27 8.250 8.220 8.210 8.220 8.270 8.18 8.19 8.19 8.130 8.060 8.010 [5,] 8.38 8.340 8.410 8.340 8.290 8.320 8.36 8.38 8.48 8.450 8.060 8.010 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.79359 7.880841 7.877292 7.903742 7.894391 7.840537 7.90649 7.88004 [2,] 8.20641 8.229159 8.212708 8.226258 8.255609 8.369463 8.29351 8.27996 [,9] [,10] [,11] [,12] [1,] 7.912292 7.863093 7.905345 7.933397 [2,] 8.247708 8.146907 8.124655 8.036603 $out [1] 8.41 8.38 $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(7.95, 7.95, 8, 8.27, 8.38, 7.92, 7.98, 8.055, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zldy1362672885.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] [1,] -0.04 -0.06 -0.010 -0.120 -0.110 -0.090 0.00 -0.020 -0.080 -0.070 -0.07 [2,] -0.03 -0.03 -0.010 -0.090 -0.040 -0.060 0.00 -0.010 -0.070 -0.040 -0.05 [3,] -0.02 -0.01 0.005 -0.025 0.025 -0.005 0.01 0.005 -0.045 -0.005 -0.01 [4,] 0.07 0.04 0.020 0.020 0.040 0.020 0.02 0.050 -0.020 0.010 0.01 [5,] 0.09 0.07 0.020 0.170 0.050 0.040 0.03 0.100 0.000 0.020 0.04 [,12] [1,] -0.03 [2,] -0.01 [3,] 0.00 [4,] 0.01 [5,] 0.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.08450323 -0.05515226 -0.01435097 -0.09595355 -0.02660258 -0.05660258 [2,] 0.04450323 0.03515226 0.02435097 0.04595355 0.07660258 0.04660258 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.002900646 -0.03370194 -0.07725161 -0.03725161 -0.04870194 -0.01413195 [2,] 0.022900646 0.04370194 -0.01274839 0.02725161 0.02870194 0.01413195 $out [1] -0.07 -0.05 0.14 $group [1] 3 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0400000000000009, -0.0300000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ahid1362672885.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,] 7.980 7.770 7.950 8.000 7.990 7.860 NA [2,] 8.060 7.790 7.995 8.110 8.155 7.885 NA [3,] 8.135 7.820 8.015 8.340 8.205 7.915 NA [4,] 8.215 7.945 8.050 8.395 8.340 7.930 NA [5,] 8.270 7.960 8.070 8.480 8.410 7.980 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8.064303 7.749303 7.989914 8.21001 8.12062 7.894475 NA [2,] 8.205697 7.890697 8.040086 8.46999 8.28938 7.935525 NA $out [1] 8 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(7.98, 8.06, 8.135, 8.215, 8.27, 7.77, 7.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7thoy1362672885.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,] 8.016667 7.985 7.973750 [2,] 8.055833 8.010 8.031250 [3,] 8.082500 8.060 8.070000 [4,] 8.093333 8.080 8.079375 [5,] 8.100000 8.105 8.100000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.065396 8.028073 8.04805 [2,] 8.099604 8.091927 8.09195 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(8.01666666666667, 8.05583333333333, 8.0825, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/195vq1362672885.ps tmp/195vq1362672885.png",intern=TRUE)) character(0) > try(system("convert tmp/20o0l1362672885.ps tmp/20o0l1362672885.png",intern=TRUE)) character(0) > try(system("convert tmp/35y8d1362672885.ps tmp/35y8d1362672885.png",intern=TRUE)) character(0) > try(system("convert tmp/4w75d1362672885.ps tmp/4w75d1362672885.png",intern=TRUE)) character(0) > try(system("convert tmp/5zldy1362672885.ps tmp/5zldy1362672885.png",intern=TRUE)) character(0) > try(system("convert tmp/6ahid1362672885.ps tmp/6ahid1362672885.png",intern=TRUE)) character(0) > try(system("convert tmp/7thoy1362672885.ps tmp/7thoy1362672885.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.552 0.690 4.227