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(7.52,7.71,7.61,7.56,7.6,7.62,7.62,7.54,7.49,7.45,7.46,7.37,7.43,7.63,7.6,7.55,7.59,7.59,7.59,7.51,7.5,7.46,7.51,7.53,7.57,7.61,7.83,7.86,7.86,7.85,7.85,7.72,7.76,7.9,7.88,7.99,7.99,8.09,7.94,7.92,8.06,8.09,8.08,7.96,7.85,7.91,8.05,8.09,8.1,8.22,8.18,8.25,8.33,8.25,8.22,8.17,8.18,8.18,8.09,8.05,8.07,8.16,8.09,8.03,8.1,8.12,8.12,8.12,8.14,8.12,8.14,8.19,8.23,8.23,8.28,8.31,8.43,8.39,8.39,8.4,8.39,8.43,8.38,8.61) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.52 7.43 7.57 7.99 8.10 8.07 8.23 NA [2,] 7.71 7.63 7.61 8.09 8.22 8.16 8.23 NA [3,] 7.61 7.60 7.83 7.94 8.18 8.09 8.28 NA [4,] 7.56 7.55 7.86 7.92 8.25 8.03 8.31 NA [5,] 7.60 7.59 7.86 8.06 8.33 8.10 8.43 NA [6,] 7.62 7.59 7.85 8.09 8.25 8.12 8.39 NA [7,] 7.62 7.59 7.85 8.08 8.22 8.12 8.39 NA [8,] 7.54 7.51 7.72 7.96 8.17 8.12 8.40 NA [9,] 7.49 7.50 7.76 7.85 8.18 8.14 8.39 NA [10,] 7.45 7.46 7.90 7.91 8.18 8.12 8.43 NA [11,] 7.46 7.51 7.88 8.05 8.09 8.14 8.38 NA [12,] 7.37 7.53 7.99 8.09 8.05 8.19 8.61 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.19 0.20 0.04 0.10 0.12 0.09 0.00 NA [2,] -0.10 -0.03 0.22 -0.15 -0.04 -0.07 0.05 NA [3,] -0.05 -0.05 0.03 -0.02 0.07 -0.06 0.03 NA [4,] 0.04 0.04 0.00 0.14 0.08 0.07 0.12 NA [5,] 0.02 0.00 -0.01 0.03 -0.08 0.02 -0.04 NA [6,] 0.00 0.00 0.00 -0.01 -0.03 0.00 0.00 NA [7,] -0.08 -0.08 -0.13 -0.12 -0.05 0.00 0.01 NA [8,] -0.05 -0.01 0.04 -0.11 0.01 0.02 -0.01 NA [9,] -0.04 -0.04 0.14 0.06 0.00 -0.02 0.04 NA [10,] 0.01 0.05 -0.02 0.14 -0.09 0.02 -0.05 NA [11,] -0.09 0.02 0.11 0.04 -0.04 0.05 0.23 NA [12,] 0.06 0.04 0.00 0.01 0.02 0.04 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/1bd341381925765.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/2ll5l1381925765.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/3pdzl1381925765.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/4tsav1381925765.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.430 7.61 7.600 7.55 7.590 7.590 7.590 7.510 7.49 7.45 7.460 7.37 [2,] 7.545 7.67 7.720 7.71 7.730 7.735 7.735 7.630 7.63 7.68 7.695 7.76 [3,] 7.990 8.09 7.940 7.92 8.060 8.090 8.080 7.960 7.85 7.91 8.050 8.05 [4,] 8.085 8.19 8.135 8.14 8.215 8.185 8.170 8.145 8.16 8.15 8.115 8.14 [5,] 8.230 8.23 8.280 8.31 8.430 8.390 8.390 8.400 8.39 8.43 8.380 8.61 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.667521 7.779464 7.692169 7.663211 7.770366 7.821267 7.820225 7.65245 [2,] 8.312479 8.400536 8.187831 8.176789 8.349634 8.358733 8.339775 8.26755 [,9] [,10] [,11] [,12] [1,] 7.533493 7.629324 7.799183 7.82307 [2,] 8.166507 8.190676 8.300817 8.27693 $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.43, 7.545, 7.99, 8.085, 8.23, 7.61, 7.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pdq71381925765.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.000 -0.150 -0.06 0.00 -0.080 -0.010 -0.130 -0.050 -0.04 -0.090 -0.09 [2,] 0.065 -0.085 -0.05 0.04 -0.025 -0.005 -0.100 -0.030 -0.03 -0.035 -0.01 [3,] 0.100 -0.040 -0.02 0.07 0.000 0.000 -0.080 -0.010 0.00 0.010 0.04 [4,] 0.155 0.010 0.03 0.10 0.020 0.000 -0.025 0.015 0.05 0.035 0.08 [5,] 0.200 0.050 0.07 0.14 0.030 0.000 0.010 0.040 0.14 0.140 0.11 [,12] [1,] 0.00 [2,] 0.01 [3,] 0.03 [4,] 0.04 [5,] 0.06 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.04625345 -0.09673247 -0.06777471 0.03416897 -0.02687327 -0.002985919 [2,] 0.15374655 0.01673247 0.02777471 0.10583103 0.02687327 0.002985919 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.12478879 -0.03687327 -0.04777471 -0.03180287 -0.01374655 0.01064903 [2,] -0.03521121 0.01687327 0.04777471 0.05180287 0.09374655 0.04935097 $out [1] 0.22 -0.03 -0.11 0.23 $group [1] 2 6 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0649999999999999, 0.0999999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6h5ax1381925765.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] [,8] [1,] 7.370 7.430 7.57 7.850 8.050 8.030 8.230 NA [2,] 7.475 7.505 7.74 7.930 8.135 8.095 8.295 NA [3,] 7.550 7.540 7.85 8.020 8.180 8.120 8.390 NA [4,] 7.615 7.590 7.87 8.085 8.235 8.140 8.415 NA [5,] 7.710 7.630 7.99 8.090 8.330 8.190 8.430 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.486145 7.501231 7.790706 7.949303 8.134389 8.099475 8.335267 NA [2,] 7.613855 7.578769 7.909294 8.090697 8.225611 8.140525 8.444733 NA $out [1] 8.61 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(7.37, 7.475, 7.55, 7.615, 7.71, 7.43, 7.505, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7rd1i1381925765.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.844286 7.85 7.88750 [2,] 7.919286 7.93 7.90000 [3,] 7.931429 8.02 7.92625 [4,] 7.978571 8.07 7.95125 [5,] 7.995714 8.09 7.97250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.904388 7.956145 7.902875 [2,] 7.958469 8.083855 7.949625 $out [1] 7.815 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7.84428571428571, 7.91928571428571, 7.93142857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bd341381925765.ps tmp/1bd341381925765.png",intern=TRUE)) character(0) > try(system("convert tmp/2ll5l1381925765.ps tmp/2ll5l1381925765.png",intern=TRUE)) character(0) > try(system("convert tmp/3pdzl1381925765.ps tmp/3pdzl1381925765.png",intern=TRUE)) character(0) > try(system("convert tmp/4tsav1381925765.ps tmp/4tsav1381925765.png",intern=TRUE)) character(0) > try(system("convert tmp/5pdq71381925765.ps tmp/5pdq71381925765.png",intern=TRUE)) character(0) > try(system("convert tmp/6h5ax1381925765.ps tmp/6h5ax1381925765.png",intern=TRUE)) character(0) > try(system("convert tmp/7rd1i1381925765.ps tmp/7rd1i1381925765.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.116 1.020 6.110