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(96.86,96.89,96.9,96.94,96.88,96.89,96.89,96.95,97.03,97.29,97.37,97.41,97.41,97.32,97.33,97.38,97.47,97.5,97.5,97.58,97.7,97.9,97.98,98.03,98.03,97.94,98.12,98.19,98.34,98.42,98.43,98.45,98.77,99.24,99.46,99.54,99.55,99.24,99.43,99.47,99.57,99.62,99.64,99.75,99.85,100.28,100.52,100.57,100.57,100.27,100.27,100.18,100.16,100.18,100.18,100.59,100.69,101.06,101.15,101.16,101.16,100.81,100.94,101.13,101.29,101.34,101.35,101.7,102.05,102.48,102.66,102.72,102.73,102.18,102.22,102.37,102.53,102.61,102.62,103,103.17,103.52,103.69,103.73,99.57,99.09,99.14,99.36,99.6,99.65,99.8,100.15,100.45,100.89,101.13,101.17) > 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,] 96.86 97.41 98.03 99.55 100.57 101.16 102.73 99.57 NA [2,] 96.89 97.32 97.94 99.24 100.27 100.81 102.18 99.09 NA [3,] 96.90 97.33 98.12 99.43 100.27 100.94 102.22 99.14 NA [4,] 96.94 97.38 98.19 99.47 100.18 101.13 102.37 99.36 NA [5,] 96.88 97.47 98.34 99.57 100.16 101.29 102.53 99.60 NA [6,] 96.89 97.50 98.42 99.62 100.18 101.34 102.61 99.65 NA [7,] 96.89 97.50 98.43 99.64 100.18 101.35 102.62 99.80 NA [8,] 96.95 97.58 98.45 99.75 100.59 101.70 103.00 100.15 NA [9,] 97.03 97.70 98.77 99.85 100.69 102.05 103.17 100.45 NA [10,] 97.29 97.90 99.24 100.28 101.06 102.48 103.52 100.89 NA [11,] 97.37 97.98 99.46 100.52 101.15 102.66 103.69 101.13 NA [12,] 97.41 98.03 99.54 100.57 101.16 102.72 103.73 101.17 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.03 -0.09 -0.09 -0.31 -0.30 -0.35 -0.55 -0.48 NA [2,] 0.01 0.01 0.18 0.19 0.00 0.13 0.04 0.05 NA [3,] 0.04 0.05 0.07 0.04 -0.09 0.19 0.15 0.22 NA [4,] -0.06 0.09 0.15 0.10 -0.02 0.16 0.16 0.24 NA [5,] 0.01 0.03 0.08 0.05 0.02 0.05 0.08 0.05 NA [6,] 0.00 0.00 0.01 0.02 0.00 0.01 0.01 0.15 NA [7,] 0.06 0.08 0.02 0.11 0.41 0.35 0.38 0.35 NA [8,] 0.08 0.12 0.32 0.10 0.10 0.35 0.17 0.30 NA [9,] 0.26 0.20 0.47 0.43 0.37 0.43 0.35 0.44 NA [10,] 0.08 0.08 0.22 0.24 0.09 0.18 0.17 0.24 NA [11,] 0.04 0.05 0.08 0.05 0.01 0.06 0.04 0.04 NA [12,] 0.00 0.00 0.01 0.00 0.00 0.01 -4.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/wessaorg/rcomp/tmp/1lj6t1424718942.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/2rlmm1424718942.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/39ojs1424718942.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/4efxa1424718942.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,] 96.860 96.890 96.900 96.940 96.880 96.890 96.890 96.950 97.030 [2,] 97.720 97.630 97.725 97.785 97.905 97.960 97.965 98.015 98.235 [3,] 99.560 99.165 99.285 99.415 99.585 99.635 99.720 99.950 100.150 [4,] 100.865 100.540 100.605 100.655 100.725 100.760 100.765 101.145 101.370 [5,] 102.730 102.180 102.220 102.370 102.530 102.610 102.620 103.000 103.170 [,10] [,11] [,12] [1,] 97.290 97.370 97.410 [2,] 98.570 98.720 98.785 [3,] 100.585 100.825 100.865 [4,] 101.770 101.905 101.945 [5,] 103.520 103.690 103.730 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.80316 97.53943 97.67619 97.81178 98.00971 98.07088 98.15588 [2,] 101.31684 100.79057 100.89381 101.01822 101.16029 101.19912 101.28412 [,8] [,9] [,10] [,11] [,12] [1,] 98.20154 98.39874 98.79743 99.04581 99.09978 [2,] 101.69846 101.90126 102.37257 102.60419 102.63022 $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(96.86, 97.72, 99.56, 100.865, 102.73, 96.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54e7p1424718942.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.550 0.000 -0.09 -0.060 0.010 0.000 0.020 0.080 0.200 0.080 0.040 0.000 [2,] -0.415 0.010 0.04 0.035 0.025 0.000 0.070 0.100 0.305 0.085 0.040 0.000 [3,] -0.305 0.045 0.06 0.125 0.050 0.010 0.230 0.145 0.400 0.175 0.045 0.000 [4,] -0.090 0.155 0.17 0.160 0.065 0.015 0.365 0.310 0.435 0.230 0.055 0.005 [5,] 0.030 0.190 0.22 0.240 0.080 0.020 0.410 0.350 0.470 0.240 0.060 0.010 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.4865497 -0.03599908 -0.01261987 0.05517321 0.02765543 0.001620785 [2,] -0.1234503 0.12599908 0.13261987 0.19482679 0.07234457 0.018379215 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.06520876 0.02769099 0.3273801 0.09400092 0.03662078 -0.002985919 [2,] 0.39479124 0.26230901 0.4726199 0.25599908 0.05337922 0.002985919 $out [1] 0.15 0.08 0.01 -4.16 $group [1] 6 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.549999999999997, -0.414999999999992, -0.305, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tzgo1424718942.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,] 96.86 97.320 97.940 99.240 100.160 100.810 102.180 99.090 NA [2,] 96.89 97.395 98.155 99.510 100.180 101.145 102.450 99.465 NA [3,] 96.92 97.500 98.425 99.630 100.420 101.345 102.675 99.725 NA [4,] 97.16 97.800 99.005 100.065 100.875 102.265 103.345 100.670 NA [5,] 97.41 98.030 99.540 100.570 101.160 102.720 103.730 101.170 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.79685 97.31528 98.03731 99.37686 100.103 100.8342 102.2668 99.17539 [2,] 97.04315 97.68472 98.81269 99.88314 100.737 101.8558 103.0832 100.27461 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(96.86, 96.89, 96.92, 97.16, 97.41, 97.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ckhn1424718942.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,] 99.21750 99.1650 99.09500 [2,] 99.42875 99.4875 99.24250 [3,] 99.53875 99.6775 99.33250 [4,] 100.14812 100.3675 99.96312 [5,] 100.54125 100.8650 100.36000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.21064 99.27613 99.00382 [2,] 99.86686 100.07887 99.66118 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(99.2175, 99.42875, 99.53875, 100.148125, 100.54125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lj6t1424718942.ps tmp/1lj6t1424718942.png",intern=TRUE)) character(0) > try(system("convert tmp/2rlmm1424718942.ps tmp/2rlmm1424718942.png",intern=TRUE)) character(0) > try(system("convert tmp/39ojs1424718942.ps tmp/39ojs1424718942.png",intern=TRUE)) character(0) > try(system("convert tmp/4efxa1424718942.ps tmp/4efxa1424718942.png",intern=TRUE)) character(0) > try(system("convert tmp/54e7p1424718942.ps tmp/54e7p1424718942.png",intern=TRUE)) character(0) > try(system("convert tmp/6tzgo1424718942.ps tmp/6tzgo1424718942.png",intern=TRUE)) character(0) > try(system("convert tmp/7ckhn1424718942.ps tmp/7ckhn1424718942.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.622 0.448 3.095