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(1.01,1.02,1.04,1.06,1.06,1.06,1.06,1.06,1.02,0.98,0.99,0.99,0.94,0.96,0.98,1.01,1.01,1.02,1.04,1.03,1.05,1.08,1.17,1.11,1.11,1.11,1.2,1.21,1.31,1.37,1.37,1.26,1.23,1.17,1.06,0.95,0.92,0.92,0.9,0.93,0.93,0.97,0.96,0.99,0.98,0.96,1,0.99,1.03,1.02,1.07,1.13,1.15,1.16,1.14,1.15,1.15,1.16,1.17,1.22,1.26,1.29,1.36,1.38,1.37,1.37,1.37,1.36,1.38,1.4,1.44,1.42) > 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,] 1.01 0.94 1.11 0.92 1.03 1.26 NA [2,] 1.02 0.96 1.11 0.92 1.02 1.29 NA [3,] 1.04 0.98 1.20 0.90 1.07 1.36 NA [4,] 1.06 1.01 1.21 0.93 1.13 1.38 NA [5,] 1.06 1.01 1.31 0.93 1.15 1.37 NA [6,] 1.06 1.02 1.37 0.97 1.16 1.37 NA [7,] 1.06 1.04 1.37 0.96 1.14 1.37 NA [8,] 1.06 1.03 1.26 0.99 1.15 1.36 NA [9,] 1.02 1.05 1.23 0.98 1.15 1.38 NA [10,] 0.98 1.08 1.17 0.96 1.16 1.40 NA [11,] 0.99 1.17 1.06 1.00 1.17 1.44 NA [12,] 0.99 1.11 0.95 0.99 1.22 1.42 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0.02 0.00 0.00 -0.01 0.03 NA [2,] 0.02 0.02 0.09 -0.02 0.05 0.07 NA [3,] 0.02 0.03 0.01 0.03 0.06 0.02 NA [4,] 0.00 0.00 0.10 0.00 0.02 -0.01 NA [5,] 0.00 0.01 0.06 0.04 0.01 0.00 NA [6,] 0.00 0.02 0.00 -0.01 -0.02 0.00 NA [7,] 0.00 -0.01 -0.11 0.03 0.01 -0.01 NA [8,] -0.04 0.02 -0.03 -0.01 0.00 0.02 NA [9,] -0.04 0.03 -0.06 -0.02 0.01 0.02 NA [10,] 0.01 0.09 -0.11 0.04 0.01 0.04 NA [11,] 0.00 -0.06 -0.11 -0.01 0.05 -0.02 NA [12,] -0.05 0.00 -0.03 0.04 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/fisher/rcomp/tmp/1tx7i1350590167.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/2w1jd1350590167.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/3gjpp1350590167.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/4cwjj1350590167.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,] 0.92 0.92 0.900 0.930 0.930 0.97 0.96 0.990 0.98 0.96 0.990 0.95 [2,] 0.94 0.96 0.980 1.010 1.010 1.02 1.04 1.030 1.02 0.98 1.000 0.99 [3,] 1.02 1.02 1.055 1.095 1.105 1.11 1.10 1.105 1.10 1.12 1.115 1.05 [4,] 1.11 1.11 1.200 1.210 1.310 1.37 1.37 1.260 1.23 1.17 1.170 1.22 [5,] 1.26 1.29 1.360 1.380 1.370 1.37 1.37 1.360 1.38 1.40 1.170 1.42 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9103445 0.9232452 0.9130929 0.9659935 0.9114903 0.8842387 0.8871393 [2,] 1.1296555 1.1167548 1.1969071 1.2240065 1.2985097 1.3357613 1.3128607 [,8] [,9] [,10] [,11] [,12] [1,] 0.9566426 0.9645432 0.9974439 1.005345 0.9016426 [2,] 1.2533574 1.2354568 1.2425561 1.224655 1.1983574 $out [1] 1.44 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.92, 0.94, 1.02, 1.11, 1.26, 0.92, 0.96, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5jzdo1350590167.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.010 -0.020 0.010 -0.01 0.00 -0.02 -0.010 -0.040 -0.060 0.010 -0.110 [2,] 0.000 0.020 0.020 0.00 0.00 -0.01 -0.010 -0.030 -0.040 0.010 -0.060 [3,] 0.005 0.035 0.025 0.00 0.01 0.00 -0.005 -0.005 -0.005 0.025 -0.015 [4,] 0.020 0.070 0.030 0.02 0.04 0.00 0.010 0.020 0.020 0.040 0.000 [5,] 0.030 0.090 0.030 0.02 0.06 0.00 0.030 0.020 0.030 0.040 0.050 [,12] [1,] -0.05 [2,] -0.03 [3,] 0.00 [4,] 0.04 [5,] 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.007900646 0.002748385 0.01854968 -0.01290065 -0.01580129 -0.006450323 [2,] 0.017900646 0.067251615 0.03145032 0.01290065 0.03580129 0.006450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.017900646 -0.03725161 -0.04370194 0.005649031 -0.05370194 -0.04946182 [2,] 0.007900646 0.02725161 0.03370194 0.044350969 0.02370194 0.04946182 $out [1] 0.06 0.10 0.02 -0.11 0.09 -0.11 $group [1] 3 4 6 7 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, 0, 0.005, 0.02, 0.03, -0.02, 0.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6jnj51350590167.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,] 0.98 0.940 0.950 0.900 1.02 1.36 NA [2,] 1.00 0.995 1.110 0.925 1.10 1.36 NA [3,] 1.03 1.025 1.205 0.960 1.15 1.37 NA [4,] 1.06 1.065 1.285 0.985 1.16 1.39 NA [5,] 1.06 1.170 1.370 1.000 1.22 1.42 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.002634 0.9930725 1.125181 0.9326336 1.122634 1.356317 NA [2,] 1.057366 1.0569275 1.284819 0.9873664 1.177366 1.383683 NA $out [1] 1.26 1.29 1.44 $group [1] 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.98, 1, 1.03, 1.06, 1.06, 0.94, 0.995, 1.025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/72nka1350590167.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,] 1.053333 1.0200 1.023750 [2,] 1.102500 1.0525 1.083750 [3,] 1.130000 1.1000 1.099375 [4,] 1.140000 1.1075 1.140625 [5,] 1.158333 1.1200 1.178750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.112896 1.074914 1.073434 [2,] 1.147104 1.125086 1.125316 $out [1] 1.045 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.05333333333333, 1.1025, 1.13, 1.14, 1.15833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tx7i1350590167.ps tmp/1tx7i1350590167.png",intern=TRUE)) character(0) > try(system("convert tmp/2w1jd1350590167.ps tmp/2w1jd1350590167.png",intern=TRUE)) character(0) > try(system("convert tmp/3gjpp1350590167.ps tmp/3gjpp1350590167.png",intern=TRUE)) character(0) > try(system("convert tmp/4cwjj1350590167.ps tmp/4cwjj1350590167.png",intern=TRUE)) character(0) > try(system("convert tmp/5jzdo1350590167.ps tmp/5jzdo1350590167.png",intern=TRUE)) character(0) > try(system("convert tmp/6jnj51350590167.ps tmp/6jnj51350590167.png",intern=TRUE)) character(0) > try(system("convert tmp/72nka1350590167.ps tmp/72nka1350590167.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.550 0.642 4.192