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(9.24,9.29,9.39,9.42,9.42,9.43,9.5,9.53,9.58,9.58,9.6,9.61,9.65,9.71,9.78,9.79,9.84,9.87,9.9,9.95,9.96,9.98,10.01,10,10.03,10.05,10.06,10.09,10.24,10.23,10.27,10.28,10.29,10.44,10.51,10.52,10.57,10.62,10.71,10.73,10.74,10.75,10.79,10.81,10.87,10.92,10.95,10.94,10.97,10.99,11.04,11.09,11.12,11.11,11.14,11.2,11.25,11.3,11.31,11.31,11.33,11.41,11.46,11.48,11.58,11.63,11.69,11.74,11.68,11.69,11.71,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,] 9.24 9.65 10.03 10.57 10.97 11.33 NA [2,] 9.29 9.71 10.05 10.62 10.99 11.41 NA [3,] 9.39 9.78 10.06 10.71 11.04 11.46 NA [4,] 9.42 9.79 10.09 10.73 11.09 11.48 NA [5,] 9.42 9.84 10.24 10.74 11.12 11.58 NA [6,] 9.43 9.87 10.23 10.75 11.11 11.63 NA [7,] 9.50 9.90 10.27 10.79 11.14 11.69 NA [8,] 9.53 9.95 10.28 10.81 11.20 11.74 NA [9,] 9.58 9.96 10.29 10.87 11.25 11.68 NA [10,] 9.58 9.98 10.44 10.92 11.30 11.69 NA [11,] 9.60 10.01 10.51 10.95 11.31 11.71 NA [12,] 9.61 10.00 10.52 10.94 11.31 11.75 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.05 0.06 0.02 0.05 0.02 0.08 NA [2,] 0.10 0.07 0.01 0.09 0.05 0.05 NA [3,] 0.03 0.01 0.03 0.02 0.05 0.02 NA [4,] 0.00 0.05 0.15 0.01 0.03 0.10 NA [5,] 0.01 0.03 -0.01 0.01 -0.01 0.05 NA [6,] 0.07 0.03 0.04 0.04 0.03 0.06 NA [7,] 0.03 0.05 0.01 0.02 0.06 0.05 NA [8,] 0.05 0.01 0.01 0.06 0.05 -0.06 NA [9,] 0.00 0.02 0.15 0.05 0.05 0.01 NA [10,] 0.02 0.03 0.07 0.03 0.01 0.02 NA [11,] 0.01 -0.01 0.01 -0.01 0.00 0.04 NA [12,] 0.04 0.03 0.05 0.03 0.02 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/fisher/rcomp/tmp/1jrxp1350588919.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/fisher/rcomp/tmp/2xnwm1350588919.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/fisher/rcomp/tmp/35d481350588919.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/fisher/rcomp/tmp/4n3sx1350588919.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,] 9.24 9.290 9.390 9.42 9.42 9.43 9.50 9.530 9.58 9.58 9.60 9.61 [2,] 9.65 9.710 9.780 9.79 9.84 9.87 9.90 9.950 9.96 9.98 10.01 10.00 [3,] 10.30 10.335 10.385 10.41 10.49 10.49 10.53 10.545 10.58 10.68 10.73 10.73 [4,] 10.97 10.990 11.040 11.09 11.12 11.11 11.14 11.200 11.25 11.30 11.31 11.31 [5,] 11.33 11.410 11.460 11.48 11.58 11.63 11.69 11.740 11.68 11.69 11.71 11.75 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.448557 9.509359 9.572259 9.571458 9.664359 9.69016 9.73016 [2,] 11.151443 11.160641 11.197741 11.248542 11.315641 11.28984 11.32984 [,8] [,9] [,10] [,11] [,12] [1,] 9.73871 9.747908 9.828557 9.891458 9.885008 [2,] 11.35129 11.412092 11.531443 11.568542 11.574992 $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(9.24, 9.65, 10.3, 10.97, 11.33, 9.29, 9.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/52mgx1350588919.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.02 0.01 0.010 0.00 -0.01 0.03 0.01 0.01 0.000 0.010 -0.010 0.02 [2,] 0.02 0.05 0.020 0.01 -0.01 0.03 0.02 0.01 0.010 0.020 -0.010 0.03 [3,] 0.05 0.06 0.025 0.04 0.01 0.04 0.04 0.03 0.035 0.025 0.005 0.03 [4,] 0.06 0.09 0.030 0.10 0.03 0.06 0.05 0.05 0.050 0.030 0.010 0.04 [5,] 0.08 0.10 0.030 0.15 0.05 0.07 0.06 0.06 0.050 0.030 0.040 0.05 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.02419871 0.03419871 0.01854968 -0.01805291 -0.01580129 0.02064903 [2,] 0.07580129 0.08580129 0.03145032 0.09805291 0.03580129 0.05935097 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.02064903 0.004198708 0.009198708 0.01854968 -0.007900646 0.02293403 [2,] 0.05935097 0.055801292 0.060801292 0.03145032 0.017900646 0.03706597 $out [1] 0.05 -0.06 0.15 0.07 $group [1] 3 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0199999999999996, 0.0200000000000014, 0.0499999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ayme1350588919.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,] 9.240 9.650 10.030 10.570 10.970 11.330 NA [2,] 9.405 9.785 10.075 10.720 11.065 11.470 NA [3,] 9.465 9.885 10.255 10.770 11.130 11.655 NA [4,] 9.580 9.970 10.365 10.895 11.275 11.700 NA [5,] 9.610 10.010 10.520 10.950 11.310 11.750 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9.385181 9.80062 10.12273 10.69018 11.03422 11.5501 NA [2,] 9.544819 9.96938 10.38727 10.84982 11.22578 11.7599 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(9.24, 9.405, 9.465, 9.58, 9.61, 9.65, 9.785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7hq0d1350588919.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,] 10.29833 10.3000 10.30750 [2,] 10.42000 10.3975 10.41812 [3,] 10.52583 10.5100 10.50625 [4,] 10.62833 10.6300 10.62438 [5,] 10.68833 10.7300 10.67750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 10.43081 10.40396 10.41218 [2,] 10.62086 10.61604 10.60032 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(10.2983333333333, 10.42, 10.5258333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jrxp1350588919.ps tmp/1jrxp1350588919.png",intern=TRUE)) character(0) > try(system("convert tmp/2xnwm1350588919.ps tmp/2xnwm1350588919.png",intern=TRUE)) character(0) > try(system("convert tmp/35d481350588919.ps tmp/35d481350588919.png",intern=TRUE)) character(0) > try(system("convert tmp/4n3sx1350588919.ps tmp/4n3sx1350588919.png",intern=TRUE)) character(0) > try(system("convert tmp/52mgx1350588919.ps tmp/52mgx1350588919.png",intern=TRUE)) character(0) > try(system("convert tmp/6ayme1350588919.ps tmp/6ayme1350588919.png",intern=TRUE)) character(0) > try(system("convert tmp/7hq0d1350588919.ps tmp/7hq0d1350588919.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.436 0.640 4.065