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(126.81,125.8,123.07,119.52,118.03,117.27,117.27,116.69,115.38,114.31,113.33,111.79,111.79,110.92,109.37,107.04,104.72,104.14,104.14,102.95,102.13,101.01,100.07,99.4,99.4,99.34,97.72,96.26,95.77,95.04,95.04,94.55,94,93.14,91.21,90.3,90.3,89.74,89.07,89.06,88.97,88.78,88.78,88.23,87.91,87.79,87.89,88,88,87.08,85.75,84.29,84.39,83.72,83.72,81.76,81.53,80.55,79.83,78.98,78.98,78.27,77.41,76.75,76.38,74.96,74.96,74.46,74.04,73.22,72.97,72.91,72.91,73.27,72.93,72.67,71.94,71.9,71.89,71.72,70.85,69.82,69.61,69.48) > 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,] 126.81 111.79 99.40 90.30 88.00 78.98 72.91 NA [2,] 125.80 110.92 99.34 89.74 87.08 78.27 73.27 NA [3,] 123.07 109.37 97.72 89.07 85.75 77.41 72.93 NA [4,] 119.52 107.04 96.26 89.06 84.29 76.75 72.67 NA [5,] 118.03 104.72 95.77 88.97 84.39 76.38 71.94 NA [6,] 117.27 104.14 95.04 88.78 83.72 74.96 71.90 NA [7,] 117.27 104.14 95.04 88.78 83.72 74.96 71.89 NA [8,] 116.69 102.95 94.55 88.23 81.76 74.46 71.72 NA [9,] 115.38 102.13 94.00 87.91 81.53 74.04 70.85 NA [10,] 114.31 101.01 93.14 87.79 80.55 73.22 69.82 NA [11,] 113.33 100.07 91.21 87.89 79.83 72.97 69.61 NA [12,] 111.79 99.40 90.30 88.00 78.98 72.91 69.48 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -1.01 -0.87 -0.06 -0.56 -0.92 -0.71 0.36 NA [2,] -2.73 -1.55 -1.62 -0.67 -1.33 -0.86 -0.34 NA [3,] -3.55 -2.33 -1.46 -0.01 -1.46 -0.66 -0.26 NA [4,] -1.49 -2.32 -0.49 -0.09 0.10 -0.37 -0.73 NA [5,] -0.76 -0.58 -0.73 -0.19 -0.67 -1.42 -0.04 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 -0.01 NA [7,] -0.58 -1.19 -0.49 -0.55 -1.96 -0.50 -0.17 NA [8,] -1.31 -0.82 -0.55 -0.32 -0.23 -0.42 -0.87 NA [9,] -1.07 -1.12 -0.86 -0.12 -0.98 -0.82 -1.03 NA [10,] -0.98 -0.94 -1.93 0.10 -0.72 -0.25 -0.21 NA [11,] -1.54 -0.67 -0.91 0.11 -0.85 -0.06 -0.13 NA [12,] 0.00 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/118ga1381918772.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/2khbl1381918772.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/3rrun1381918772.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/4n5901381918772.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,] 72.910 73.270 72.930 72.67 71.940 71.90 71.89 71.72 70.850 [2,] 83.490 82.675 81.580 80.52 80.385 79.34 79.34 78.11 77.785 [3,] 90.300 89.740 89.070 89.06 88.970 88.78 88.78 88.23 87.910 [4,] 105.595 105.130 103.545 101.65 100.245 99.59 99.59 98.75 98.065 [5,] 126.810 125.800 123.070 119.52 118.030 117.27 117.27 116.69 115.380 [,10] [,11] [,12] [1,] 69.820 69.61 69.480 [2,] 76.885 76.40 75.945 [3,] 87.790 87.89 88.000 [4,] 97.075 95.64 94.850 [5,] 114.310 113.33 111.790 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 77.09925 76.33024 75.95286 76.4415 77.10993 76.68703 76.68703 [2,] 103.50075 103.14976 102.18714 101.6785 100.83007 100.87297 100.87297 [,8] [,9] [,10] [,11] [,12] [1,] 75.90412 75.79911 75.73286 76.40018 76.71024 [2,] 100.55588 100.02089 99.84714 99.37982 99.28976 $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(72.91, 83.49, 90.3, 105.595, 126.81, 73.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o04g1381918772.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,] -1.010 -2.730 -3.550 -2.32 -0.760 0 -1.190 -1.310 -1.12 -1.93 -1.540 [2,] -0.895 -1.585 -1.895 -1.11 -0.745 0 -0.885 -0.845 -1.05 -0.96 -0.880 [3,] -0.710 -1.330 -1.460 -0.49 -0.670 0 -0.550 -0.550 -0.98 -0.72 -0.670 [4,] -0.310 -0.765 -0.460 -0.23 -0.385 0 -0.495 -0.370 -0.84 -0.23 -0.095 [5,] 0.360 -0.340 -0.010 0.10 -0.040 0 -0.170 -0.230 -0.82 0.10 0.110 [,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,] -1.0593526 -1.8196908 -2.3169588 -1.0155218 -0.8849862 0 -0.7829017 [2,] -0.3606474 -0.8403092 -0.6030412 0.0355218 -0.4550138 0 -0.3170983 [,8] [,9] [,10] [,11] [,12] [1,] -0.8336623 -1.1054086 -1.1559442 -1.1387893 0 [2,] -0.2663377 -0.8545914 -0.2840558 -0.2012107 0 $out [1] -1.42 -0.01 -1.96 -0.12 $group [1] 5 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.01000000000001, -0.895000000000003, -0.710000000000008, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z4lc1381918772.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,] 111.790 99.400 90.30 87.790 78.98 72.91 69.480 NA [2,] 114.845 101.570 93.57 87.955 81.04 73.63 70.335 NA [3,] 117.270 104.140 95.04 88.780 83.72 74.96 71.895 NA [4,] 121.295 108.205 96.99 89.065 85.07 77.08 72.790 NA [5,] 126.810 111.790 99.40 90.300 88.00 78.98 73.270 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 114.3281 101.1137 93.48012 88.27372 81.88189 73.38643 70.77526 NA [2,] 120.2119 107.1663 96.59988 89.28628 85.55811 76.53357 73.01474 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(111.79, 114.845, 117.27, 121.295, 126.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mnbz1381918772.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,] 87.26571 87.790 85.39750 [2,] 88.97714 87.955 87.45250 [3,] 90.82929 88.780 89.46500 [4,] 92.92214 89.065 91.82375 [5,] 95.45571 90.300 94.54250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 89.02994 88.27372 87.47124 [2,] 92.62863 89.28628 91.45876 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(87.2657142857143, 88.9771428571429, 90.8292857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/118ga1381918772.ps tmp/118ga1381918772.png",intern=TRUE)) character(0) > try(system("convert tmp/2khbl1381918772.ps tmp/2khbl1381918772.png",intern=TRUE)) character(0) > try(system("convert tmp/3rrun1381918772.ps tmp/3rrun1381918772.png",intern=TRUE)) character(0) > try(system("convert tmp/4n5901381918772.ps tmp/4n5901381918772.png",intern=TRUE)) character(0) > try(system("convert tmp/5o04g1381918772.ps tmp/5o04g1381918772.png",intern=TRUE)) character(0) > try(system("convert tmp/6z4lc1381918772.ps tmp/6z4lc1381918772.png",intern=TRUE)) character(0) > try(system("convert tmp/7mnbz1381918772.ps tmp/7mnbz1381918772.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.458 0.968 5.402