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(389.09,391.76,390.96,391.76,392.8,393.06,393.06,393.26,393.87,394.47,394.57,394.57,394.57,399.57,406.13,407.03,409.46,409.9,409.9,410.14,410.54,410.69,410.79,410.97,410.97,413.8,423.31,423.85,426.6,426.26,426.26,426.32,427.14,427.55,428.29,428.8,428.8,434.87,435.66,440.75,440.99,441.04,441.04,441.88,441.92,442.48,442.81,442.81,442.81,447.19,446.52,448.57,448.71,448.73,449.07,449.03,448.68,450.08,449.96,449.96,449.96,452.56,455.31,456.2,456.75,457.63,457.63,457.65,458.32,459.64,460.16,459.89) > 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,] 389.09 394.57 410.97 428.80 442.81 449.96 NA [2,] 391.76 399.57 413.80 434.87 447.19 452.56 NA [3,] 390.96 406.13 423.31 435.66 446.52 455.31 NA [4,] 391.76 407.03 423.85 440.75 448.57 456.20 NA [5,] 392.80 409.46 426.60 440.99 448.71 456.75 NA [6,] 393.06 409.90 426.26 441.04 448.73 457.63 NA [7,] 393.06 409.90 426.26 441.04 449.07 457.63 NA [8,] 393.26 410.14 426.32 441.88 449.03 457.65 NA [9,] 393.87 410.54 427.14 441.92 448.68 458.32 NA [10,] 394.47 410.69 427.55 442.48 450.08 459.64 NA [11,] 394.57 410.79 428.29 442.81 449.96 460.16 NA [12,] 394.57 410.97 428.80 442.81 449.96 459.89 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.67 5.00 2.83 6.07 4.38 2.60 NA [2,] -0.80 6.56 9.51 0.79 -0.67 2.75 NA [3,] 0.80 0.90 0.54 5.09 2.05 0.89 NA [4,] 1.04 2.43 2.75 0.24 0.14 0.55 NA [5,] 0.26 0.44 -0.34 0.05 0.02 0.88 NA [6,] 0.00 0.00 0.00 0.00 0.34 0.00 NA [7,] 0.20 0.24 0.06 0.84 -0.04 0.02 NA [8,] 0.61 0.40 0.82 0.04 -0.35 0.67 NA [9,] 0.60 0.15 0.41 0.56 1.40 1.32 NA [10,] 0.10 0.10 0.74 0.33 -0.12 0.52 NA [11,] 0.00 0.18 0.51 0.00 0.00 -0.27 NA [12,] 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/159xj1413637544.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/2qsmg1413637544.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/38v241413637544.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/4cko11413637544.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] [1,] 389.090 391.760 390.960 391.76 392.800 393.06 393.06 393.26 393.87 394.470 [2,] 394.570 399.570 406.130 407.03 409.460 409.90 409.90 410.14 410.54 410.690 [3,] 419.885 424.335 429.485 432.30 433.795 433.65 433.65 434.10 434.53 435.015 [4,] 442.810 447.190 446.520 448.57 448.710 448.73 449.07 449.03 448.68 450.080 [5,] 449.960 452.560 455.310 456.20 456.750 457.63 457.63 457.65 458.32 459.640 [,11] [,12] [1,] 394.57 394.570 [2,] 410.79 410.970 [3,] 435.55 435.805 [4,] 449.96 449.960 [5,] 460.16 459.890 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 388.7686 393.6186 403.4321 405.5054 408.4775 408.6034 408.3841 409.0147 [2,] 451.0014 455.0514 455.5379 459.0946 459.1125 458.6966 458.9159 459.1853 [,9] [,10] [,11] [,12] [1,] 409.9285 409.6072 410.2841 410.6552 [2,] 459.1315 460.4228 460.8159 460.9548 $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(389.09, 394.57, 419.885, 442.81, 449.96, 391.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54jcv1413637544.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,] 2.600 -0.80 0.540 0.140 -0.340 0 -0.04 -0.350 0.15 -0.120 0.00 0 [2,] 2.670 -0.67 0.800 0.240 0.020 0 0.02 0.040 0.41 0.100 0.00 0 [3,] 3.605 1.77 0.895 0.795 0.155 0 0.13 0.505 0.58 0.215 0.00 0 [4,] 5.000 6.56 2.050 2.430 0.440 0 0.24 0.670 1.32 0.520 0.18 0 [5,] 6.070 9.51 2.050 2.750 0.880 0 0.24 0.820 1.40 0.740 0.18 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.102075 -2.893584 0.08870963 -0.6176207 -0.1159136 0 -0.01190711 [2,] 5.107925 6.433584 1.70129037 2.2076207 0.4259136 0 0.27190711 [,8] [,9] [,10] [,11] [,12] [1,] 0.09862965 -0.006979392 -0.05591357 -0.1161058 0 [2,] 0.91137035 1.166979392 0.48591357 0.1161058 0 $out [1] 5.09 0.34 0.84 0.51 -0.27 $group [1] 3 6 7 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.60000000000002, 2.67000000000002, 3.60499999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6p34k1413637544.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,] 389.09 406.130 423.310 434.870 446.520 452.560 NA [2,] 391.76 406.580 423.580 438.205 447.880 455.755 NA [3,] 393.06 409.900 426.290 441.040 448.720 457.630 NA [4,] 394.17 410.615 427.345 442.200 449.515 458.980 NA [5,] 394.57 410.970 428.800 442.810 450.080 460.160 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 391.9608 408.0596 424.5728 439.2179 447.9743 456.1591 NA [2,] 394.1592 411.7404 428.0072 442.8621 449.4657 459.1009 NA $out [1] 394.57 399.57 410.97 413.80 428.80 442.81 449.96 $group [1] 2 2 3 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(389.09, 391.76, 393.06, 394.17, 394.57, 406.13, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vvt81413637544.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,] 423.2917 429.4850 423.6187 [2,] 427.1708 430.8925 428.0200 [3,] 429.4650 433.7225 430.4625 [4,] 430.4483 434.7725 431.1913 [5,] 431.1667 435.8050 431.8000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 427.9701 431.9528 429.0161 [2,] 430.9599 435.4922 431.9089 $out [1] 419.3667 419.8850 424.3350 418.9887 $group [1] 1 2 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(423.291666666667, 427.170833333333, 429.465, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/159xj1413637544.ps tmp/159xj1413637544.png",intern=TRUE)) character(0) > try(system("convert tmp/2qsmg1413637544.ps tmp/2qsmg1413637544.png",intern=TRUE)) character(0) > try(system("convert tmp/38v241413637544.ps tmp/38v241413637544.png",intern=TRUE)) character(0) > try(system("convert tmp/4cko11413637544.ps tmp/4cko11413637544.png",intern=TRUE)) character(0) > try(system("convert tmp/54jcv1413637544.ps tmp/54jcv1413637544.png",intern=TRUE)) character(0) > try(system("convert tmp/6p34k1413637544.ps tmp/6p34k1413637544.png",intern=TRUE)) character(0) > try(system("convert tmp/7vvt81413637544.ps tmp/7vvt81413637544.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.462 0.376 2.875