R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(7.3,7.1,6.8,6.4,6.1,6.5,7.7,7.9,7.5,6.9,6.6,6.9,7.7,8,8,7.7,7.3,7.4,8.1,8.3,8.1,7.9,7.9,8.3,8.6,8.7,8.5,8.3,8,8,8.8,8.7,8.5,8.1,7.8,7.7,7.5,7.2,6.9,6.6,6.5,6.6,7.7,8,7.7,7.3,7,7,7.3,7.3,7.1,7.1,7,7,7.5,7.8,7.9,8.1,8.3,8.4,8.6,8.5,8.4,8.3,8,8,8.7,8.7,8.6,8.5,8.5,8.6) > 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,] 7.3 7.7 8.6 7.5 7.3 8.6 NA [2,] 7.1 8.0 8.7 7.2 7.3 8.5 NA [3,] 6.8 8.0 8.5 6.9 7.1 8.4 NA [4,] 6.4 7.7 8.3 6.6 7.1 8.3 NA [5,] 6.1 7.3 8.0 6.5 7.0 8.0 NA [6,] 6.5 7.4 8.0 6.6 7.0 8.0 NA [7,] 7.7 8.1 8.8 7.7 7.5 8.7 NA [8,] 7.9 8.3 8.7 8.0 7.8 8.7 NA [9,] 7.5 8.1 8.5 7.7 7.9 8.6 NA [10,] 6.9 7.9 8.1 7.3 8.1 8.5 NA [11,] 6.6 7.9 7.8 7.0 8.3 8.5 NA [12,] 6.9 8.3 7.7 7.0 8.4 8.6 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.2 0.3 0.1 -0.3 0.0 -0.1 NA [2,] -0.3 0.0 -0.2 -0.3 -0.2 -0.1 NA [3,] -0.4 -0.3 -0.2 -0.3 0.0 -0.1 NA [4,] -0.3 -0.4 -0.3 -0.1 -0.1 -0.3 NA [5,] 0.4 0.1 0.0 0.1 0.0 0.0 NA [6,] 1.2 0.7 0.8 1.1 0.5 0.7 NA [7,] 0.2 0.2 -0.1 0.3 0.3 0.0 NA [8,] -0.4 -0.2 -0.2 -0.3 0.1 -0.1 NA [9,] -0.6 -0.2 -0.4 -0.4 0.2 -0.1 NA [10,] -0.3 0.0 -0.3 -0.3 0.2 0.0 NA [11,] 0.3 0.4 -0.1 0.0 0.1 0.1 NA [12,] 0.8 0.3 -0.2 0.3 0.2 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/1fucb1413147084.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/20nc01413147084.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/3n59o1413147084.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/4xmdq1413147084.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,] 7.3 7.10 6.80 6.4 6.10 6.5 7.5 7.80 7.5 6.9 6.60 6.9 [2,] 7.3 7.20 6.90 6.6 6.50 6.6 7.7 7.90 7.7 7.3 7.00 7.0 [3,] 7.6 7.65 7.55 7.4 7.15 7.2 7.9 8.15 8.0 8.0 7.85 8.0 [4,] 8.6 8.50 8.40 8.3 8.00 8.0 8.7 8.70 8.5 8.1 8.30 8.4 [5,] 8.6 8.70 8.50 8.3 8.00 8.0 8.8 8.70 8.6 8.5 8.50 8.6 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6.761458 6.811458 6.582452 6.303445 6.182452 6.296955 7.254968 7.633974 [2,] 8.438542 8.488542 8.517548 8.496555 8.117548 8.103045 8.545032 8.666026 [,9] [,10] [,11] [,12] [1,] 7.483974 7.483974 7.011458 7.096955 [2,] 8.516026 8.516026 8.688542 8.903045 $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(7.3, 7.3, 7.6, 8.6, 8.6, 7.1, 7.2, 7.65, 8.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cih91413147084.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.30 -0.3 -0.40 -0.4 0.00 0.50 -0.1 -0.4 -0.6 -0.30 -0.1 0.2 [2,] -0.20 -0.3 -0.30 -0.3 0.00 0.70 0.0 -0.3 -0.4 -0.30 0.0 0.2 [3,] -0.05 -0.2 -0.25 -0.3 0.05 0.75 0.2 -0.2 -0.3 -0.15 0.1 0.3 [4,] 0.10 -0.1 -0.10 -0.1 0.10 1.10 0.3 -0.1 -0.1 0.00 0.3 0.3 [5,] 0.30 0.0 0.00 -0.1 0.10 1.20 0.3 0.1 0.2 0.20 0.4 0.3 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.2435097 -0.32900646 -0.3790065 -0.4290065 -0.01450323 0.4919871 [2,] 0.1435097 -0.07099354 -0.1209935 -0.1709935 0.11450323 1.0080129 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.00649031 -0.32900646 -0.4935097 -0.34350969 -0.09350969 0.2293403 [2,] 0.39350969 -0.07099354 -0.1064903 0.04350969 0.29350969 0.3706597 $out [1] 0.4 0.8 -0.2 $group [1] 5 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.3, -0.2, -0.0499999999999998, 0.0999999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ofb21413147084.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,] 6.10 7.30 7.70 6.50 7.0 8.00 NA [2,] 6.55 7.70 8.00 6.75 7.1 8.35 NA [3,] 6.90 7.95 8.40 7.10 7.4 8.50 NA [4,] 7.40 8.10 8.65 7.60 8.0 8.60 NA [5,] 7.90 8.30 8.80 8.00 8.4 8.70 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6.512309 7.767557 8.103531 6.712309 6.989504 8.385973 NA [2,] 7.287691 8.132443 8.696469 7.487691 7.810496 8.614027 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(6.1, 6.55, 6.9, 7.4, 7.9, 7.3, 7.7, 7.95, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70v5v1413147084.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,] 7.150000 7.150 7.22500 [2,] 7.508333 7.475 7.53125 [3,] 7.800000 7.750 7.77500 [4,] 7.941667 8.000 7.96875 [5,] 8.233333 8.150 8.26250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.602354 7.510544 7.575453 [2,] 7.997646 7.989456 7.974547 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7.15, 7.50833333333333, 7.8, 7.94166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fucb1413147084.ps tmp/1fucb1413147084.png",intern=TRUE)) character(0) > try(system("convert tmp/20nc01413147084.ps tmp/20nc01413147084.png",intern=TRUE)) character(0) > try(system("convert tmp/3n59o1413147084.ps tmp/3n59o1413147084.png",intern=TRUE)) character(0) > try(system("convert tmp/4xmdq1413147084.ps tmp/4xmdq1413147084.png",intern=TRUE)) character(0) > try(system("convert tmp/5cih91413147084.ps tmp/5cih91413147084.png",intern=TRUE)) character(0) > try(system("convert tmp/6ofb21413147084.ps tmp/6ofb21413147084.png",intern=TRUE)) character(0) > try(system("convert tmp/70v5v1413147084.ps tmp/70v5v1413147084.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.402 0.389 2.825