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(102.89,102.64,103.33,103.56,103.6,104.24,105.31,105.4,105.89,105.89,105.54,106.15,106.14,105.85,106.27,106.51,106.82,106.53,107.14,107.39,107.33,107.53,107.42,108.25,108.26,108.93,109.43,109.61,109.74,110.12,110.16,110.44,111.23,112.86,112.77,113.04,112.79,113.87,114.28,115.51,116.76,116.91,116.47,116.94,117.24,116.82,117.48,117.11,117.31,117.77,118.37,117.91,118.12,118.02,117.77,117.85,118.68,118.9,118.6,118.21,118.37,117.43,117.5,116.71,116.98,117.74,117.44,117.85,118.54,118.73,118.68,118.19) > 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,] 102.89 106.14 108.26 112.79 117.31 118.37 NA [2,] 102.64 105.85 108.93 113.87 117.77 117.43 NA [3,] 103.33 106.27 109.43 114.28 118.37 117.50 NA [4,] 103.56 106.51 109.61 115.51 117.91 116.71 NA [5,] 103.60 106.82 109.74 116.76 118.12 116.98 NA [6,] 104.24 106.53 110.12 116.91 118.02 117.74 NA [7,] 105.31 107.14 110.16 116.47 117.77 117.44 NA [8,] 105.40 107.39 110.44 116.94 117.85 117.85 NA [9,] 105.89 107.33 111.23 117.24 118.68 118.54 NA [10,] 105.89 107.53 112.86 116.82 118.90 118.73 NA [11,] 105.54 107.42 112.77 117.48 118.60 118.68 NA [12,] 106.15 108.25 113.04 117.11 118.21 118.19 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.25 -0.29 0.67 1.08 0.46 -0.94 NA [2,] 0.69 0.42 0.50 0.41 0.60 0.07 NA [3,] 0.23 0.24 0.18 1.23 -0.46 -0.79 NA [4,] 0.04 0.31 0.13 1.25 0.21 0.27 NA [5,] 0.64 -0.29 0.38 0.15 -0.10 0.76 NA [6,] 1.07 0.61 0.04 -0.44 -0.25 -0.30 NA [7,] 0.09 0.25 0.28 0.47 0.08 0.41 NA [8,] 0.49 -0.06 0.79 0.30 0.83 0.69 NA [9,] 0.00 0.20 1.63 -0.42 0.22 0.19 NA [10,] -0.35 -0.11 -0.09 0.66 -0.30 -0.05 NA [11,] 0.61 0.83 0.27 -0.37 -0.39 -0.49 NA [12,] -0.01 0.01 -0.25 0.20 0.16 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/1jkuv1350632365.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/240be1350632365.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/37vto1350632365.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/4chsl1350632365.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] [1,] 102.890 102.64 103.330 103.56 103.60 104.240 105.310 105.40 105.890 105.89 [2,] 106.140 105.85 106.270 106.51 106.82 106.530 107.140 107.39 107.330 107.53 [3,] 110.525 111.40 111.855 112.56 113.25 113.515 113.315 113.69 114.235 114.84 [4,] 117.310 117.43 117.500 116.71 116.98 117.740 117.440 117.85 118.540 118.73 [5,] 118.370 117.77 118.370 117.91 118.12 118.020 117.770 117.85 118.680 118.90 [,11] [,12] [1,] 105.540 106.150 [2,] 107.420 108.250 [3,] 115.125 115.075 [4,] 118.600 118.190 [5,] 118.680 118.210 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.32 103.9305 104.6113 105.9807 106.6965 106.2842 106.6712 106.943 [2,] 117.73 118.8695 119.0987 119.1393 119.8035 120.7458 119.9588 120.437 [,9] [,10] [,11] [,12] [1,] 107.0042 107.6156 107.9135 108.6634 [2,] 121.4658 122.0644 122.3365 121.4866 $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(102.89, 106.14, 110.525, 117.31, 118.37, 102.64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50dj11350632365.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.940 0.41 -0.790 0.04 -0.290 -0.440 0.080 -0.06 0.000 -0.35 -0.49 -0.25 [2,] -0.290 0.41 -0.460 0.13 -0.100 -0.300 0.090 0.30 0.000 -0.30 -0.39 -0.01 [3,] 0.105 0.46 0.205 0.24 0.265 -0.105 0.265 0.59 0.195 -0.10 -0.05 0.01 [4,] 0.670 0.60 0.240 0.31 0.640 0.610 0.410 0.79 0.220 -0.05 0.61 0.16 [5,] 1.080 0.69 1.230 0.31 0.760 1.070 0.470 0.83 0.220 -0.05 0.83 0.20 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.514231 0.3374439 -0.2465226 0.1238942 -0.2123239 -0.6919794 0.05858966 [2,] 0.724231 0.5825561 0.6565226 0.3561058 0.7423239 0.4819794 0.47141034 [,8] [,9] [,10] [,11] [,12] [1,] 0.2739342 0.05309289 -0.26125807 -0.6950323 -0.1101216 [2,] 0.9060658 0.33690711 0.06125807 0.5950323 0.1301216 $out [1] 0.07 1.25 1.63 -0.42 0.66 $group [1] 2 4 9 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.939999999999998, -0.290000000000006, 0.104999999999997, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65a6r1350632365.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,] 102.640 105.850 108.26 112.790 117.310 116.710 NA [2,] 103.445 106.390 109.52 114.895 117.810 117.435 NA [3,] 104.775 106.980 110.14 116.790 118.070 117.795 NA [4,] 105.715 107.405 112.00 117.025 118.485 118.455 NA [5,] 106.150 108.250 113.04 117.480 118.900 118.730 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.7396 106.5171 109.0089 115.8185 117.7621 117.3298 NA [2,] 105.8104 107.4429 111.2711 117.7615 118.3779 118.2602 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(102.64, 103.445, 104.775, 105.715, 106.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sm301350632365.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,] 110.9600 110.5250 111.4250 [2,] 111.5825 112.2075 111.8625 [3,] 112.3208 113.4150 112.5131 [4,] 113.2833 114.5375 113.3994 [5,] 113.4917 115.1250 113.6838 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.5451 112.3523 111.8121 [2,] 113.0966 114.4777 113.2141 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(110.96, 111.5825, 112.320833333333, 113.283333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jkuv1350632365.ps tmp/1jkuv1350632365.png",intern=TRUE)) character(0) > try(system("convert tmp/240be1350632365.ps tmp/240be1350632365.png",intern=TRUE)) character(0) > try(system("convert tmp/37vto1350632365.ps tmp/37vto1350632365.png",intern=TRUE)) character(0) > try(system("convert tmp/4chsl1350632365.ps tmp/4chsl1350632365.png",intern=TRUE)) character(0) > try(system("convert tmp/50dj11350632365.ps tmp/50dj11350632365.png",intern=TRUE)) character(0) > try(system("convert tmp/65a6r1350632365.ps tmp/65a6r1350632365.png",intern=TRUE)) character(0) > try(system("convert tmp/7sm301350632365.ps tmp/7sm301350632365.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.148 0.552 3.693