R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(0.33,0.33,0.32,0.33,0.34,0.36,0.34,0.33,0.35,0.31,0.28,0.26,0.26,0.26,0.29,0.30,0.30,0.28,0.29,0.29,0.32,0.33,0.29,0.31,0.33,0.36,0.39,0.30,0.27,0.28,0.29,0.30,0.30,0.30,0.31,0.30,0.31,0.29,0.32,0.33,0.35,0.35,0.36,0.40,0.40,0.47,0.43,0.38,0.38,0.40,0.45,0.47,0.45,0.50,0.54,0.55,0.59,0.51,0.50,0.50) > par1 = '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Mean Plot (v1.0.1) 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 > #Technical description: Write here your technical program description > par1 <- as.numeric(par1) > (n <- length(x)) [1] 60 > (np <- floor(n / par1)) [1] 5 > arr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + if (j == par1) j = 0 + } > ari [1] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.33 0.26 0.33 0.31 0.38 NA [2,] 0.33 0.26 0.36 0.29 0.40 NA [3,] 0.32 0.29 0.39 0.32 0.45 NA [4,] 0.33 0.30 0.30 0.33 0.47 NA [5,] 0.34 0.30 0.27 0.35 0.45 NA [6,] 0.36 0.28 0.28 0.35 0.50 NA [7,] 0.34 0.29 0.29 0.36 0.54 NA [8,] 0.33 0.29 0.30 0.40 0.55 NA [9,] 0.35 0.32 0.30 0.40 0.59 NA [10,] 0.31 0.33 0.30 0.47 0.51 NA [11,] 0.28 0.29 0.31 0.43 0.50 NA [12,] 0.26 0.31 0.30 0.38 0.50 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/www/html/rcomp/tmp/1xg8h1229267268.ps",horizontal=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/www/html/rcomp/tmp/21d2m1229267268.ps",horizontal=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/www/html/rcomp/tmp/3274d1229267268.ps",horizontal=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/www/html/rcomp/tmp/4om071229267268.ps",horizontal=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,] 0.31 0.26 0.29 0.30 0.27 0.28 0.29 0.29 0.30 0.30 0.28 0.26 [2,] 0.31 0.29 0.32 0.30 0.30 0.28 0.29 0.30 0.32 0.31 0.29 0.30 [3,] 0.33 0.33 0.32 0.33 0.34 0.35 0.34 0.33 0.35 0.33 0.31 0.31 [4,] 0.33 0.36 0.39 0.33 0.35 0.36 0.36 0.40 0.40 0.47 0.43 0.38 [5,] 0.33 0.40 0.45 0.33 0.35 0.36 0.36 0.55 0.40 0.51 0.50 0.50 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3158681 0.2805382 0.2705382 0.3088021 0.3046701 0.2934722 0.2905382 [2,] 0.3441319 0.3794618 0.3694618 0.3511979 0.3753299 0.4065278 0.3894618 [,8] [,9] [,10] [,11] [,12] [1,] 0.2593403 0.2934722 0.2169444 0.2110764 0.2534722 [2,] 0.4006597 0.4065278 0.4430556 0.4089236 0.3665278 $out [1] 0.26 0.38 0.47 0.45 0.50 0.54 0.59 $group [1] 1 1 4 5 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.31, 0.31, 0.33, 0.33, 0.33, 0.26, 0.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/56t321229267268.ps",horizontal=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] [1,] 0.280 0.260 0.270 0.290 0.380 NA [2,] 0.315 0.285 0.295 0.325 0.450 NA [3,] 0.330 0.290 0.300 0.355 0.500 NA [4,] 0.340 0.305 0.320 0.400 0.525 NA [5,] 0.360 0.330 0.330 0.470 0.590 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.3185973 0.2808779 0.2885973 0.320792 0.465792 NA [2,] 0.3414027 0.2991221 0.3114027 0.389208 0.534208 NA $out [1] 0.26 0.36 0.39 $group [1] 1 3 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(0.28, 0.315, 0.33, 0.34, 0.36, 0.26, 0.285, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6d82j1229267268.ps",horizontal=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,] 0.322 0.310 0.3150 [2,] 0.344 0.325 0.3225 [3,] 0.354 0.330 0.3325 [4,] 0.369 0.340 0.3575 [5,] 0.392 0.350 0.3900 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.3425973 0.3231584 0.3165363 [2,] 0.3654027 0.3368416 0.3484637 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(0.322, 0.344, 0.354, 0.369, 0.392, 0.31, 0.325, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1xg8h1229267268.ps tmp/1xg8h1229267268.png") > system("convert tmp/21d2m1229267268.ps tmp/21d2m1229267268.png") > system("convert tmp/3274d1229267268.ps tmp/3274d1229267268.png") > system("convert tmp/4om071229267268.ps tmp/4om071229267268.png") > system("convert tmp/56t321229267268.ps tmp/56t321229267268.png") > system("convert tmp/6d82j1229267268.ps tmp/6d82j1229267268.png") > > > proc.time() user system elapsed 1.082 0.834 1.473