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.94,1.82,1.8,1.79,1.79,1.78,1.81,1.84,1.87,1.87,1.87,1.84,1.82,1.83,1.83,1.82,1.83,1.87,1.88,1.9,1.98,2.03,2.14,2.42,2.73,2.84,2.85,2.94,3.06,3.24,3.18,3.01,2.87,2.73,2.63,2.39,2.26,2.11,2.01,1.99,1.96,1.93,1.98,2.07,2.24,2.31,2.23,2.26,2.28,2.3,2.33,2.26,2.24,2.47,2.55,2.89,3.21,3.21,2.92,2.68,2.4,2.28,2.24,2.2,2.18,2.23,2.24,2.25,2.23,2.25,2.23,2.21) > 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.94 1.82 2.73 2.26 2.28 2.40 NA [2,] 1.82 1.83 2.84 2.11 2.30 2.28 NA [3,] 1.80 1.83 2.85 2.01 2.33 2.24 NA [4,] 1.79 1.82 2.94 1.99 2.26 2.20 NA [5,] 1.79 1.83 3.06 1.96 2.24 2.18 NA [6,] 1.78 1.87 3.24 1.93 2.47 2.23 NA [7,] 1.81 1.88 3.18 1.98 2.55 2.24 NA [8,] 1.84 1.90 3.01 2.07 2.89 2.25 NA [9,] 1.87 1.98 2.87 2.24 3.21 2.23 NA [10,] 1.87 2.03 2.73 2.31 3.21 2.25 NA [11,] 1.87 2.14 2.63 2.23 2.92 2.23 NA [12,] 1.84 2.42 2.39 2.26 2.68 2.21 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.12 0.01 0.11 -0.15 0.02 -0.12 NA [2,] -0.02 0.00 0.01 -0.10 0.03 -0.04 NA [3,] -0.01 -0.01 0.09 -0.02 -0.07 -0.04 NA [4,] 0.00 0.01 0.12 -0.03 -0.02 -0.02 NA [5,] -0.01 0.04 0.18 -0.03 0.23 0.05 NA [6,] 0.03 0.01 -0.06 0.05 0.08 0.01 NA [7,] 0.03 0.02 -0.17 0.09 0.34 0.01 NA [8,] 0.03 0.08 -0.14 0.17 0.32 -0.02 NA [9,] 0.00 0.05 -0.14 0.07 0.00 0.02 NA [10,] 0.00 0.11 -0.10 -0.08 -0.29 -0.02 NA [11,] -0.03 0.28 -0.24 0.03 -0.24 -0.02 NA [12,] -0.02 0.31 -0.13 0.02 -0.28 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/1l48k1350632171.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/2emcc1350632171.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/3xz8n1350632171.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/4rga61350632171.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,] 1.82 1.820 1.800 1.790 1.79 1.78 1.81 1.84 1.870 1.87 1.87 2.210 [2,] 1.94 1.830 1.830 1.820 1.83 1.87 1.88 1.90 1.980 2.03 2.14 2.210 [3,] 2.27 2.195 2.125 2.095 2.07 2.08 2.11 2.16 2.235 2.28 2.23 2.325 [4,] 2.40 2.300 2.330 2.260 2.24 2.47 2.55 2.89 2.870 2.73 2.63 2.420 [5,] 2.73 2.840 2.850 2.260 2.24 3.24 3.18 3.01 3.210 3.21 2.92 2.680 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.973285 1.891835 1.802484 1.811186 1.805537 1.692981 1.677828 1.521418 [2,] 2.566715 2.498165 2.447516 2.378814 2.334463 2.467019 2.542172 2.798582 [,9] [,10] [,11] [,12] [1,] 1.660921 1.828477 1.913934 2.189543 [2,] 2.809079 2.731523 2.546066 2.460457 $out [1] 2.94 3.06 1.84 $group [1] 4 5 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.82, 1.94, 2.27, 2.4, 2.73, 1.82, 1.83, 2.195, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ysca1350632171.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.150 -0.10 -0.070 -0.03 -0.030 0.01 0.010 -0.140 0.00 -0.10 -0.240 -0.28 [2,] -0.120 -0.04 -0.040 -0.02 -0.010 0.01 0.010 -0.020 0.00 -0.10 -0.240 -0.13 [3,] -0.055 -0.01 -0.015 -0.01 0.045 0.02 0.025 0.055 0.01 -0.05 -0.025 -0.02 [4,] 0.020 0.01 -0.010 0.01 0.180 0.05 0.090 0.170 0.05 0.00 0.030 0.02 [5,] 0.110 0.03 -0.010 0.01 0.230 0.08 0.090 0.320 0.07 0.11 0.280 0.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.14530452 -0.04225161 -0.034350969 -0.029350969 -0.07755614 -0.005801292 [2,] 0.03530452 0.02225161 0.004350969 0.009350969 0.16755614 0.045801292 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.02660258 -0.06755614 -0.02225161 -0.11450323 -0.1991587 -0.12598962 [2,] 0.07660258 0.17755614 0.04225161 0.01450323 0.1491587 0.08598962 $out [1] 0.09 0.12 -0.06 -0.17 0.34 -0.14 -0.29 0.31 $group [1] 3 4 6 7 7 9 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.15, -0.12, -0.0549999999999999, 0.02, 0.11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6au5k1350632171.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,] 1.780 1.820 2.390 1.930 2.240 2.180 NA [2,] 1.795 1.830 2.730 1.985 2.290 2.220 NA [3,] 1.830 1.875 2.860 2.090 2.510 2.235 NA [4,] 1.870 2.005 3.035 2.250 2.905 2.250 NA [5,] 1.940 2.140 3.240 2.310 3.210 2.280 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.795792 1.795181 2.720887 1.969132 2.229494 2.221317 NA [2,] 1.864208 1.954819 2.999113 2.210868 2.790506 2.248683 NA $out [1] 2.42 2.40 $group [1] 2 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.78, 1.795, 1.83, 1.87, 1.94, 1.82, 1.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7okzp1350632171.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,] 2.166667 2.0700 2.043750 [2,] 2.186667 2.1025 2.094375 [3,] 2.263333 2.1775 2.191875 [4,] 2.331667 2.2525 2.341250 [5,] 2.400000 2.3250 2.377500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.197198 2.109084 2.079274 [2,] 2.329469 2.245916 2.304476 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2.16666666666667, 2.18666666666667, 2.26333333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1l48k1350632171.ps tmp/1l48k1350632171.png",intern=TRUE)) character(0) > try(system("convert tmp/2emcc1350632171.ps tmp/2emcc1350632171.png",intern=TRUE)) character(0) > try(system("convert tmp/3xz8n1350632171.ps tmp/3xz8n1350632171.png",intern=TRUE)) character(0) > try(system("convert tmp/4rga61350632171.ps tmp/4rga61350632171.png",intern=TRUE)) character(0) > try(system("convert tmp/5ysca1350632171.ps tmp/5ysca1350632171.png",intern=TRUE)) character(0) > try(system("convert tmp/6au5k1350632171.ps tmp/6au5k1350632171.png",intern=TRUE)) character(0) > try(system("convert tmp/7okzp1350632171.ps tmp/7okzp1350632171.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.463 0.585 4.037