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(23.15,23.18,23.32,23.37,23.43,23.65,23.76,23.81,23.85,23.83,23.85,23.71,23.74,23.87,24.13,24.23,24.27,24.41,24.39,24.34,24.31,24.34,24.41,24.39,24.54,24.9,25.63,26.7,27.12,27.68,27.84,27.84,27.77,27.8,27.82,27.72,27.87,27.83,28.07,28.05,28.15,28.3,28.41,28.43,28.43,28.29,28.19,27.53,27.92,27.98,27.92,27.89,27.95,28.02,27.97,27.81,27.78,27.56,27.52,27.18,27.18,27.26,27.38,27.31,27.43,27.4,27.32,27.31,27.34,27.3,27.3,26.94) > 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,] 23.15 23.74 24.54 27.87 27.92 27.18 NA [2,] 23.18 23.87 24.90 27.83 27.98 27.26 NA [3,] 23.32 24.13 25.63 28.07 27.92 27.38 NA [4,] 23.37 24.23 26.70 28.05 27.89 27.31 NA [5,] 23.43 24.27 27.12 28.15 27.95 27.43 NA [6,] 23.65 24.41 27.68 28.30 28.02 27.40 NA [7,] 23.76 24.39 27.84 28.41 27.97 27.32 NA [8,] 23.81 24.34 27.84 28.43 27.81 27.31 NA [9,] 23.85 24.31 27.77 28.43 27.78 27.34 NA [10,] 23.83 24.34 27.80 28.29 27.56 27.30 NA [11,] 23.85 24.41 27.82 28.19 27.52 27.30 NA [12,] 23.71 24.39 27.72 27.53 27.18 26.94 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.03 0.13 0.36 -0.04 0.06 0.08 NA [2,] 0.14 0.26 0.73 0.24 -0.06 0.12 NA [3,] 0.05 0.10 1.07 -0.02 -0.03 -0.07 NA [4,] 0.06 0.04 0.42 0.10 0.06 0.12 NA [5,] 0.22 0.14 0.56 0.15 0.07 -0.03 NA [6,] 0.11 -0.02 0.16 0.11 -0.05 -0.08 NA [7,] 0.05 -0.05 0.00 0.02 -0.16 -0.01 NA [8,] 0.04 -0.03 -0.07 0.00 -0.03 0.03 NA [9,] -0.02 0.03 0.03 -0.14 -0.22 -0.04 NA [10,] 0.02 0.07 0.02 -0.10 -0.04 0.00 NA [11,] -0.14 -0.02 -0.10 -0.66 -0.34 -0.36 NA [12,] 0.03 0.15 0.15 0.39 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/1846j1350285924.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/2unv91350285924.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/3bw321350285924.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/4icem1350285924.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,] 23.15 23.18 23.320 23.370 23.430 23.65 23.76 23.81 23.850 23.83 23.85 [2,] 23.74 23.87 24.130 24.230 24.270 24.41 24.39 24.34 24.310 24.34 24.41 [3,] 25.86 26.08 26.505 27.005 27.275 27.54 27.58 27.56 27.555 27.43 27.41 [4,] 27.87 27.83 27.920 27.890 27.950 28.02 27.97 27.84 27.780 27.80 27.82 [5,] 27.92 27.98 28.070 28.050 28.150 28.30 28.41 28.43 28.430 28.29 28.19 [,12] [1,] 23.71 [2,] 24.39 [3,] 27.06 [4,] 27.53 [5,] 27.72 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 23.19602 23.52567 24.06033 24.64418 24.90128 25.21143 25.27078 25.30239 [2,] 28.52398 28.63433 28.94967 29.36582 29.64872 29.86857 29.88922 29.81761 [,9] [,10] [,11] [,12] [1,] 25.31674 25.19819 25.21044 25.0346 [2,] 29.79326 29.66181 29.60956 29.0854 $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(23.15, 23.74, 25.86, 27.87, 27.92, 23.18, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5x6ja1350285924.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.04 -0.06 -0.070 0.04 -0.030 -0.080 -0.050 -0.070 -0.22 -0.10 -0.66 [2,] 0.03 0.12 -0.030 0.06 0.070 -0.050 -0.050 -0.030 -0.14 -0.04 -0.36 [3,] 0.07 0.19 0.015 0.08 0.145 0.045 -0.005 -0.015 -0.03 0.01 -0.24 [4,] 0.13 0.26 0.100 0.12 0.220 0.110 0.020 0.030 0.03 0.02 -0.10 [5,] 0.13 0.26 0.100 0.12 0.220 0.160 0.050 0.040 0.03 0.07 -0.02 [,12] [1,] 0.00 [2,] 0.03 [3,] 0.15 [4,] 0.15 [5,] 0.15 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.00549677 0.09969548 -0.0688542 0.04129806 0.04824516 -0.05820517 [2,] 0.13450323 0.28030452 0.0988542 0.11870194 0.24175484 0.14820517 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.05015226 -0.05370194 -0.13965549 -0.02870194 -0.4077084 0.0652083 [2,] 0.04015226 0.02370194 0.07965549 0.04870194 -0.0722916 0.2347917 $out [1] 0.36 0.73 1.07 0.42 0.56 -0.16 0.39 $group [1] 1 2 3 4 5 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0400000000000027, 0.0300000000000011, 0.0700000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uga61350285924.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,] 23.150 23.870 24.540 27.530 27.520 27.18 NA [2,] 23.345 24.180 26.165 27.960 27.670 27.28 NA [3,] 23.680 24.325 27.700 28.170 27.905 27.31 NA [4,] 23.820 24.390 27.810 28.355 27.960 27.36 NA [5,] 23.850 24.410 27.840 28.430 28.020 27.43 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 23.46335 24.22922 26.9497 27.98984 27.77273 27.27351 NA [2,] 23.89665 24.42078 28.4503 28.35016 28.03727 27.34649 NA $out [1] 23.74 27.18 26.94 $group [1] 2 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(23.15, 23.345, 23.68, 23.82, 23.85, 23.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73i411350285924.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,] 25.73333 25.8600 25.81875 [2,] 26.16000 26.7550 26.19000 [3,] 26.45333 27.3425 26.40563 [4,] 26.57833 27.5475 26.44812 [5,] 26.61500 27.5800 26.54625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26.26253 26.98104 26.28789 [2,] 26.64414 27.70396 26.52336 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(25.7333333333333, 26.16, 26.4533333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1846j1350285924.ps tmp/1846j1350285924.png",intern=TRUE)) character(0) > try(system("convert tmp/2unv91350285924.ps tmp/2unv91350285924.png",intern=TRUE)) character(0) > try(system("convert tmp/3bw321350285924.ps tmp/3bw321350285924.png",intern=TRUE)) character(0) > try(system("convert tmp/4icem1350285924.ps tmp/4icem1350285924.png",intern=TRUE)) character(0) > try(system("convert tmp/5x6ja1350285924.ps tmp/5x6ja1350285924.png",intern=TRUE)) character(0) > try(system("convert tmp/6uga61350285924.ps tmp/6uga61350285924.png",intern=TRUE)) character(0) > try(system("convert tmp/73i411350285924.ps tmp/73i411350285924.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.293 0.640 3.932