x <- c(0.989130435,0.919087137,0.925417076,0.925612053,1.066666667,0.851108765,1.030693069,0.989031079,0.913000978,0.792723264,0.978170478,0.987513007,0.909433962,0.883608147,0.82745098,0.8252149,1.023255814,0.815418024,1.026192703,0.914742451,0.807276303,0.739130435,0.98973306,0.972164948,0.853889943,0.856864654,0.775739042,0.789473684,0.931350114,0.73971079,0.885245902,0.842435094,0.818458418,0.72755418,0.923238696,0.922680412,0.883762201,0.818270165,0.771047228,0.825852783,0.924485126,0.755165289,0.874671341,0.815956482,0.799807507,0.712598425,0.832980973,0.910323253,0.869149952,0.779182879,0.750254842,0.75856014,0.920889988,0.743991641,0.816254417,0.769593957,0.784007353,0.683284457,0.850505051,0.900695134,0.868398268) 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)) (np <- floor(n / par1)) 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 arr 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/1dsu91193591739.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() postscript(file="/var/www/html/rcomp/tmp/2vffs1193591739.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() postscript(file="/var/www/html/rcomp/tmp/3120z1193591739.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() postscript(file="/var/www/html/rcomp/tmp/47cis1193591739.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')) dev.off() postscript(file="/var/www/html/rcomp/tmp/5xae41193591739.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')) dev.off() postscript(file="/var/www/html/rcomp/tmp/61gjn1193591739.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')) dev.off() system("convert tmp/1dsu91193591739.ps tmp/1dsu91193591739.png") system("convert tmp/2vffs1193591739.ps tmp/2vffs1193591739.png") system("convert tmp/3120z1193591739.ps tmp/3120z1193591739.png") system("convert tmp/47cis1193591739.ps tmp/47cis1193591739.png") system("convert tmp/5xae41193591739.ps tmp/5xae41193591739.png") system("convert tmp/61gjn1193591739.ps tmp/61gjn1193591739.png")