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(8.41,8.39,8.43,8.44,8.49,8.47,8.53,8.52,8.51,8.53,8.54,8.53,8.47,8.63,8.67,8.73,8.57,8.55,8.63,8.65,8.44,8.62,8.37,8.59,8.84,8.72,8.8,8.69,8.68,8.57,8.85,8.85,8.85,8.93,8.75,8.78,8.77,9.03,9.01,9.07,8.99,9.02,8.99,8.98,8.94,8.94,8.75,8.86,8.87,8.84,8.84,9.91,10.18,10.34,10.36,10.26,10.16,10.31,10.46,10.54,10.47,10.48,10.46,11.3,11.58,11.69,11.63,11.51,11.37,11.42,11.7,11.75) > 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.41 8.47 8.84 8.77 8.87 10.47 NA [2,] 8.39 8.63 8.72 9.03 8.84 10.48 NA [3,] 8.43 8.67 8.80 9.01 8.84 10.46 NA [4,] 8.44 8.73 8.69 9.07 9.91 11.30 NA [5,] 8.49 8.57 8.68 8.99 10.18 11.58 NA [6,] 8.47 8.55 8.57 9.02 10.34 11.69 NA [7,] 8.53 8.63 8.85 8.99 10.36 11.63 NA [8,] 8.52 8.65 8.85 8.98 10.26 11.51 NA [9,] 8.51 8.44 8.85 8.94 10.16 11.37 NA [10,] 8.53 8.62 8.93 8.94 10.31 11.42 NA [11,] 8.54 8.37 8.75 8.75 10.46 11.70 NA [12,] 8.53 8.59 8.78 8.86 10.54 11.75 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.02 0.16 -0.12 0.26 -0.03 0.01 NA [2,] 0.04 0.04 0.08 -0.02 0.00 -0.02 NA [3,] 0.01 0.06 -0.11 0.06 1.07 0.84 NA [4,] 0.05 -0.16 -0.01 -0.08 0.27 0.28 NA [5,] -0.02 -0.02 -0.11 0.03 0.16 0.11 NA [6,] 0.06 0.08 0.28 -0.03 0.02 -0.06 NA [7,] -0.01 0.02 0.00 -0.01 -0.10 -0.12 NA [8,] -0.01 -0.21 0.00 -0.04 -0.10 -0.14 NA [9,] 0.02 0.18 0.08 0.00 0.15 0.05 NA [10,] 0.01 -0.25 -0.18 -0.19 0.15 0.28 NA [11,] -0.01 0.22 0.03 0.11 0.08 0.05 NA [12,] -0.06 0.25 -0.01 0.01 -0.07 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/1srvy1350632299.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/2hdfz1350632299.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/3jkpv1350632299.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/4lutc1350632299.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,] 8.410 8.39 8.43 8.44 8.490 8.470 8.53 8.520 8.440 8.530 8.37 8.53 [2,] 8.470 8.63 8.67 8.69 8.570 8.550 8.63 8.650 8.510 8.620 8.54 8.59 [3,] 8.805 8.78 8.82 8.90 8.835 8.795 8.92 8.915 8.895 8.935 8.75 8.82 [4,] 8.870 9.03 9.01 9.91 10.180 10.340 10.36 10.260 10.160 10.310 10.46 10.54 [5,] 8.870 9.03 9.01 11.30 11.580 11.690 11.63 11.510 11.370 11.420 11.70 11.75 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 8.546987 8.521987 8.600689 8.113061 7.796498 7.640392 7.804094 7.876498 [2,] 9.063013 9.038013 9.039311 9.686939 9.873502 9.949608 10.035906 9.953502 [,9] [,10] [,11] [,12] [1,] 7.830697 7.844895 7.511538 7.562187 [2,] 9.959303 10.025105 9.988462 10.077813 $out [1] 10.47 10.48 10.46 $group [1] 1 2 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(8.41, 8.47, 8.805, 8.87, 8.87, 8.39, 8.63, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57plc1350632299.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.120 -0.02 -0.11 -0.16 -0.110 -0.06 -0.12 -0.21 0.000 -0.250 -0.010 [2,] -0.030 -0.02 0.01 -0.08 -0.020 -0.03 -0.10 -0.14 0.020 -0.190 0.030 [3,] -0.005 0.02 0.06 0.02 0.005 0.04 -0.01 -0.07 0.065 -0.085 0.065 [4,] 0.160 0.04 0.84 0.27 0.110 0.08 0.00 -0.01 0.150 0.150 0.110 [5,] 0.260 0.08 1.07 0.28 0.160 0.08 0.02 0.00 0.180 0.280 0.220 [,12] [1,] -0.07 [2,] -0.06 [3,] -0.01 [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.1275561 -0.01870194 -0.4753768 -0.2057613 -0.0788542 -0.03095355 [2,] 0.1175561 0.05870194 0.5953768 0.2457613 0.0888542 0.11095355 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.07450323 -0.1538542 -0.0188542 -0.304311 0.01339742 -0.05946182 [2,] 0.05450323 0.0138542 0.1488542 0.134311 0.11660258 0.03946182 $out [1] 0.28 0.25 $group [1] 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.119999999999999, -0.0299999999999994, -0.00499999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/632w41350632299.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,] 8.390 8.370 8.570 8.750 8.84 10.460 NA [2,] 8.435 8.510 8.705 8.900 9.39 10.890 NA [3,] 8.500 8.605 8.790 8.985 10.22 11.465 NA [4,] 8.530 8.640 8.850 9.015 10.35 11.660 NA [5,] 8.540 8.730 8.930 9.070 10.54 11.750 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 8.45667 8.545706 8.723865 8.932548 9.782138 11.1138 NA [2,] 8.54333 8.664294 8.856135 9.037452 10.657862 11.8162 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(8.39, 8.435, 8.5, 8.53, 8.54, 8.37, 8.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70rp81350632299.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.971667 8.7500 8.70375 [2,] 9.195833 8.8000 9.01750 [3,] 9.421667 8.8275 9.26125 [4,] 9.460000 8.9075 9.32625 [5,] 9.508333 8.9350 9.37875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.301178 8.778469 9.120427 [2,] 9.542155 8.876531 9.402073 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(8.97166666666667, 9.19583333333333, 9.42166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1srvy1350632299.ps tmp/1srvy1350632299.png",intern=TRUE)) character(0) > try(system("convert tmp/2hdfz1350632299.ps tmp/2hdfz1350632299.png",intern=TRUE)) character(0) > try(system("convert tmp/3jkpv1350632299.ps tmp/3jkpv1350632299.png",intern=TRUE)) character(0) > try(system("convert tmp/4lutc1350632299.ps tmp/4lutc1350632299.png",intern=TRUE)) character(0) > try(system("convert tmp/57plc1350632299.ps tmp/57plc1350632299.png",intern=TRUE)) character(0) > try(system("convert tmp/632w41350632299.ps tmp/632w41350632299.png",intern=TRUE)) character(0) > try(system("convert tmp/70rp81350632299.ps tmp/70rp81350632299.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.293 0.566 3.848