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(217859,208679,213188,216234,213587,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580,208795,197922,194596,194581,185686,178106,172608,167302,168053,202300,202388,182516,173476,166444,171297,169701,164182,161914,159612,151001,158114,186530,187069,174330) > 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 > x <- x[x>quantile(x,0.05) & x par1 <- as.numeric(par1) > (n <- length(x)) [1] 54 > (np <- floor(n / par1)) [1] 4 > 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 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 217859 233575 219277 194581 169701 [2,] 208679 237217 219313 185686 164182 [3,] 213188 235243 212610 178106 161914 [4,] 216234 230354 214771 172608 186530 [5,] 213587 227184 211142 167302 187069 [6,] 209465 221678 211457 168053 174330 [7,] 204045 217142 240048 202300 NA [8,] 200237 219452 240636 202388 NA [9,] 203666 248624 230580 182516 NA [10,] 241476 241114 208795 173476 NA [11,] 243324 229245 197922 166444 NA [12,] 244460 231805 194596 171297 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/1kzlv1225740343.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/2if3q1225740343.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/3mfd81225740343.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/4942m1225740343.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] [1,] 169701 164182 161914 172608 167302 168053 202300.0 200237.0 182516 [2,] 194581 185686 178106 186530 187069 174330 203172.5 201312.5 193091 [3,] 217859 208679 212610 214771 211142 209465 210593.5 210920.0 217123 [4,] 219277 219313 213188 216234 213587 211457 228595.0 230044.0 239602 [5,] 233575 237217 235243 230354 227184 221678 240048.0 240636.0 248624 [,10] [,11] [,12] [1,] 173476.0 166444.0 171297.0 [2,] 191135.5 182183.0 182946.5 [3,] 224954.5 213583.5 213200.5 [4,] 241295.0 236284.5 238132.5 [5,] 241476.0 243324.0 244460.0 $n [1] 5 5 5 5 5 5 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 200408.9 184918.2 187821.1 193782.2 192404.4 183231.2 190509.7 188222.1 [2,] 235309.1 232439.8 237398.9 235759.8 229879.6 235698.8 230677.3 233617.9 [,9] [,10] [,11] [,12] [1,] 180379.3 185328.5 170843.3 169603.6 [2,] 253866.7 264580.5 256323.7 256797.4 $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(169701, 194581, 217859, 219277, 233575, 164182, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5ef491225740343.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] [1,] 200237.0 217142.0 194596.0 166444.0 161914.0 [2,] 206362.0 224431.0 209968.5 169675.0 164182.0 [3,] 213387.5 231079.5 213690.5 175791.0 172015.5 [4,] 229667.5 236230.0 224946.5 190133.5 186530.0 [5,] 244460.0 248624.0 240636.0 202388.0 187069.0 $n [1] 12 12 12 12 6 $conf [,1] [,2] [,3] [,4] [,5] [1,] 202757.7 225697.9 206858.9 166459.7 157600.3 [2,] 224017.3 236461.1 220522.1 185122.3 186430.7 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(200237, 206362, 213387.5, 229667.5, 244460, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/66bzj1225740343.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,] 196996.6 208679.0 192893.5 [2,] 202136.1 210756.8 200855.0 [3,] 208116.2 212905.2 209168.8 [4,] 215781.0 215947.0 213268.9 [5,] 216346.5 217859.0 220584.9 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 201892.6 210537.9 203506.8 [2,] 214339.7 215272.6 214830.9 $out [1] 224954.5 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(196996.6, 202136.1, 208116.175, 215781, 216346.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1kzlv1225740343.ps tmp/1kzlv1225740343.png") > system("convert tmp/2if3q1225740343.ps tmp/2if3q1225740343.png") > system("convert tmp/3mfd81225740343.ps tmp/3mfd81225740343.png") > system("convert tmp/4942m1225740343.ps tmp/4942m1225740343.png") > system("convert tmp/5ef491225740343.ps tmp/5ef491225740343.png") > system("convert tmp/66bzj1225740343.ps tmp/66bzj1225740343.png") > > > proc.time() user system elapsed 1.294 0.840 1.744