R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(48.74,48.79,48.82,48.82,49.20,49.30,49.30,49.34,49.47,49.65,49.70,49.75,49.75,49.70,50.09,50.19,50.53,50.55,50.55,50.55,50.58,50.61,50.94,51.01,51.01,51.04,51.15,51.31,51.31,51.34,51.34,51.34,51.47,51.95,51.97,51.92,51.92,51.91,51.97,52.14,52.33,52.40,52.40,52.41,52.71,53.17,53.33,53.32,53.32,53.30,53.31,53.72,53.87,53.91,53.91,53.96,54.02,54.33,54.48,54.54,52.40,52.45,52.38,52.45,52.83,52.76,52.86,52.88,53.32,53.20,53.22,53.22) > 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,] 48.74 49.75 51.01 51.92 53.32 52.40 NA [2,] 48.79 49.70 51.04 51.91 53.30 52.45 NA [3,] 48.82 50.09 51.15 51.97 53.31 52.38 NA [4,] 48.82 50.19 51.31 52.14 53.72 52.45 NA [5,] 49.20 50.53 51.31 52.33 53.87 52.83 NA [6,] 49.30 50.55 51.34 52.40 53.91 52.76 NA [7,] 49.30 50.55 51.34 52.40 53.91 52.86 NA [8,] 49.34 50.55 51.34 52.41 53.96 52.88 NA [9,] 49.47 50.58 51.47 52.71 54.02 53.32 NA [10,] 49.65 50.61 51.95 53.17 54.33 53.20 NA [11,] 49.70 50.94 51.97 53.33 54.48 53.22 NA [12,] 49.75 51.01 51.92 53.32 54.54 53.22 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.05 -0.05 0.03 -0.01 -0.02 0.05 NA [2,] 0.03 0.39 0.11 0.06 0.01 -0.07 NA [3,] 0.00 0.10 0.16 0.17 0.41 0.07 NA [4,] 0.38 0.34 0.00 0.19 0.15 0.38 NA [5,] 0.10 0.02 0.03 0.07 0.04 -0.07 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.10 NA [7,] 0.04 0.00 0.00 0.01 0.05 0.02 NA [8,] 0.13 0.03 0.13 0.30 0.06 0.44 NA [9,] 0.18 0.03 0.48 0.46 0.31 -0.12 NA [10,] 0.05 0.33 0.02 0.16 0.15 0.02 NA [11,] 0.05 0.07 -0.05 -0.01 0.06 0.00 NA [12,] 0.00 0.00 0.00 0.00 -2.14 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/15lai1413035432.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/2pb631413035432.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/3lwwm1413035432.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/4ne061413035432.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] [1,] 48.740 48.790 48.82 48.820 49.20 49.30 49.30 49.340 49.47 49.65 49.700 [2,] 49.750 49.700 50.09 50.190 50.53 50.55 50.55 50.550 50.58 50.61 50.940 [3,] 51.465 51.475 51.56 51.725 51.82 51.87 51.87 51.875 52.09 52.56 52.595 [4,] 52.400 52.450 52.38 52.450 52.83 52.76 52.86 52.880 53.32 53.20 53.330 [5,] 53.320 53.300 53.31 53.720 53.87 53.91 53.91 53.960 54.02 54.33 54.480 [,12] [1,] 49.75 [2,] 51.01 [3,] 52.57 [4,] 53.32 [5,] 54.54 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 49.75566 49.70116 50.08288 50.26723 50.33643 50.44448 50.37998 50.37207 [2,] 53.17434 53.24884 53.03712 53.18277 53.30357 53.29552 53.36002 53.37793 [,9] [,10] [,11] [,12] [1,] 50.32261 50.88937 51.05337 51.07998 [2,] 53.85739 54.23063 54.13663 54.06002 $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(48.74, 49.75, 51.465, 52.4, 53.32, 48.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5e7bs1413035432.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.05 -0.070 0.00 0.000 0.020 0 0.000 0.03 -0.120 0.02 -0.050 0 [2,] -0.02 0.010 0.07 0.150 0.020 0 0.000 0.06 0.030 0.02 -0.010 0 [3,] 0.01 0.045 0.13 0.265 0.035 0 0.015 0.13 0.245 0.10 0.025 0 [4,] 0.05 0.110 0.17 0.380 0.070 0 0.040 0.30 0.460 0.16 0.060 0 [5,] 0.05 0.110 0.17 0.380 0.100 0 0.050 0.44 0.480 0.33 0.070 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.03515226 -0.01950323 0.06549677 0.1166426 0.002748385 0 -0.01080129 [2,] 0.05515226 0.10950323 0.19450323 0.4133574 0.067251615 0 0.04080129 [,8] [,9] [,10] [,11] [,12] [1,] -0.02480775 -0.03236389 0.009695478 -0.02015226 0 [2,] 0.28480775 0.52236389 0.190304522 0.07015226 0 $out [1] 0.39 0.41 -0.07 0.10 -2.14 $group [1] 2 3 5 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0499999999999972, -0.0200000000000031, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tn8r1413035432.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,] 48.74 49.700 51.010 51.910 53.300 52.380 NA [2,] 48.82 50.140 51.230 52.055 53.520 52.450 NA [3,] 49.30 50.550 51.340 52.400 53.910 52.845 NA [4,] 49.56 50.595 51.695 52.940 54.175 53.210 NA [5,] 49.75 51.010 51.970 53.330 54.540 53.320 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 48.96248 50.34247 51.12791 51.99635 53.61125 52.49836 NA [2,] 49.63752 50.75753 51.55209 52.80365 54.20875 53.19164 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(48.74, 48.82, 49.3, 49.56, 49.75, 49.7, 50.14, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lek91413035432.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,] 51.19000 51.4650 51.17250 [2,] 51.36250 51.6425 51.36875 [3,] 51.71833 51.8700 51.73063 [4,] 52.04000 52.3250 52.02688 [5,] 52.29333 52.5950 52.26625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 51.40932 51.55871 51.43045 [2,] 52.02735 52.18129 52.03080 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(51.19, 51.3625, 51.7183333333333, 52.04, 52.2933333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15lai1413035432.ps tmp/15lai1413035432.png",intern=TRUE)) character(0) > try(system("convert tmp/2pb631413035432.ps tmp/2pb631413035432.png",intern=TRUE)) character(0) > try(system("convert tmp/3lwwm1413035432.ps tmp/3lwwm1413035432.png",intern=TRUE)) character(0) > try(system("convert tmp/4ne061413035432.ps tmp/4ne061413035432.png",intern=TRUE)) character(0) > try(system("convert tmp/5e7bs1413035432.ps tmp/5e7bs1413035432.png",intern=TRUE)) character(0) > try(system("convert tmp/6tn8r1413035432.ps tmp/6tn8r1413035432.png",intern=TRUE)) character(0) > try(system("convert tmp/7lek91413035432.ps tmp/7lek91413035432.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.522 0.432 2.976