R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(1.26,1.26,1.28,1.34,1.39,1.47,1.57,1.63,1.72,1.43,1.35,1.41,1.44,1.43,1.43,1.42,1.45,1.51,1.48,1.48,1.45,1.38,1.46,1.45,1.41,1.45,1.47,1.47,1.53,1.56,1.66,1.79,1.78,1.46,1.41,1.43,1.43,1.45,1.35,1.35,1.29,1.29,1.26,1.3,1.3,1.16,1.24,1.15,1.21,1.22,1.17,1.13,1.15,1.2,1.23,1.25,1.38,1.28,1.26,1.25,1.26,1.28,1.31,1.22,1.23,1.36,1.54,1.58,1.44,1.29,1.28,1.23) > 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,] 1.26 1.44 1.41 1.43 1.21 1.26 NA [2,] 1.26 1.43 1.45 1.45 1.22 1.28 NA [3,] 1.28 1.43 1.47 1.35 1.17 1.31 NA [4,] 1.34 1.42 1.47 1.35 1.13 1.22 NA [5,] 1.39 1.45 1.53 1.29 1.15 1.23 NA [6,] 1.47 1.51 1.56 1.29 1.20 1.36 NA [7,] 1.57 1.48 1.66 1.26 1.23 1.54 NA [8,] 1.63 1.48 1.79 1.30 1.25 1.58 NA [9,] 1.72 1.45 1.78 1.30 1.38 1.44 NA [10,] 1.43 1.38 1.46 1.16 1.28 1.29 NA [11,] 1.35 1.46 1.41 1.24 1.26 1.28 NA [12,] 1.41 1.45 1.43 1.15 1.25 1.23 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 -0.01 0.04 0.02 0.01 0.02 NA [2,] 0.02 0.00 0.02 -0.10 -0.05 0.03 NA [3,] 0.06 -0.01 0.00 0.00 -0.04 -0.09 NA [4,] 0.05 0.03 0.06 -0.06 0.02 0.01 NA [5,] 0.08 0.06 0.03 0.00 0.05 0.13 NA [6,] 0.10 -0.03 0.10 -0.03 0.03 0.18 NA [7,] 0.06 0.00 0.13 0.04 0.02 0.04 NA [8,] 0.09 -0.03 -0.01 0.00 0.13 -0.14 NA [9,] -0.29 -0.07 -0.32 -0.14 -0.10 -0.15 NA [10,] -0.08 0.08 -0.05 0.08 -0.02 -0.01 NA [11,] 0.06 -0.01 0.02 -0.09 -0.01 -0.05 NA [12,] 0.03 -0.04 0.00 0.06 0.01 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/1wdnl1363110948.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/2q81e1363110948.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/3q4xr1363110948.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/4ymci1363110948.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,] 1.210 1.220 1.17 1.130 1.15 1.200 1.23 1.25 1.300 1.160 1.240 1.15 [2,] 1.260 1.260 1.28 1.220 1.23 1.290 1.26 1.30 1.380 1.280 1.260 1.23 [3,] 1.335 1.355 1.33 1.345 1.34 1.415 1.51 1.53 1.445 1.335 1.315 1.33 [4,] 1.430 1.450 1.43 1.420 1.45 1.510 1.57 1.63 1.720 1.430 1.410 1.43 [5,] 1.440 1.450 1.47 1.470 1.53 1.560 1.66 1.79 1.780 1.460 1.460 1.45 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.225345 1.232444 1.233245 1.215994 1.198093 1.273093 1.31004 1.317139 [2,] 1.444655 1.477556 1.426755 1.474006 1.481907 1.556907 1.70996 1.742861 [,9] [,10] [,11] [,12] [1,] 1.225689 1.238245 1.218245 1.200994 [2,] 1.664311 1.431755 1.411755 1.459006 $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(1.21, 1.26, 1.335, 1.43, 1.44, 1.22, 1.26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5wmbp1363110948.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.010 -0.10 -0.090 0.010 0.000 -0.030 0.00 -0.140 -0.320 -0.080 -0.09 [2,] 0.000 -0.05 -0.040 0.010 0.030 -0.030 0.02 -0.030 -0.290 -0.050 -0.05 [3,] 0.015 0.01 -0.005 0.025 0.055 0.065 0.04 -0.005 -0.145 -0.015 -0.01 [4,] 0.020 0.02 0.000 0.050 0.080 0.100 0.06 0.090 -0.100 0.080 0.02 [5,] 0.040 0.03 0.060 0.060 0.130 0.180 0.06 0.130 -0.070 0.080 0.06 [,12] [1,] -0.04 [2,] 0.00 [3,] 0.01 [4,] 0.03 [5,] 0.06 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.002099354 -0.03515226 -0.03080129 -0.000801292 0.02274839 -0.0188542 [2,] 0.027900646 0.05515226 0.02080129 0.050801292 0.08725161 0.1488542 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.01419871 -0.08240388 -0.26755614 -0.0988542 -0.05515226 -0.01119792 [2,] 0.06580129 0.07240388 -0.02244386 0.0688542 0.03515226 0.03119792 $out [1] -0.06 0.13 $group [1] 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, 0, 0.015, 0.02, 0.04, -0.0999999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6s8os1363110948.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,] 1.26 1.38 1.41 1.150 1.130 1.220 NA [2,] 1.31 1.43 1.44 1.250 1.185 1.245 NA [3,] 1.40 1.45 1.47 1.295 1.225 1.285 NA [4,] 1.52 1.47 1.61 1.350 1.255 1.400 NA [5,] 1.72 1.51 1.79 1.450 1.280 1.580 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.304218 1.431756 1.392462 1.249389 1.193073 1.214303 NA [2,] 1.495782 1.468244 1.547538 1.340611 1.256927 1.355697 NA $out [1] 1.38 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.26, 1.31, 1.4, 1.52, 1.72, 1.38, 1.43, 1.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7gfx31363110948.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,] 1.320000 1.3150 1.326250 [2,] 1.333333 1.3325 1.335000 [3,] 1.337500 1.3425 1.349375 [4,] 1.427500 1.4300 1.421250 [5,] 1.511667 1.5300 1.523750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.29455 1.29803 1.310036 [2,] 1.38045 1.38697 1.388714 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.32, 1.33333333333333, 1.3375, 1.4275, 1.51166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wdnl1363110948.ps tmp/1wdnl1363110948.png",intern=TRUE)) character(0) > try(system("convert tmp/2q81e1363110948.ps tmp/2q81e1363110948.png",intern=TRUE)) character(0) > try(system("convert tmp/3q4xr1363110948.ps tmp/3q4xr1363110948.png",intern=TRUE)) character(0) > try(system("convert tmp/4ymci1363110948.ps tmp/4ymci1363110948.png",intern=TRUE)) character(0) > try(system("convert tmp/5wmbp1363110948.ps tmp/5wmbp1363110948.png",intern=TRUE)) character(0) > try(system("convert tmp/6s8os1363110948.ps tmp/6s8os1363110948.png",intern=TRUE)) character(0) > try(system("convert tmp/7gfx31363110948.ps tmp/7gfx31363110948.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.519 0.524 4.041