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(258778,252791,256389,258961,258647,256304,250498,247883,249552,262626,264416,273049,272441,267564,265952,263937,264765,263386,258985,257334,257477,271486,274488,281274,272674,269704,268227,276444,272247,268516,263406,263619,265905,281681,287413,289423,281242,273878,269022,272630,270287,260447,262248,252806,238663,258438,266719,263279,258064,248828,248284,253376,251846,239494,239709,228793,229521,249999,254016,251178) > 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,] 258778 272441 272674 272630 251846 [2,] 252791 267564 269704 270287 239494 [3,] 256389 265952 268227 260447 239709 [4,] 258961 263937 276444 262248 249999 [5,] 258647 264765 272247 252806 254016 [6,] 256304 263386 268516 258438 251178 [7,] 250498 258985 263406 266719 NA [8,] 247883 257334 263619 263279 NA [9,] 249552 257477 265905 258064 NA [10,] 262626 271486 281242 248828 NA [11,] 264416 274488 273878 248284 NA [12,] 273049 281274 269022 253376 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/1e5s41225743137.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/2o1xn1225743137.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/3ws5y1225743137.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/4vahx1225743137.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,] 251846 239494 256389 258961 252806 251178 250498.0 247883.0 249552.0 [2,] 258778 252791 256389 258961 254016 256304 254741.5 252608.5 253514.5 [3,] 272441 267564 260447 262248 258647 258438 261195.5 260306.5 257770.5 [4,] 272630 269704 265952 263937 264765 263386 265062.5 263449.0 261984.5 [5,] 272674 270287 268227 263937 272247 268516 266719.0 263619.0 265905.0 [,10] [,11] [,12] [1,] 248828 248284 253376.0 [2,] 255727 256350 261199.0 [3,] 267056 269147 271035.5 [4,] 276364 274183 277161.5 [5,] 281242 274488 281274.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,] 262653.2 255613.3 253689.8 258732.0 251051.8 253433.9 253041.9 251742.5 [2,] 282228.8 279514.7 267204.2 265764.0 266242.2 263442.1 269349.1 268870.5 [,9] [,10] [,11] [,12] [1,] 251079.2 250752.8 255058.9 258425.1 [2,] 264461.8 283359.2 283235.1 283645.9 $out [1] 239709 276444 249999 $group [1] 3 4 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(251846, 258778, 272441, 272630, 272674, 239494, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5vyhp1225743137.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,] 247883.0 257334.0 263406 248284.0 239494.0 [2,] 251644.5 261185.5 267066 253091.0 239709.0 [3,] 257518.0 265358.5 269363 259442.5 250588.5 [4,] 260793.5 271963.5 273276 264999.0 251846.0 [5,] 273049.0 281274.0 281242 272630.0 254016.0 $n [1] 12 12 12 12 6 $conf [,1] [,2] [,3] [,4] [,5] [1,] 253345.1 260442.6 266530.6 254011.2 242759.7 [2,] 261690.9 270274.4 272195.4 264873.8 258417.3 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(247883, 251644.5, 257518, 260793.5, 273049, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6nirc1225743137.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,] 257749.5 257770.5 257760.0 [2,] 258854.6 259476.8 259617.8 [3,] 260232.1 261721.8 261209.0 [4,] 265470.2 268355.5 266127.4 [5,] 269180.2 272441.0 270107.9 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 257214.7 257672.1 258239.9 [2,] 263249.5 265771.4 264178.1 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(257749.5, 258854.6, 260232.1, 265470.15, 269180.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1e5s41225743137.ps tmp/1e5s41225743137.png") > system("convert tmp/2o1xn1225743137.ps tmp/2o1xn1225743137.png") > system("convert tmp/3ws5y1225743137.ps tmp/3ws5y1225743137.png") > system("convert tmp/4vahx1225743137.ps tmp/4vahx1225743137.png") > system("convert tmp/5vyhp1225743137.ps tmp/5vyhp1225743137.png") > system("convert tmp/6nirc1225743137.ps tmp/6nirc1225743137.png") > > > proc.time() user system elapsed 1.293 0.834 1.605