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(79.57,77.45,75.79,74.88,74.5,74.59,74.59,73.57,73.3,73.23,73,72.31,72.31,71.24,70.82,70.66,69.94,69.87,69.87,68.88,68.09,68.38,66.78,67.2,67.2,66.67,65.86,66.05,66.31,66.39,66.39,65.72,65.52,64.93,65.27,65.04,65.02,64.72,64.68,64.41,64.79,64.71,64.71,64.83,64.77,64.19,64.27,64.23,64.23,63.03,62.85,62.15,61.69,62.1,62.1,61.81,61.28,61.05,61.08,60.98,60.98,61.11,60.58,60.37,59.44,59.29,59.29,59.33,59.06,58.75,58.92,58.73) > 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,] 79.57 72.31 67.20 65.02 64.23 60.98 NA [2,] 77.45 71.24 66.67 64.72 63.03 61.11 NA [3,] 75.79 70.82 65.86 64.68 62.85 60.58 NA [4,] 74.88 70.66 66.05 64.41 62.15 60.37 NA [5,] 74.50 69.94 66.31 64.79 61.69 59.44 NA [6,] 74.59 69.87 66.39 64.71 62.10 59.29 NA [7,] 74.59 69.87 66.39 64.71 62.10 59.29 NA [8,] 73.57 68.88 65.72 64.83 61.81 59.33 NA [9,] 73.30 68.09 65.52 64.77 61.28 59.06 NA [10,] 73.23 68.38 64.93 64.19 61.05 58.75 NA [11,] 73.00 66.78 65.27 64.27 61.08 58.92 NA [12,] 72.31 67.20 65.04 64.23 60.98 58.73 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.12 -1.07 -0.53 -0.30 -1.20 0.13 NA [2,] -1.66 -0.42 -0.81 -0.04 -0.18 -0.53 NA [3,] -0.91 -0.16 0.19 -0.27 -0.70 -0.21 NA [4,] -0.38 -0.72 0.26 0.38 -0.46 -0.93 NA [5,] 0.09 -0.07 0.08 -0.08 0.41 -0.15 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -1.02 -0.99 -0.67 0.12 -0.29 0.04 NA [8,] -0.27 -0.79 -0.20 -0.06 -0.53 -0.27 NA [9,] -0.07 0.29 -0.59 -0.58 -0.23 -0.31 NA [10,] -0.23 -1.60 0.34 0.08 0.03 0.17 NA [11,] -0.69 0.42 -0.23 -0.04 -0.10 -0.19 NA [12,] 0.00 0.00 -0.02 0.00 0.00 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/13meb1350659457.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/2vcu41350659457.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/3f5zc1350659457.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/4r5in1350659457.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,] 60.98 61.110 60.58 60.37 59.44 59.29 59.29 59.330 59.060 58.75 58.92 [2,] 64.23 63.030 62.85 62.15 61.69 62.10 62.10 61.810 61.280 61.05 61.08 [3,] 66.11 65.695 65.27 65.23 65.55 65.55 65.55 65.275 65.145 64.56 64.77 [4,] 72.31 71.240 70.82 70.66 69.94 69.87 69.87 68.880 68.090 68.38 66.78 [5,] 79.57 77.450 75.79 74.88 74.50 74.59 74.59 73.570 73.300 73.23 73.00 [,12] [1,] 58.730 [2,] 60.980 [3,] 64.635 [4,] 67.200 [5,] 72.310 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 60.89814 60.39928 60.12909 59.74078 60.22848 60.5381 60.5381 60.71462 [2,] 71.32186 70.99072 70.41091 70.71922 70.87152 70.5619 70.5619 69.83538 [,9] [,10] [,11] [,12] [1,] 60.75233 59.83191 61.09332 60.6229 [2,] 69.53767 69.28809 68.44668 68.6471 $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(60.98, 64.23, 66.11, 72.31, 79.57, 61.11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5m7231350659457.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,] -2.12 -1.660 -0.91 -0.93 -0.150 0 -1.02 -0.79 -0.59 -0.230 -0.230 0 [2,] -1.20 -0.810 -0.70 -0.72 -0.080 0 -0.99 -0.53 -0.58 -0.230 -0.230 0 [3,] -0.80 -0.475 -0.24 -0.42 0.005 0 -0.48 -0.27 -0.27 0.055 -0.145 0 [4,] -0.30 -0.180 -0.16 0.26 0.090 0 0.04 -0.20 -0.07 0.170 -0.040 0 [5,] 0.13 -0.040 0.19 0.38 0.090 0 0.12 -0.06 0.29 0.340 -0.040 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.3805291 -0.88137035 -0.5883174 -1.0521317 -0.1046555 0 -1.1443833 [2,] -0.2194709 -0.06862965 0.1083174 0.2121317 0.1146555 0 0.1843833 [,8] [,9] [,10] [,11] [,12] [1,] -0.48286066 -0.59896647 -0.2030129 -0.26755614 0 [2,] -0.05713934 0.05896647 0.3130129 -0.02244386 0 $out [1] 0.41 -1.60 -0.69 0.42 -0.02 $group [1] 5 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.11999999999999, -1.2, -0.800000000000004, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6czo71350659457.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,] 72.310 66.780 64.930 64.19 60.980 58.730 NA [2,] 73.265 68.235 65.395 64.34 61.180 58.990 NA [3,] 74.545 69.870 65.955 64.71 61.955 59.310 NA [4,] 75.335 70.740 66.390 64.78 62.500 60.475 NA [5,] 77.450 72.310 67.200 65.02 64.230 61.110 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 73.60086 68.72745 65.50117 64.50931 61.35294 58.63268 NA [2,] 75.48914 71.01255 66.40883 64.91069 62.55706 59.98732 NA $out [1] 79.57 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(72.31, 73.265, 74.545, 75.335, 77.45, 66.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7876f1350659457.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,] 64.74833 64.5600 64.14000 [2,] 65.21250 64.9575 64.73812 [3,] 66.13500 65.2725 65.81250 [4,] 66.59167 65.5500 66.27750 [5,] 68.21833 66.1100 67.73000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 65.50595 65.00226 65.11038 [2,] 66.76405 65.54274 66.51462 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(64.7483333333333, 65.2125, 66.135, 66.5916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13meb1350659457.ps tmp/13meb1350659457.png",intern=TRUE)) character(0) > try(system("convert tmp/2vcu41350659457.ps tmp/2vcu41350659457.png",intern=TRUE)) character(0) > try(system("convert tmp/3f5zc1350659457.ps tmp/3f5zc1350659457.png",intern=TRUE)) character(0) > try(system("convert tmp/4r5in1350659457.ps tmp/4r5in1350659457.png",intern=TRUE)) character(0) > try(system("convert tmp/5m7231350659457.ps tmp/5m7231350659457.png",intern=TRUE)) character(0) > try(system("convert tmp/6czo71350659457.ps tmp/6czo71350659457.png",intern=TRUE)) character(0) > try(system("convert tmp/7876f1350659457.ps tmp/7876f1350659457.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.204 0.741 4.951