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(163.93,164.28,164.58,165.97,166.3,166.27,166.27,166.44,166.26,166.64,166.07,166.19,166.19,166.19,166.35,166.52,167.17,167.16,167.16,167.16,167.39,168.46,168.55,168.58,168.58,169.21,169.29,169.24,169.53,169.57,169.57,169.67,170.04,170.39,170.57,170.48,170.48,170.48,170.49,170.72,171.11,171.07,171.07,171.07,171.05,172.28,172.74,172.86,172.86,173.24,173.2,173.38,172.89,172.98,172.98,172.69,172.77,172.65,172.3,172.17,172.17,173.07,173.27,173.05,173.41,173.37,173.37,173.08,173.97,175.23,174.9,174.83) > 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,] 163.93 166.19 168.58 170.48 172.86 172.17 NA [2,] 164.28 166.19 169.21 170.48 173.24 173.07 NA [3,] 164.58 166.35 169.29 170.49 173.20 173.27 NA [4,] 165.97 166.52 169.24 170.72 173.38 173.05 NA [5,] 166.30 167.17 169.53 171.11 172.89 173.41 NA [6,] 166.27 167.16 169.57 171.07 172.98 173.37 NA [7,] 166.27 167.16 169.57 171.07 172.98 173.37 NA [8,] 166.44 167.16 169.67 171.07 172.69 173.08 NA [9,] 166.26 167.39 170.04 171.05 172.77 173.97 NA [10,] 166.64 168.46 170.39 172.28 172.65 175.23 NA [11,] 166.07 168.55 170.57 172.74 172.30 174.90 NA [12,] 166.19 168.58 170.48 172.86 172.17 174.83 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.35 0.00 0.63 0.00 0.38 0.90 NA [2,] 0.30 0.16 0.08 0.01 -0.04 0.20 NA [3,] 1.39 0.17 -0.05 0.23 0.18 -0.22 NA [4,] 0.33 0.65 0.29 0.39 -0.49 0.36 NA [5,] -0.03 -0.01 0.04 -0.04 0.09 -0.04 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.17 0.00 0.10 0.00 -0.29 -0.29 NA [8,] -0.18 0.23 0.37 -0.02 0.08 0.89 NA [9,] 0.38 1.07 0.35 1.23 -0.12 1.26 NA [10,] -0.57 0.09 0.18 0.46 -0.35 -0.33 NA [11,] 0.12 0.03 -0.09 0.12 -0.13 -0.07 NA [12,] 0.00 0.00 0.00 0.00 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/1hgtn1363123074.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/2pkt21363123074.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/3zmp51363123074.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/4svrk1363123074.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] [1,] 163.93 164.280 164.58 165.97 166.30 166.27 166.27 166.44 166.260 166.640 [2,] 166.19 166.190 166.35 166.52 167.17 167.16 167.16 167.16 167.390 168.460 [3,] 169.53 169.845 169.89 169.98 170.32 170.32 170.32 170.37 170.545 171.335 [4,] 172.17 173.070 173.20 173.05 172.89 172.98 172.98 172.69 172.770 172.650 [5,] 172.86 173.240 173.27 173.38 173.41 173.37 173.37 173.08 173.970 175.230 [,11] [,12] [1,] 166.070 166.190 [2,] 168.550 168.580 [3,] 171.435 171.325 [4,] 172.740 172.860 [5,] 174.900 174.830 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 165.6727 165.4072 165.4715 165.7679 166.6304 166.5659 166.5659 166.803 [2,] 173.3873 174.2828 174.3085 174.1921 174.0096 174.0741 174.0741 173.937 [,9] [,10] [,11] [,12] [1,] 167.0747 168.6323 168.7323 168.5643 [2,] 174.0153 174.0377 174.1377 174.0857 $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(163.93, 166.19, 169.53, 172.17, 172.86, 164.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vi061363123074.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.000 -0.04 -0.220 0.290 -0.04 0 -0.29 -0.180 -0.120 -0.57 -0.13 0 [2,] 0.000 0.01 -0.050 0.290 -0.04 0 -0.29 -0.020 0.350 -0.35 -0.09 0 [3,] 0.365 0.12 0.175 0.345 -0.02 0 0.00 0.155 0.725 -0.12 -0.02 0 [4,] 0.630 0.20 0.230 0.390 0.04 0 0.10 0.370 1.230 0.18 0.12 0 [5,] 0.900 0.30 0.230 0.390 0.09 0 0.17 0.890 1.260 0.46 0.12 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.04137035 -0.002556137 -0.005609044 0.2804968 -0.07160258 0 [2,] 0.77137035 0.242556137 0.355609044 0.4095032 0.03160258 0 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.2515626 -0.0965626 0.1573716 -0.4618671 -0.1554568 0 [2,] 0.2515626 0.4065626 1.2926284 0.2218671 0.1154568 0 $out [1] 1.39 0.65 -0.49 $group [1] 3 4 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.364999999999995, 0.629999999999995, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63mf91363123074.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,] 163.930 166.190 168.580 170.480 172.170 172.170 NA [2,] 165.275 166.435 169.265 170.605 172.670 173.075 NA [3,] 166.225 167.160 169.570 171.070 172.875 173.370 NA [4,] 166.285 167.925 170.215 171.695 173.090 174.400 NA [5,] 166.640 168.580 170.570 172.860 173.380 175.230 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 165.7643 166.4804 169.1367 170.5728 172.6834 172.7657 NA [2,] 166.6857 167.8396 170.0033 171.5672 173.0666 173.9743 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(163.93, 165.275, 166.225, 166.285, 166.64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7cj0j1363123074.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,] 169.0350 169.530 169.2675 [2,] 169.6717 169.935 169.8187 [3,] 170.0692 170.320 170.1175 [4,] 170.5492 170.935 170.4731 [5,] 170.9417 171.435 170.8713 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 169.6689 169.8639 169.819 [2,] 170.4694 170.7761 170.416 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(169.035, 169.671666666667, 170.069166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hgtn1363123074.ps tmp/1hgtn1363123074.png",intern=TRUE)) character(0) > try(system("convert tmp/2pkt21363123074.ps tmp/2pkt21363123074.png",intern=TRUE)) character(0) > try(system("convert tmp/3zmp51363123074.ps tmp/3zmp51363123074.png",intern=TRUE)) character(0) > try(system("convert tmp/4svrk1363123074.ps tmp/4svrk1363123074.png",intern=TRUE)) character(0) > try(system("convert tmp/5vi061363123074.ps tmp/5vi061363123074.png",intern=TRUE)) character(0) > try(system("convert tmp/63mf91363123074.ps tmp/63mf91363123074.png",intern=TRUE)) character(0) > try(system("convert tmp/7cj0j1363123074.ps tmp/7cj0j1363123074.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.649 0.518 4.156