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(1.31,1.32,1.32,1.33,1.33,1.33,1.34,1.33,1.32,1.31,1.31,1.33,1.34,1.33,1.33,1.34,1.34,1.34,1.35,1.35,1.35,1.34,1.35,1.36,1.35,1.36,1.36,1.36,1.37,1.39,1.39,1.38,1.37,1.39,1.38,1.4,1.41,1.4,1.42,1.43,1.44,1.44,1.44,1.46,1.46,1.49,1.49,1.48,1.49,1.5,1.5,1.5,1.47,1.49,1.49,1.5,1.52,1.52,1.52,1.52,1.53,1.54,1.51,1.49,1.49,1.49,1.48,1.49,1.49,1.47,1.49,1.49) > 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,] 1.31 1.34 1.35 1.41 1.49 1.53 NA [2,] 1.32 1.33 1.36 1.40 1.50 1.54 NA [3,] 1.32 1.33 1.36 1.42 1.50 1.51 NA [4,] 1.33 1.34 1.36 1.43 1.50 1.49 NA [5,] 1.33 1.34 1.37 1.44 1.47 1.49 NA [6,] 1.33 1.34 1.39 1.44 1.49 1.49 NA [7,] 1.34 1.35 1.39 1.44 1.49 1.48 NA [8,] 1.33 1.35 1.38 1.46 1.50 1.49 NA [9,] 1.32 1.35 1.37 1.46 1.52 1.49 NA [10,] 1.31 1.34 1.39 1.49 1.52 1.47 NA [11,] 1.31 1.35 1.38 1.49 1.52 1.49 NA [12,] 1.33 1.36 1.40 1.48 1.52 1.49 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 -0.01 0.01 -0.01 0.01 0.01 NA [2,] 0.00 0.00 0.00 0.02 0.00 -0.03 NA [3,] 0.01 0.01 0.00 0.01 0.00 -0.02 NA [4,] 0.00 0.00 0.01 0.01 -0.03 0.00 NA [5,] 0.00 0.00 0.02 0.00 0.02 0.00 NA [6,] 0.01 0.01 0.00 0.00 0.00 -0.01 NA [7,] -0.01 0.00 -0.01 0.02 0.01 0.01 NA [8,] -0.01 0.00 -0.01 0.00 0.02 0.00 NA [9,] -0.01 -0.01 0.02 0.03 0.00 -0.02 NA [10,] 0.00 0.01 -0.01 0.00 0.00 0.02 NA [11,] 0.02 0.01 0.02 -0.01 0.00 0.00 NA [12,] 0.01 -0.01 0.01 0.01 0.01 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/11eim1381745794.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/26ywp1381745794.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/3ance1381745794.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/4rzcz1381745794.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,] 1.31 1.32 1.32 1.330 1.330 1.330 1.340 1.33 1.320 1.31 1.310 1.33 [2,] 1.34 1.33 1.33 1.340 1.340 1.340 1.350 1.35 1.350 1.34 1.350 1.36 [3,] 1.38 1.38 1.39 1.395 1.405 1.415 1.415 1.42 1.415 1.43 1.435 1.44 [4,] 1.49 1.50 1.50 1.490 1.470 1.490 1.480 1.49 1.490 1.49 1.490 1.49 [5,] 1.53 1.54 1.51 1.500 1.490 1.490 1.490 1.50 1.520 1.52 1.520 1.52 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.283245 1.270345 1.280345 1.298245 1.321146 1.318245 1.331146 1.329695 [2,] 1.476755 1.489655 1.499655 1.491755 1.488854 1.511755 1.498854 1.510305 [,9] [,10] [,11] [,12] [1,] 1.324695 1.333245 1.344695 1.356146 [2,] 1.505305 1.526755 1.525305 1.523854 $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(1.31, 1.34, 1.38, 1.49, 1.53, 1.32, 1.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5aex71381745794.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.01 0 0.000 0.00 0.00 -0.01 -0.010 -0.01 -0.020 -0.01 -0.010 0.01 [2,] -0.01 0 0.000 0.00 0.00 0.00 -0.010 -0.01 -0.010 0.00 0.000 0.01 [3,] 0.01 0 0.005 0.00 0.00 0.00 0.005 0.00 -0.005 0.00 0.005 0.01 [4,] 0.01 0 0.010 0.01 0.02 0.01 0.010 0.00 0.020 0.01 0.020 0.01 [5,] 0.01 0 0.010 0.01 0.02 0.01 0.020 0.00 0.030 0.02 0.020 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.002900646 0 -0.001450323 -0.006450323 -0.01290065 -0.006450323 [2,] 0.022900646 0 0.011450323 0.006450323 0.01290065 0.006450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.007900646 -0.006450323 -0.02435097 -0.006450323 -0.007900646 0.01 [2,] 0.017900646 0.006450323 0.01435097 0.006450323 0.017900646 0.01 $out [1] 0.02 -0.03 -0.02 -0.03 0.02 -0.01 $group [1] 2 2 3 4 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, -0.01, 0.01, 0.01, 0.01, 0, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6y68s1381745794.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,] 1.310 1.33 1.350 1.400 1.47 1.48 NA [2,] 1.315 1.34 1.360 1.425 1.49 1.49 NA [3,] 1.325 1.34 1.375 1.440 1.50 1.49 NA [4,] 1.330 1.35 1.390 1.470 1.52 1.50 NA [5,] 1.340 1.36 1.400 1.490 1.52 1.51 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.318158 1.335439 1.361317 1.419475 1.486317 1.485439 NA [2,] 1.331842 1.344561 1.388683 1.460525 1.513683 1.494561 NA $out [1] 1.53 1.54 1.47 $group [1] 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.31, 1.315, 1.325, 1.33, 1.34, 1.33, 1.34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ue9s1381745794.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,] 1.405000 1.3800 1.405000 [2,] 1.407500 1.3925 1.407500 [3,] 1.414167 1.4150 1.415000 [4,] 1.419167 1.4250 1.419375 [5,] 1.430000 1.4400 1.428750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.408845 1.400177 1.409584 [2,] 1.419488 1.429823 1.420416 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.405, 1.4075, 1.41416666666667, 1.41916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11eim1381745794.ps tmp/11eim1381745794.png",intern=TRUE)) character(0) > try(system("convert tmp/26ywp1381745794.ps tmp/26ywp1381745794.png",intern=TRUE)) character(0) > try(system("convert tmp/3ance1381745794.ps tmp/3ance1381745794.png",intern=TRUE)) character(0) > try(system("convert tmp/4rzcz1381745794.ps tmp/4rzcz1381745794.png",intern=TRUE)) character(0) > try(system("convert tmp/5aex71381745794.ps tmp/5aex71381745794.png",intern=TRUE)) character(0) > try(system("convert tmp/6y68s1381745794.ps tmp/6y68s1381745794.png",intern=TRUE)) character(0) > try(system("convert tmp/7ue9s1381745794.ps tmp/7ue9s1381745794.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.170 0.919 5.063