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(2.37,2.45,2.53,2.56,2.62,2.67,2.62,2.6,2.53,2.49,2.48,2.44,2.36,2.35,2.44,2.5,2.58,2.55,2.44,2.3,2.24,2.19,2.25,2.28,2.27,2.37,2.47,2.5,2.47,2.61,2.61,2.65,2.43,2.43,2.33,2.27,2.22,2.17,2.28,2.3,2.33,2.44,2.41,2.4,2.34,2.37,2.38,2.3,2.29,2.34,2.35,2.38,2.37,2.45,2.51,2.46,2.42,2.48,2.44,2.43,2.36,2.42,2.42,2.43,2.47,2.54,2.55,2.55,2.49,2.54,2.55,2.5) > 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,] 2.37 2.36 2.27 2.22 2.29 2.36 NA [2,] 2.45 2.35 2.37 2.17 2.34 2.42 NA [3,] 2.53 2.44 2.47 2.28 2.35 2.42 NA [4,] 2.56 2.50 2.50 2.30 2.38 2.43 NA [5,] 2.62 2.58 2.47 2.33 2.37 2.47 NA [6,] 2.67 2.55 2.61 2.44 2.45 2.54 NA [7,] 2.62 2.44 2.61 2.41 2.51 2.55 NA [8,] 2.60 2.30 2.65 2.40 2.46 2.55 NA [9,] 2.53 2.24 2.43 2.34 2.42 2.49 NA [10,] 2.49 2.19 2.43 2.37 2.48 2.54 NA [11,] 2.48 2.25 2.33 2.38 2.44 2.55 NA [12,] 2.44 2.28 2.27 2.30 2.43 2.50 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.08 -0.01 0.10 -0.05 0.05 0.06 NA [2,] 0.08 0.09 0.10 0.11 0.01 0.00 NA [3,] 0.03 0.06 0.03 0.02 0.03 0.01 NA [4,] 0.06 0.08 -0.03 0.03 -0.01 0.04 NA [5,] 0.05 -0.03 0.14 0.11 0.08 0.07 NA [6,] -0.05 -0.11 0.00 -0.03 0.06 0.01 NA [7,] -0.02 -0.14 0.04 -0.01 -0.05 0.00 NA [8,] -0.07 -0.06 -0.22 -0.06 -0.04 -0.06 NA [9,] -0.04 -0.05 0.00 0.03 0.06 0.05 NA [10,] -0.01 0.06 -0.10 0.01 -0.04 0.01 NA [11,] -0.04 0.03 -0.06 -0.08 -0.01 -0.05 NA [12,] -0.08 -0.01 -0.05 -0.01 -0.07 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/1y43u1413688977.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/2n8w61413688977.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/3aeko1413688977.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/4vfcd1413688977.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] [,12] [1,] 2.220 2.34 2.28 2.300 2.33 2.440 2.41 2.300 2.240 2.190 2.25 2.270 [2,] 2.270 2.34 2.35 2.380 2.37 2.450 2.44 2.400 2.340 2.370 2.33 2.280 [3,] 2.325 2.36 2.43 2.465 2.47 2.545 2.53 2.505 2.425 2.455 2.41 2.365 [4,] 2.360 2.42 2.47 2.500 2.58 2.610 2.61 2.600 2.490 2.490 2.48 2.440 [5,] 2.370 2.45 2.53 2.560 2.62 2.670 2.62 2.650 2.530 2.540 2.55 2.500 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.266947 2.308397 2.352596 2.387596 2.334543 2.441795 2.420345 2.375994 [2,] 2.383053 2.411603 2.507404 2.542404 2.605457 2.648205 2.639655 2.634006 [,9] [,10] [,11] [,12] [1,] 2.328245 2.377596 2.313245 2.261795 [2,] 2.521755 2.532404 2.506755 2.468205 $out [1] 2.17 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2.22, 2.27, 2.325, 2.36, 2.37, 2.34, 2.34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/557l41413688977.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] [1,] -0.050 0.000 0.01 -0.030 -0.030 -0.110 -0.050 -0.07 -0.050 -1.000000e-01 [2,] -0.010 0.010 0.02 -0.010 0.050 -0.050 -0.050 -0.07 -0.040 -4.000000e-02 [3,] 0.055 0.085 0.03 0.035 0.075 -0.015 -0.015 -0.06 0.015 -2.220446e-16 [4,] 0.080 0.100 0.03 0.060 0.110 0.010 0.000 -0.06 0.050 1.000000e-02 [5,] 0.100 0.110 0.03 0.080 0.140 0.060 0.040 -0.06 0.060 6.000000e-02 [,11] [,12] [1,] -0.080 -0.08 [2,] -0.060 -0.07 [3,] -0.045 -0.05 [4,] -0.010 -0.01 [5,] 0.030 -0.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.003052907 0.02694709 0.02354968 -0.01015226 0.03629806 -0.05370194 [2,] 0.113052907 0.14305291 0.03645032 0.08015226 0.11370194 0.02370194 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.04725161 -0.06645032 -0.04305291 -0.03225161 -0.07725161 -0.092395849 [2,] 0.01725161 -0.05354968 0.07305291 0.03225161 -0.01274839 -0.007604151 $out [1] 0.06 -0.14 -0.22 -0.04 $group [1] 3 7 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0500000000000003, -0.00999999999999979, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qqdb1413688977.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,] 2.370 2.190 2.270 2.170 2.290 2.360 NA [2,] 2.465 2.265 2.350 2.290 2.360 2.425 NA [3,] 2.530 2.355 2.450 2.335 2.425 2.495 NA [4,] 2.610 2.470 2.555 2.390 2.455 2.545 NA [5,] 2.670 2.580 2.650 2.440 2.510 2.550 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.463865 2.261498 2.356498 2.289389 2.38167 2.440267 NA [2,] 2.596135 2.448502 2.543502 2.380611 2.46833 2.549733 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2.37, 2.465, 2.53, 2.61, 2.67, 2.19, 2.265, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tor91413688977.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,] 2.311667 2.3250 2.317500 [2,] 2.387500 2.3875 2.390625 [3,] 2.415833 2.4425 2.426875 [4,] 2.483333 2.4875 2.487500 [5,] 2.543333 2.5450 2.533750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.372123 2.396889 2.38269 [2,] 2.459544 2.488111 2.47106 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2.31166666666667, 2.3875, 2.41583333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y43u1413688977.ps tmp/1y43u1413688977.png",intern=TRUE)) character(0) > try(system("convert tmp/2n8w61413688977.ps tmp/2n8w61413688977.png",intern=TRUE)) character(0) > try(system("convert tmp/3aeko1413688977.ps tmp/3aeko1413688977.png",intern=TRUE)) character(0) > try(system("convert tmp/4vfcd1413688977.ps tmp/4vfcd1413688977.png",intern=TRUE)) character(0) > try(system("convert tmp/557l41413688977.ps tmp/557l41413688977.png",intern=TRUE)) character(0) > try(system("convert tmp/6qqdb1413688977.ps tmp/6qqdb1413688977.png",intern=TRUE)) character(0) > try(system("convert tmp/7tor91413688977.ps tmp/7tor91413688977.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.465 0.402 2.897