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(121.5,121,120.6,120.2,119.9,119.5,119.1,118.6,118.2,118,118,118,118,117.9,117.6,117.2,116.7,116.2,115.8,115.4,114.9,114.5,114,113.4,112.8,112.4,112.2,112.4,112.7,113,113.1,113,112.9,112.9,112.6,112.1,111.5,111,110.6,110.1,109.4,108.6,107.7,106.9,106.2,105.5,104.8,104.2,103.6,102.9,102.2,101.5,101.2,101.1,101.2,101.4,101.6,101.8,102.2,102.8) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '12' > ylab = '' > xlab = '' > main = '' > #'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,] 121.5 118.0 112.8 111.5 103.6 NA [2,] 121.0 117.9 112.4 111.0 102.9 NA [3,] 120.6 117.6 112.2 110.6 102.2 NA [4,] 120.2 117.2 112.4 110.1 101.5 NA [5,] 119.9 116.7 112.7 109.4 101.2 NA [6,] 119.5 116.2 113.0 108.6 101.1 NA [7,] 119.1 115.8 113.1 107.7 101.2 NA [8,] 118.6 115.4 113.0 106.9 101.4 NA [9,] 118.2 114.9 112.9 106.2 101.6 NA [10,] 118.0 114.5 112.9 105.5 101.8 NA [11,] 118.0 114.0 112.6 104.8 102.2 NA [12,] 118.0 113.4 112.1 104.2 102.8 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/18ipo1226260474.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/231bf1226260474.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/3uwb61226260474.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/4lzmk1226260474.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,] 103.6 102.9 102.2 101.5 101.2 101.1 101.2 101.4 101.6 101.8 102.2 102.8 [2,] 111.5 111.0 110.6 110.1 109.4 108.6 107.7 106.9 106.2 105.5 104.8 104.2 [3,] 112.8 112.4 112.2 112.4 112.7 113.0 113.1 113.0 112.9 112.9 112.6 112.1 [4,] 118.0 117.9 117.6 117.2 116.7 116.2 115.8 115.4 114.9 114.5 114.0 113.4 [5,] 121.5 121.0 120.6 120.2 119.9 119.5 119.1 118.6 118.2 118.0 118.0 118.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 108.2071 107.5245 107.2538 107.3832 107.5418 107.6299 107.3766 106.9939 [2,] 117.3929 117.2755 117.1462 117.4168 117.8582 118.3701 118.8234 119.0061 [,9] [,10] [,11] [,12] [1,] 106.7526 106.5406 106.0993 105.5993 [2,] 119.0474 119.2594 119.1007 118.6007 $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(103.6, 111.5, 112.8, 118, 121.5, 102.9, 111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5yjev1226260474.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,] 118.0 113.4 112.10 104.20 101.1 NA [2,] 118.1 114.7 112.40 105.85 101.3 NA [3,] 119.3 116.0 112.75 108.15 101.7 NA [4,] 120.4 117.4 112.95 110.35 102.5 NA [5,] 121.5 118.0 113.10 111.50 103.6 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 118.2510 114.7685 112.4991 106.0975 101.1527 NA [2,] 120.3490 117.2315 113.0009 110.2025 102.2473 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(118, 118.1, 119.3, 120.4, 121.5, 113.4, 114.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6j5ii1226260474.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,] 110.10 112.10 108.800 [2,] 110.65 112.40 110.275 [3,] 111.53 112.75 112.075 [4,] 112.46 112.95 113.875 [5,] 113.48 113.10 114.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 110.7044 112.4991 110.4330 [2,] 112.3556 113.0009 113.7170 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(110.1, 110.65, 111.53, 112.46, 113.48, 112.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/18ipo1226260474.ps tmp/18ipo1226260474.png") > system("convert tmp/231bf1226260474.ps tmp/231bf1226260474.png") > system("convert tmp/3uwb61226260474.ps tmp/3uwb61226260474.png") > system("convert tmp/4lzmk1226260474.ps tmp/4lzmk1226260474.png") > system("convert tmp/5yjev1226260474.ps tmp/5yjev1226260474.png") > system("convert tmp/6j5ii1226260474.ps tmp/6j5ii1226260474.png") > > > proc.time() user system elapsed 1.246 0.776 3.528