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(96.86,96.77,96.5,96.01,96.07,95.93,95.93,95.83,96.24,96.25,96.59,96.62,96.62,96.81,96.71,96.45,96.63,96.56,96.56,96.65,97.04,97.14,97.2,97.26,97.26,97.24,97.35,97.36,97.28,97.31,97.31,97.31,97.23,97.78,97.64,97.68,97.68,97.81,97.75,97.63,97.6,97.65,97.65,97.65,97.86,98.41,98.79,98.75,98.74,98.55,98.65,98.86,98.94,99.05,99.05,99.05,99.17,98.99,98.91,98.89,98.89,98.72,98.89,98.97,99.16,99.54,99.54,99.55,100.01,99.52,99.44,99.39,99.39,99.4,100.43,100.62,101.05,100.95,100.95,100.91,101.13,100.81,100.47,100.56) > 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,] 96.86 96.62 97.26 97.68 98.74 98.89 99.39 NA [2,] 96.77 96.81 97.24 97.81 98.55 98.72 99.40 NA [3,] 96.50 96.71 97.35 97.75 98.65 98.89 100.43 NA [4,] 96.01 96.45 97.36 97.63 98.86 98.97 100.62 NA [5,] 96.07 96.63 97.28 97.60 98.94 99.16 101.05 NA [6,] 95.93 96.56 97.31 97.65 99.05 99.54 100.95 NA [7,] 95.93 96.56 97.31 97.65 99.05 99.54 100.95 NA [8,] 95.83 96.65 97.31 97.65 99.05 99.55 100.91 NA [9,] 96.24 97.04 97.23 97.86 99.17 100.01 101.13 NA [10,] 96.25 97.14 97.78 98.41 98.99 99.52 100.81 NA [11,] 96.59 97.20 97.64 98.79 98.91 99.44 100.47 NA [12,] 96.62 97.26 97.68 98.75 98.89 99.39 100.56 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.09 0.19 -0.02 0.13 -0.19 -0.17 0.01 NA [2,] -0.27 -0.10 0.11 -0.06 0.10 0.17 1.03 NA [3,] -0.49 -0.26 0.01 -0.12 0.21 0.08 0.19 NA [4,] 0.06 0.18 -0.08 -0.03 0.08 0.19 0.43 NA [5,] -0.14 -0.07 0.03 0.05 0.11 0.38 -0.10 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -0.10 0.09 0.00 0.00 0.00 0.01 -0.04 NA [8,] 0.41 0.39 -0.08 0.21 0.12 0.46 0.22 NA [9,] 0.01 0.10 0.55 0.55 -0.18 -0.49 -0.32 NA [10,] 0.34 0.06 -0.14 0.38 -0.08 -0.08 -0.34 NA [11,] 0.03 0.06 0.04 -0.04 -0.02 -0.05 0.09 NA [12,] 0.00 0.00 0.00 -0.01 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/1qm7z1381737952.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/210651381737952.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/3ls9y1381737952.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/4yp8n1381737952.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] [1,] 96.620 96.770 96.50 96.010 96.070 95.930 95.930 95.83 96.240 [2,] 97.060 97.025 97.03 96.905 96.955 96.935 96.935 96.98 97.135 [3,] 97.680 97.810 97.75 97.630 97.600 97.650 97.650 97.65 97.860 [4,] 98.815 98.635 98.77 98.915 99.050 99.295 99.295 99.30 99.590 [5,] 99.390 99.400 100.43 100.620 101.050 100.950 100.950 100.91 101.130 [,10] [,11] [,12] [1,] 96.250 96.590 96.62 [2,] 97.460 97.420 97.47 [3,] 98.410 98.790 98.75 [4,] 99.255 99.175 99.14 [5,] 100.810 100.470 100.56 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.63194 96.84853 96.7109 96.42966 96.3489 96.24065 96.24065 96.26453 [2,] 98.72806 98.77147 98.7891 98.83034 98.8511 99.05935 99.05935 99.03547 [,9] [,10] [,11] [,12] [1,] 96.39391 97.33805 97.74194 97.7527 [2,] 99.32609 99.48195 99.83806 99.7473 $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(96.62, 97.06, 97.68, 98.815, 99.39, 96.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5737a1381737952.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.19 -0.27 -0.490 -0.080 -0.140 0 -0.040 -0.080 -0.490 -0.34 -0.05 [2,] -0.13 -0.08 -0.190 0.015 -0.085 0 -0.020 0.165 -0.250 -0.11 -0.03 [3,] -0.02 0.10 0.010 0.080 0.030 0 0.000 0.220 0.010 -0.08 0.03 [4,] 0.07 0.14 0.135 0.185 0.080 0 0.005 0.400 0.325 0.20 0.05 [5,] 0.19 0.17 0.210 0.430 0.110 0 0.010 0.460 0.550 0.38 0.09 [,12] [1,] 0 [2,] 0 [3,] 0 [4,] 0 [5,] 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.13943677 -0.03138045 -0.1840848 -0.02152126 -0.06853534 0 -0.0149296 [2,] 0.09943677 0.23138045 0.2040848 0.18152126 0.12853534 0 0.0149296 [,8] [,9] [,10] [,11] [,12] [1,] 0.07966179 -0.3333807 -0.265127 -0.01777471 0 [2,] 0.36033821 0.3533807 0.105127 0.07777471 0 $out [1] 1.03 0.38 -0.10 0.09 -0.01 $group [1] 2 5 7 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.189999999999998, -0.130000000000003, -0.0200000000000102, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fw7z1381737952.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,] 95.830 96.45 97.23 97.600 98.550 98.720 100.430 NA [2,] 95.970 96.59 97.27 97.650 98.800 98.930 100.450 NA [3,] 96.245 96.68 97.31 97.715 98.925 99.415 100.715 NA [4,] 96.605 97.09 97.50 98.135 99.050 99.540 100.950 NA [5,] 96.860 97.26 97.78 98.790 99.170 100.010 101.130 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.95537 96.45195 97.2051 97.49379 98.81097 99.13677 100.4869 NA [2,] 96.53463 96.90805 97.4149 97.93621 99.03903 99.69323 100.9431 NA $out [1] 99.39 99.40 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(95.83, 95.97, 96.245, 96.605, 96.86, 96.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/789001381737952.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,] 97.90000 97.600 97.83000 [2,] 98.01286 97.650 97.92375 [3,] 98.13857 97.715 98.11500 [4,] 98.39857 98.135 98.30125 [5,] 98.45000 98.790 98.36250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.96264 97.49379 97.94282 [2,] 98.31450 97.93621 98.28718 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.9, 98.0128571428571, 98.1385714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qm7z1381737952.ps tmp/1qm7z1381737952.png",intern=TRUE)) character(0) > try(system("convert tmp/210651381737952.ps tmp/210651381737952.png",intern=TRUE)) character(0) > try(system("convert tmp/3ls9y1381737952.ps tmp/3ls9y1381737952.png",intern=TRUE)) character(0) > try(system("convert tmp/4yp8n1381737952.ps tmp/4yp8n1381737952.png",intern=TRUE)) character(0) > try(system("convert tmp/5737a1381737952.ps tmp/5737a1381737952.png",intern=TRUE)) character(0) > try(system("convert tmp/6fw7z1381737952.ps tmp/6fw7z1381737952.png",intern=TRUE)) character(0) > try(system("convert tmp/789001381737952.ps tmp/789001381737952.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.004 1.085 6.056