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(129.62,127.96,130.1,131.7,136.34,140.73,141.51,134.66,133.94,123.66,109.88,102.36,101.41,105.33,106.58,109.72,113.47,120.35,117.55,122.55,118.82,114.87,119.98,119.48,121.81,121.08,126.63,130.04,131.21,128.48,127.4,126.35,126.28,126,127.34,132.96,135.19,134.55,140.03,144.6,146.27,141.74,140.72,141.45,144.04,141.19,140.13,139.51,144.67,147.05,153.2,157.97,150.44,147.31,146.61,152.62,157.08,152.62,144.63,144.34,144.09,148.21,146.81,146.46,142.8,143.66,144.31,146.07,147.21,139.5,137.44,139.94) > 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,] 129.62 101.41 121.81 135.19 144.67 144.09 NA [2,] 127.96 105.33 121.08 134.55 147.05 148.21 NA [3,] 130.10 106.58 126.63 140.03 153.20 146.81 NA [4,] 131.70 109.72 130.04 144.60 157.97 146.46 NA [5,] 136.34 113.47 131.21 146.27 150.44 142.80 NA [6,] 140.73 120.35 128.48 141.74 147.31 143.66 NA [7,] 141.51 117.55 127.40 140.72 146.61 144.31 NA [8,] 134.66 122.55 126.35 141.45 152.62 146.07 NA [9,] 133.94 118.82 126.28 144.04 157.08 147.21 NA [10,] 123.66 114.87 126.00 141.19 152.62 139.50 NA [11,] 109.88 119.98 127.34 140.13 144.63 137.44 NA [12,] 102.36 119.48 132.96 139.51 144.34 139.94 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.66 3.92 -0.73 -0.64 2.38 4.12 NA [2,] 2.14 1.25 5.55 5.48 6.15 -1.40 NA [3,] 1.60 3.14 3.41 4.57 4.77 -0.35 NA [4,] 4.64 3.75 1.17 1.67 -7.53 -3.66 NA [5,] 4.39 6.88 -2.73 -4.53 -3.13 0.86 NA [6,] 0.78 -2.80 -1.08 -1.02 -0.70 0.65 NA [7,] -6.85 5.00 -1.05 0.73 6.01 1.76 NA [8,] -0.72 -3.73 -0.07 2.59 4.46 1.14 NA [9,] -10.28 -3.95 -0.28 -2.85 -4.46 -7.71 NA [10,] -13.78 5.11 1.34 -1.06 -7.99 -2.06 NA [11,] -7.52 -0.50 5.62 -0.62 -0.29 2.50 NA [12,] -0.95 2.33 2.23 5.16 -0.25 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/124la1413840424.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/2pw7o1413840424.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/3myzw1413840424.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/4olk21413840424.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,] 101.410 105.330 106.580 109.72 113.47 120.350 117.550 122.550 118.82 [2,] 121.810 121.080 126.630 130.04 131.21 128.480 127.400 126.350 126.28 [3,] 132.405 131.255 135.065 138.15 139.57 141.235 141.115 138.055 138.99 [4,] 144.090 147.050 146.810 146.46 146.27 143.660 144.310 146.070 147.21 [5,] 144.670 148.210 153.200 157.97 150.44 147.310 146.610 152.620 157.08 [,10] [,11] [,12] [1,] 114.87 109.88 102.360 [2,] 123.66 119.98 119.480 [3,] 132.75 132.39 136.235 [4,] 141.19 140.13 139.940 [5,] 152.62 144.63 144.340 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 118.0337 114.5035 122.0482 127.5586 129.8558 131.4434 130.2075 125.335 [2,] 146.7763 148.0065 148.0818 148.7414 149.2842 151.0266 152.0225 150.775 [,9] [,10] [,11] [,12] [1,] 125.4895 121.4426 119.3926 123.0376 [2,] 152.4905 144.0574 145.3874 149.4324 $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(101.41, 121.81, 132.405, 144.09, 144.67, 105.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lj1b1413840424.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.66 -1.40 -0.350 -7.53 -4.530 -2.80 -6.850 -3.730 -10.280 -13.78 -0.620 [2,] -0.73 1.25 1.600 -3.66 -3.130 -1.08 -1.050 -0.720 -7.710 -7.99 -0.620 [3,] 0.87 3.81 3.275 1.42 -0.935 -0.86 1.245 0.535 -4.205 -1.56 -0.395 [4,] 3.92 5.55 4.570 3.75 4.390 0.65 5.000 2.590 -2.850 1.34 2.500 [5,] 4.12 6.15 4.770 4.64 6.880 0.78 6.010 4.460 -0.280 5.11 5.620 [,12] [1,] -0.95 [2,] -0.25 [3,] 2.23 [4,] 2.33 [5,] 5.16 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.1294 1.036361 1.359254 -3.359689 -5.785643 -1.9759059 -2.657445 [2,] 3.8694 6.583639 5.190746 6.199689 3.915643 0.2559059 5.147445 [,8] [,9] [,10] [,11] [,12] [1,] -1.600057 -7.339857 -7.578151 -2.407501 0.4069785 [2,] 2.670057 -1.070143 4.458151 1.617501 4.0530215 $out [1] -7.52 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.66000000000001, -0.730000000000004, 0.870000000000019, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m45j1413840424.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,] 123.66 101.41 121.810 135.190 144.340 137.440 NA [2,] 125.81 108.15 126.140 139.770 145.640 141.370 NA [3,] 130.90 116.21 126.985 140.955 148.875 144.200 NA [4,] 135.50 119.73 129.260 142.890 152.910 146.635 NA [5,] 141.51 122.55 132.960 146.270 157.970 148.210 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 126.4803 110.9283 125.5619 139.5319 145.5591 141.7986 NA [2,] 135.3197 121.4917 128.4081 142.3781 152.1909 146.6014 NA $out [1] 109.88 102.36 121.08 134.55 $group [1] 1 1 3 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(123.66, 125.81, 130.9, 135.5, 141.51, 101.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73c1b1413840424.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,] 129.4650 131.2550 130.6387 [2,] 130.2983 132.5775 132.6600 [3,] 135.1208 137.1450 136.4887 [4,] 136.9000 139.2800 137.3337 [5,] 137.8950 141.2350 138.9475 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 132.1098 134.0879 134.3570 [2,] 138.1319 140.2021 138.6205 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(129.465, 130.298333333333, 135.120833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/124la1413840424.ps tmp/124la1413840424.png",intern=TRUE)) character(0) > try(system("convert tmp/2pw7o1413840424.ps tmp/2pw7o1413840424.png",intern=TRUE)) character(0) > try(system("convert tmp/3myzw1413840424.ps tmp/3myzw1413840424.png",intern=TRUE)) character(0) > try(system("convert tmp/4olk21413840424.ps tmp/4olk21413840424.png",intern=TRUE)) character(0) > try(system("convert tmp/5lj1b1413840424.ps tmp/5lj1b1413840424.png",intern=TRUE)) character(0) > try(system("convert tmp/6m45j1413840424.ps tmp/6m45j1413840424.png",intern=TRUE)) character(0) > try(system("convert tmp/73c1b1413840424.ps tmp/73c1b1413840424.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.445 0.456 2.931