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(97.5,98.61,101.34,103.89,105.42,106.56,106.96,107.65,107.95,107.71,106.25,104.37,104.69,104.39,104.59,104.78,105.03,105.01,105.01,105.67,106.08,106.74,101.34,100.86,100.98,103.23,104.48,105.88,105.76,105.44,105.44,105.24,105.42,105.26,101.19,99.82,100.77,102.48,103.95,106.34,107.17,107.03,107.16,107.17,108.65,109.07,104.02,104.13,104.51,105.61,106.08,110.05,111.01,110.95,110.95,110.96,111.24,109.78,106.8,105.82,106.42,107.63,107.89,108.55,109.91,110.17,110.38,110.41,110.58,109.49,108.08,107.7,107.72,108.51,108.55,110.3,111.4,111.95,112.32,112.53,112.51,112.78,111.53,110.24,110.4,110.24,112.25,113.27,113.96,114.36,114.43,115.18,116.68,117.83,114.69,113.33) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 97.50 104.69 100.98 100.77 104.51 106.42 107.72 110.40 NA [2,] 98.61 104.39 103.23 102.48 105.61 107.63 108.51 110.24 NA [3,] 101.34 104.59 104.48 103.95 106.08 107.89 108.55 112.25 NA [4,] 103.89 104.78 105.88 106.34 110.05 108.55 110.30 113.27 NA [5,] 105.42 105.03 105.76 107.17 111.01 109.91 111.40 113.96 NA [6,] 106.56 105.01 105.44 107.03 110.95 110.17 111.95 114.36 NA [7,] 106.96 105.01 105.44 107.16 110.95 110.38 112.32 114.43 NA [8,] 107.65 105.67 105.24 107.17 110.96 110.41 112.53 115.18 NA [9,] 107.95 106.08 105.42 108.65 111.24 110.58 112.51 116.68 NA [10,] 107.71 106.74 105.26 109.07 109.78 109.49 112.78 117.83 NA [11,] 106.25 101.34 101.19 104.02 106.80 108.08 111.53 114.69 NA [12,] 104.37 100.86 99.82 104.13 105.82 107.70 110.24 113.33 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1.11 -0.30 2.25 1.71 1.10 1.21 0.79 -0.16 NA [2,] 2.73 0.20 1.25 1.47 0.47 0.26 0.04 2.01 NA [3,] 2.55 0.19 1.40 2.39 3.97 0.66 1.75 1.02 NA [4,] 1.53 0.25 -0.12 0.83 0.96 1.36 1.10 0.69 NA [5,] 1.14 -0.02 -0.32 -0.14 -0.06 0.26 0.55 0.40 NA [6,] 0.40 0.00 0.00 0.13 0.00 0.21 0.37 0.07 NA [7,] 0.69 0.66 -0.20 0.01 0.01 0.03 0.21 0.75 NA [8,] 0.30 0.41 0.18 1.48 0.28 0.17 -0.02 1.50 NA [9,] -0.24 0.66 -0.16 0.42 -1.46 -1.09 0.27 1.15 NA [10,] -1.46 -5.40 -4.07 -5.05 -2.98 -1.41 -1.25 -3.14 NA [11,] -1.88 -0.48 -1.37 0.11 -0.98 -0.38 -1.29 -1.36 NA [12,] 0.32 0.12 0.95 0.38 0.60 0.02 0.16 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/fisher/rcomp/tmp/1yg8u1382044229.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/fisher/rcomp/tmp/2zlud1382044229.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/fisher/rcomp/tmp/387d21382044229.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/fisher/rcomp/tmp/4a41m1382044229.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,] 97.500 98.610 101.340 103.890 105.030 105.01 105.010 105.240 105.420 [2,] 100.875 102.855 104.215 105.330 105.590 106.00 106.200 106.420 107.015 [3,] 104.600 105.000 105.335 107.445 108.540 108.60 108.770 109.030 109.615 [4,] 107.070 108.070 108.220 110.175 111.205 111.45 111.635 111.745 111.875 [5,] 110.400 110.240 112.250 113.270 113.960 114.36 114.430 115.180 116.680 [,10] [,11] [,12] [1,] 105.260 101.190 99.820 [2,] 107.225 102.680 102.495 [3,] 109.280 106.525 105.095 [4,] 111.280 109.805 108.970 [5,] 112.780 114.690 113.330 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.1394 102.0868 103.0977 104.7385 105.4034 105.5556 105.7339 106.0554 [2,] 108.0606 107.9132 107.5723 110.1515 111.6766 111.6444 111.8061 112.0046 [,9] [,10] [,11] [,12] [1,] 106.9001 107.0148 102.5449 101.478 [2,] 112.3299 111.5452 110.5051 108.712 $out [1] 117.83 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(97.5, 100.875, 104.6, 107.07, 110.4, 98.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5bu061382044229.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.300 0.04 0.190 -0.120 -0.320 0.00 -0.200 -0.020 -1.460 -5.400 -1.880 [2,] 0.315 0.23 0.840 0.470 -0.100 0.00 0.010 0.175 -0.665 -4.560 -1.365 [3,] 1.105 0.86 1.575 0.895 0.120 0.10 0.120 0.290 0.055 -3.060 -1.135 [4,] 1.460 1.74 2.470 1.230 0.475 0.29 0.675 0.945 0.540 -1.435 -0.430 [5,] 2.250 2.73 3.970 1.530 1.140 0.40 0.750 1.500 1.150 -1.250 0.110 [,12] [1,] 0.02 [2,] 0.14 [3,] 0.32 [4,] 0.49 [5,] 0.95 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.4653866 0.01649232 0.6644586 0.4704531 -0.2012033 -0.06199816 -0.2514785 [2,] 1.7446134 1.70350768 2.4855414 1.3195469 0.4412033 0.26199816 0.4914785 [,8] [,9] [,10] [,11] [,12] [1,] -0.1401331 -0.6181303 -4.80567 -1.6573044 0.1109856 [2,] 0.7201331 0.7281303 -1.31433 -0.6126956 0.5290144 $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(-0.299999999999997, 0.314999999999998, 1.105, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6wmch1382044229.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] [,9] [1,] 97.500 104.390 99.82 100.770 104.510 106.420 107.720 110.240 NA [2,] 102.615 104.490 102.21 103.985 105.950 107.795 109.395 112.760 NA [3,] 105.835 104.895 105.25 106.685 109.915 109.020 111.465 114.160 NA [4,] 107.305 105.350 105.44 107.170 110.955 110.275 112.415 114.935 NA [5,] 107.950 106.080 105.88 109.070 111.240 110.580 112.780 117.830 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.6959 104.5027 103.7768 105.2323 107.6322 107.8889 110.0876 113.168 [2,] 107.9741 105.2873 106.7232 108.1377 112.1978 110.1511 112.8424 115.152 [,9] [1,] NA [2,] NA $out [1] 106.74 101.34 100.86 $group [1] 2 2 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(97.5, 102.615, 105.835, 107.305, 107.95, 104.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/712cf1382044229.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,] 104.1238 104.6000 103.8363 [2,] 105.9625 105.2150 105.9850 [3,] 108.2950 107.9925 108.1250 [4,] 109.2163 108.9000 108.9675 [5,] 109.8888 109.6150 109.5200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 106.8109 106.3117 106.7647 [2,] 109.7791 109.6733 109.4853 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104.12375, 105.9625, 108.295, 109.21625, 109.88875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yg8u1382044229.ps tmp/1yg8u1382044229.png",intern=TRUE)) character(0) > try(system("convert tmp/2zlud1382044229.ps tmp/2zlud1382044229.png",intern=TRUE)) character(0) > try(system("convert tmp/387d21382044229.ps tmp/387d21382044229.png",intern=TRUE)) character(0) > try(system("convert tmp/4a41m1382044229.ps tmp/4a41m1382044229.png",intern=TRUE)) character(0) > try(system("convert tmp/5bu061382044229.ps tmp/5bu061382044229.png",intern=TRUE)) character(0) > try(system("convert tmp/6wmch1382044229.ps tmp/6wmch1382044229.png",intern=TRUE)) character(0) > try(system("convert tmp/712cf1382044229.ps tmp/712cf1382044229.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.184 0.532 3.709