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(1029.98,1013.08,1013.08,996.04,975.02,951.89,944.4,932.47,932.47,920.44,900.18,886.9,869.74,859.03,859.03,844.99,834.82,825.62,816.92,813.21,813.21,811.03,804.16,788.62,778.76,765.91,765.91,753.85,742.22,732.11,729.94,731.22,731.22,729.11,726.94,720.52,709.36,703.21) > 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] 38 > (np <- floor(n / par1)) [1] 3 > 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] 4 4 3 3 3 3 3 3 3 3 3 3 > arr [,1] [,2] [,3] [,4] [1,] 1029.98 869.74 778.76 709.36 [2,] 1013.08 859.03 765.91 703.21 [3,] 1013.08 859.03 765.91 NA [4,] 996.04 844.99 753.85 NA [5,] 975.02 834.82 742.22 NA [6,] 951.89 825.62 732.11 NA [7,] 944.40 816.92 729.94 NA [8,] 932.47 813.21 731.22 NA [9,] 932.47 813.21 731.22 NA [10,] 920.44 811.03 729.11 NA [11,] 900.18 804.16 726.94 NA [12,] 886.90 788.62 720.52 NA > darr [,1] [,2] [,3] [,4] [1,] -16.90 -10.71 -12.85 -6.15 [2,] 0.00 0.00 0.00 NA [3,] -17.04 -14.04 -12.06 NA [4,] -21.02 -10.17 -11.63 NA [5,] -23.13 -9.20 -10.11 NA [6,] -7.49 -8.70 -2.17 NA [7,] -11.93 -3.71 1.28 NA [8,] 0.00 0.00 0.00 NA [9,] -12.03 -2.18 -2.11 NA [10,] -20.26 -6.87 -2.17 NA [11,] -13.28 -15.54 -6.42 NA [12,] -17.16 -9.86 -11.16 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/1w7sv1393867680.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/2gukf1393867680.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/3nw9b1393867680.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/4h4xs1393867680.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,] 709.36 703.210 765.910 753.850 742.22 732.110 729.94 731.220 731.220 [2,] 744.06 734.560 812.470 799.420 788.52 778.865 773.43 772.215 772.215 [3,] 824.25 812.470 859.030 844.990 834.82 825.620 816.92 813.210 813.210 [4,] 949.86 936.055 936.055 920.515 904.92 888.755 880.66 872.840 872.840 [5,] 1029.98 1013.080 1013.080 996.040 975.02 951.890 944.40 932.470 932.470 [,10] [,11] [,12] [1,] 729.110 726.94 720.52 [2,] 770.070 765.55 754.57 [3,] 811.030 804.16 788.62 [4,] 865.735 852.17 837.76 [5,] 920.440 900.18 886.90 $n [1] 4 4 3 3 3 3 3 3 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 661.668 653.2889 746.2941 734.5255 728.6384 725.3769 719.1034 721.4185 [2,] 986.832 971.6511 971.7659 955.4545 941.0016 925.8631 914.7366 905.0015 [,9] [,10] [,11] [,12] [1,] 721.4185 723.7631 725.1441 712.733 [2,] 905.0015 898.2969 883.1759 864.507 $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(709.36, 744.06, 824.25, 949.86, 1029.98, 703.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cjoo1393867680.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] [1,] -16.900 0 -17.04 -21.020 -23.130 -8.700 -11.930 0 -12.030 -20.260 [2,] -14.875 0 -15.54 -16.325 -16.620 -8.095 -7.820 0 -7.105 -13.565 [3,] -11.780 0 -14.04 -11.630 -10.110 -7.490 -3.710 0 -2.180 -6.870 [4,] -8.430 0 -13.05 -10.900 -9.655 -4.830 -1.215 0 -2.145 -4.520 [5,] -6.150 0 -12.06 -10.170 -9.200 -2.170 1.280 0 -2.110 -2.170 [,11] [,12] [1,] -15.54 -17.16 [2,] -14.41 -14.16 [3,] -13.28 -11.16 [4,] -9.85 -10.51 [5,] -6.42 -9.86 $n [1] 4 3 3 3 3 3 3 3 3 3 3 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -16.87155 0 -16.31141 -16.578758 -16.463567 -10.468377 -9.73517 0 [2,] -6.68845 0 -11.76859 -6.681242 -3.756433 -4.511623 2.31517 0 [,9] [,10] [,11] [,12] [1,] -6.704579 -15.12097 -17.439693 -14.489579 [2,] 2.344579 1.38097 -9.120307 -7.830421 $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(-16.9, -14.875, -11.78, -8.43000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/602hu1393867680.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] [1,] 886.900 788.62 720.520 703.210 [2,] 926.455 812.12 729.525 703.210 [3,] 948.145 821.27 731.665 706.285 [4,] 1004.560 852.01 759.880 709.360 [5,] 1029.980 869.74 778.760 709.360 $n [1] 12 12 12 2 $conf [,1] [,2] [,3] [,4] [1,] 912.5208 803.0759 717.8199 699.414 [2,] 983.7692 839.4641 745.5101 713.156 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" NA Warning message: In bxp(list(stats = c(886.9, 926.455, 948.145, 1004.56, 1029.98, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7x66h1393867680.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,] 798.6800 788.620 796.1650 [2,] 822.9133 811.750 820.2150 [3,] 832.8637 815.065 825.4669 [4,] 848.8233 830.220 841.1625 [5,] 879.3400 844.990 859.9675 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 821.0460 806.6407 815.9126 [2,] 844.6815 823.4893 835.0212 $out [1] 859.0300 874.2625 $group [1] 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(798.68, 822.913333333333, 832.86375, 848.823333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w7sv1393867680.ps tmp/1w7sv1393867680.png",intern=TRUE)) character(0) > try(system("convert tmp/2gukf1393867680.ps tmp/2gukf1393867680.png",intern=TRUE)) character(0) > try(system("convert tmp/3nw9b1393867680.ps tmp/3nw9b1393867680.png",intern=TRUE)) character(0) > try(system("convert tmp/4h4xs1393867680.ps tmp/4h4xs1393867680.png",intern=TRUE)) character(0) > try(system("convert tmp/5cjoo1393867680.ps tmp/5cjoo1393867680.png",intern=TRUE)) character(0) > try(system("convert tmp/602hu1393867680.ps tmp/602hu1393867680.png",intern=TRUE)) character(0) > try(system("convert tmp/7x66h1393867680.ps tmp/7x66h1393867680.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.302 0.895 5.235