R version 2.7.2 (2008-08-25) 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(94.10,94.90,96.40,91.10,84.40,86.40,88.00,75.10,109.70,103.00,82.10,68.00,96.40,94.30,90.00,88.00,76.10,82.50,81.40,66.50,97.20,94.10,80.70,70.50,87.80,89.50,99.60,84.20,75.10,92.00,80.80,73.10,99.80,90.00,83.10,72.40,78.80,87.30,91.00,80.10,73.60,86.40,74.50,71.20,92.40,81.50,85.30,69.90) > par1 = '4' > #'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] 48 > (np <- floor(n / par1)) [1] 12 > 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] 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 94.1 84.4 109.7 96.4 76.1 97.2 87.8 75.1 99.8 78.8 73.6 92.4 NA [2,] 94.9 86.4 103.0 94.3 82.5 94.1 89.5 92.0 90.0 87.3 86.4 81.5 NA [3,] 96.4 88.0 82.1 90.0 81.4 80.7 99.6 80.8 83.1 91.0 74.5 85.3 NA [4,] 91.1 75.1 68.0 88.0 66.5 70.5 84.2 73.1 72.4 80.1 71.2 69.9 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/1lcg91225742455.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/2vkn81225742455.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/3m5gl1225742455.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/466u81225742455.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] [1,] 73.60 81.50 74.5 66.50 [2,] 77.45 86.40 81.1 70.20 [3,] 90.10 89.75 84.2 72.75 [4,] 96.80 94.20 90.5 82.15 [5,] 109.70 103.00 99.6 91.10 $n [1] 12 12 12 12 $conf [,1] [,2] [,3] [,4] [1,] 81.27434 86.19237 79.9126 67.29952 [2,] 98.92566 93.30763 88.4874 78.20048 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(73.6, 77.45, 90.1, 96.8, 109.7, 81.5, 86.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5hdzu1225742455.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] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 91.10 75.10 68.00 88.00 66.50 70.50 84.20 73.10 72.40 78.80 71.20 69.90 [2,] 92.60 79.75 75.05 89.00 71.30 75.60 86.00 74.10 77.75 79.45 72.40 75.70 [3,] 94.50 85.40 92.55 92.15 78.75 87.40 88.65 77.95 86.55 83.70 74.05 83.40 [4,] 95.65 87.20 106.35 95.35 81.95 95.65 94.55 86.40 94.90 89.15 80.45 88.85 [5,] 96.40 88.00 109.70 96.40 82.50 97.20 99.60 92.00 99.80 91.00 86.40 92.40 [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 92.0905 79.5145 67.823 87.1335 70.3365 71.5605 81.8955 68.233 73.0015 [2,] 96.9095 91.2855 117.277 97.1665 87.1635 103.2395 95.4045 87.667 100.0985 [,10] [,11] [,12] [,13] [1,] 76.037 67.6905 73.0115 NA [2,] 91.363 80.4095 93.7885 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(91.1, 92.6, 94.5, 95.65, 96.4, 75.1, 79.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6ne041225742455.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,] 75.84167 72.750 75.73750 [2,] 80.95833 78.475 80.74375 [3,] 87.42917 86.975 86.55625 [4,] 89.47083 89.925 88.81875 [5,] 90.15833 90.100 90.27500 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 80.70429 77.9295 80.1770 [2,] 94.15404 96.0205 92.9355 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(75.8416666666667, 80.9583333333333, 87.4291666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1lcg91225742455.ps tmp/1lcg91225742455.png") > system("convert tmp/2vkn81225742455.ps tmp/2vkn81225742455.png") > system("convert tmp/3m5gl1225742455.ps tmp/3m5gl1225742455.png") > system("convert tmp/466u81225742455.ps tmp/466u81225742455.png") > system("convert tmp/5hdzu1225742455.ps tmp/5hdzu1225742455.png") > system("convert tmp/6ne041225742455.ps tmp/6ne041225742455.png") > > > proc.time() user system elapsed 1.301 0.829 1.584