R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(0.978,0.973,0.96,0.978,0.985,1.035,1.015,1.05,1.022,1.042,1.058,1.056,1.013,1.098,1.097,1.139,1.182,1.189,1.191,1.168,1.168,1.177,1.184,1.2,1.251,1.171,1.288,1.313,1.363,1.377,1.342,1.334,1.348,1.327,1.349,1.361,1.393,1.38,1.348,1.421,1.432,1.457,1.453,1.428,1.383,1.408,1.458,1.474,1.491,1.476,1.446,1.444,1.451,1.472,1.449,1.415,1.39,1.394,1.418,1.426,1.437,1.406,1.387,1.404,1.421) > 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] 65 > (np <- floor(n / par1)) [1] 5 > 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 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.978 1.013 1.251 1.393 1.491 1.437 [2,] 0.973 1.098 1.171 1.380 1.476 1.406 [3,] 0.960 1.097 1.288 1.348 1.446 1.387 [4,] 0.978 1.139 1.313 1.421 1.444 1.404 [5,] 0.985 1.182 1.363 1.432 1.451 1.421 [6,] 1.035 1.189 1.377 1.457 1.472 NA [7,] 1.015 1.191 1.342 1.453 1.449 NA [8,] 1.050 1.168 1.334 1.428 1.415 NA [9,] 1.022 1.168 1.348 1.383 1.390 NA [10,] 1.042 1.177 1.327 1.408 1.394 NA [11,] 1.058 1.184 1.349 1.458 1.418 NA [12,] 1.056 1.200 1.361 1.474 1.426 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.005 0.085 -0.080 -0.013 -0.015 -0.031 [2,] -0.013 -0.001 0.117 -0.032 -0.030 -0.019 [3,] 0.018 0.042 0.025 0.073 -0.002 0.017 [4,] 0.007 0.043 0.050 0.011 0.007 0.017 [5,] 0.050 0.007 0.014 0.025 0.021 NA [6,] -0.020 0.002 -0.035 -0.004 -0.023 NA [7,] 0.035 -0.023 -0.008 -0.025 -0.034 NA [8,] -0.028 0.000 0.014 -0.045 -0.025 NA [9,] 0.020 0.009 -0.021 0.025 0.004 NA [10,] 0.016 0.007 0.022 0.050 0.024 NA [11,] -0.002 0.016 0.012 0.016 0.008 NA [12,] -0.043 0.051 0.032 0.017 0.011 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/1ic5y1393506221.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/2ydyc1393506221.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/3gbi01393506221.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/4ekev1393506221.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,] 0.978 0.9730 0.960 0.9780 0.985 1.035 1.015 1.050 1.022 1.042 1.058 1.056 [2,] 1.013 1.0980 1.097 1.1390 1.182 1.189 1.191 1.168 1.168 1.177 1.184 1.200 [3,] 1.322 1.2755 1.318 1.3585 1.392 1.377 1.342 1.334 1.348 1.327 1.349 1.361 [4,] 1.437 1.4060 1.387 1.4210 1.432 1.457 1.449 1.415 1.383 1.394 1.418 1.426 [5,] 1.491 1.4760 1.446 1.4440 1.451 1.472 1.453 1.428 1.390 1.408 1.458 1.474 $n [1] 6 6 6 6 6 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.048506 1.07683 1.130941 1.176601 1.230742 1.187632 1.159698 1.15947 [2,] 1.595494 1.47417 1.505059 1.540399 1.553258 1.566368 1.524302 1.50853 [,9] [,10] [,11] [,12] [1,] 1.196082 1.173668 1.183656 1.201309 [2,] 1.499918 1.480332 1.514344 1.520691 $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(0.978, 1.013, 1.322, 1.437, 1.491, 0.973, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ahvz1393506221.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.031 -0.032 -0.0020 0.007 0.007 -0.035 -0.034 -0.045 0.004 0.007 -0.002 [2,] -0.031 -0.030 0.0170 0.007 0.014 -0.023 -0.025 -0.028 0.004 0.016 0.008 [3,] -0.014 -0.016 0.0215 0.014 0.021 -0.020 -0.023 -0.025 0.009 0.022 0.012 [4,] -0.005 -0.001 0.0420 0.043 0.025 -0.004 -0.008 0.000 0.020 0.024 0.016 [5,] -0.005 -0.001 0.0730 0.050 0.025 0.002 -0.008 0.014 0.025 0.024 0.016 [,12] [1,] 0.011 [2,] 0.011 [3,] 0.017 [4,] 0.032 [5,] 0.051 $n [1] 6 6 6 6 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.03077084 -0.034705937 0.005374193 -0.009221163 0.01322743 -0.033425352 [2,] 0.00277084 0.002705937 0.037625807 0.037221163 0.02877257 -0.006574648 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.03501216 -0.044784729 -0.00230556 0.01634722 0.00634722 0.002161453 [2,] -0.01098784 -0.005215271 0.02030556 0.02765278 0.01765278 0.031838547 $out [1] 0.085 -0.080 0.117 0.050 0.035 -0.021 0.050 -0.043 $group [1] 1 1 2 5 7 9 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0310000000000001, -0.0310000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67oq91393506221.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] [1,] 0.9600 1.0970 1.2510 1.3480 1.3900 1.387 [2,] 0.9780 1.1185 1.3005 1.3880 1.4165 1.404 [3,] 1.0185 1.1725 1.3380 1.4245 1.4450 1.406 [4,] 1.0460 1.1865 1.3550 1.4550 1.4615 1.421 [5,] 1.0580 1.2000 1.3770 1.4740 1.4910 1.437 $n [1] 12 12 12 12 12 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.9874847 1.141485 1.313142 1.393941 1.424475 1.393988 [2,] 1.0495153 1.203515 1.362858 1.455059 1.465525 1.418012 $out [1] 1.013 1.171 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(0.96, 0.978, 1.0185, 1.046, 1.058, 1.097, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7gh1s1393506221.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.250667 1.27550 1.249250 [2,] 1.261350 1.32450 1.268250 [3,] 1.281083 1.34500 1.295562 [4,] 1.298400 1.35975 1.316500 [5,] 1.306000 1.39200 1.328250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.264185 1.328922 1.273555 [2,] 1.297982 1.361078 1.317570 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.25066666666667, 1.26135, 1.28108333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ic5y1393506221.ps tmp/1ic5y1393506221.png",intern=TRUE)) character(0) > try(system("convert tmp/2ydyc1393506221.ps tmp/2ydyc1393506221.png",intern=TRUE)) character(0) > try(system("convert tmp/3gbi01393506221.ps tmp/3gbi01393506221.png",intern=TRUE)) character(0) > try(system("convert tmp/4ekev1393506221.ps tmp/4ekev1393506221.png",intern=TRUE)) character(0) > try(system("convert tmp/5ahvz1393506221.ps tmp/5ahvz1393506221.png",intern=TRUE)) character(0) > try(system("convert tmp/67oq91393506221.ps tmp/67oq91393506221.png",intern=TRUE)) character(0) > try(system("convert tmp/7gh1s1393506221.ps tmp/7gh1s1393506221.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.555 0.906 5.489