R version 2.6.0 (2007-10-03) Copyright (C) 2007 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. Natural language support but running in an English locale 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(153.4,159.5,157.4,169.1,172.6,161.7,159.2,157.4,153.9,144.8,142.2,140.1,143.4,153.3,166.9,170.6,182.8,170.3,156.6,155.2,154.7,151.6,152.1,153.2,149.5,149.7,144.3,140,137.8,132.2,128.9,123.1,120.4,122.8,126,124.5,120.6,114.7,111.7,109.1,108,107.7,99.9,103.7,103.4,103.4,104.7,105.8,105.3,103,103.8,103.4,105.8,101.4,97,94.3,96.6,97.1,95.7,96.9,97.4,95.3,93.6,91.5,93.1,91.7,94.3,93.9,90.9,88.3,91.3,91.7,92.4,92,95.6,95.8,96.4,99,107,109.7,116.2,115.9,113.8,112.6,113.7,115.9,110.3,111.3,113.4,108.2,104.8,106,110.9,115,118.4,121.4,128.8,131.7,141.7,142.9,139.4,134.7,125,113.6,111.5,108.5,112.3,116.6,115.5,120.1,132.9,128.1,129.3,132.5,131,124.9,120.8,122,122.1,127.4,135.2,137.3,135,136,138.4,134.7,138.4,133.9,133.6,141.2,151.8,155.4,156.6,161.6,160.7,156,159.5,168.7,169.9,169.9,185.9) > 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)) [1] 141 > (np <- floor(n / par1)) [1] 11 > 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 12 12 12 12 12 11 11 11 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 153.4 143.4 149.5 120.6 105.3 97.4 92.4 113.7 128.8 115.5 135.2 156.6 [2,] 159.5 153.3 149.7 114.7 103.0 95.3 92.0 115.9 131.7 120.1 137.3 161.6 [3,] 157.4 166.9 144.3 111.7 103.8 93.6 95.6 110.3 141.7 132.9 135.0 160.7 [4,] 169.1 170.6 140.0 109.1 103.4 91.5 95.8 111.3 142.9 128.1 136.0 156.0 [5,] 172.6 182.8 137.8 108.0 105.8 93.1 96.4 113.4 139.4 129.3 138.4 159.5 [6,] 161.7 170.3 132.2 107.7 101.4 91.7 99.0 108.2 134.7 132.5 134.7 168.7 [7,] 159.2 156.6 128.9 99.9 97.0 94.3 107.0 104.8 125.0 131.0 138.4 169.9 [8,] 157.4 155.2 123.1 103.7 94.3 93.9 109.7 106.0 113.6 124.9 133.9 169.9 [9,] 153.9 154.7 120.4 103.4 96.6 90.9 116.2 110.9 111.5 120.8 133.6 185.9 [10,] 144.8 151.6 122.8 103.4 97.1 88.3 115.9 115.0 108.5 122.0 141.2 NA [11,] 142.2 152.1 126.0 104.7 95.7 91.3 113.8 118.4 112.3 122.1 151.8 NA [12,] 140.1 153.2 124.5 105.8 96.9 91.7 112.6 121.4 116.6 127.4 155.4 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/1sbbe1196416577.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/2gbcd1196416577.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/3jjp31196416577.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/4jzc31196416577.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] [1,] 92.40 92.00 93.60 91.50 93.10 91.70 94.30 93.90 90.90 88.30 [2,] 109.50 108.85 107.05 106.25 106.90 104.55 102.35 104.85 107.15 105.95 [3,] 124.70 125.90 133.95 132.05 133.55 132.35 126.95 118.35 118.30 115.90 [4,] 146.45 151.50 150.85 149.45 149.45 148.20 147.50 144.55 143.75 132.00 [5,] 156.60 161.60 166.90 170.60 182.80 170.30 169.90 169.90 185.90 151.60 [,11] [,12] [1,] 91.3 91.70 [2,] 108.5 109.20 [3,] 118.4 121.40 [4,] 134.1 133.75 [5,] 152.1 155.40 $n [1] 12 12 12 12 12 12 12 12 12 11 11 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.8469 106.4470 113.9725 112.3462 114.1427 112.4409 106.3568 100.2426 [2,] 141.5531 145.3530 153.9275 151.7538 152.9573 152.2591 147.5432 136.4574 [,9] [,10] [,11] [,12] [1,] 101.6065 103.4901 106.2045 109.7047 [2,] 134.9935 128.3099 130.5955 133.0953 $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(92.4, 109.5, 124.7, 146.45, 156.6, 92, 108.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5ctf21196416577.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] [1,] 140.1 143.40 120.40 99.90 94.30 88.3 92.0 104.80 108.50 115.50 133.60 [2,] 149.1 152.65 123.80 103.55 96.75 91.4 95.7 109.25 112.95 121.40 134.85 [3,] 157.4 154.95 130.55 106.75 99.25 92.4 103.0 112.35 126.90 126.15 136.65 [4,] 160.6 168.60 142.15 110.40 103.60 94.1 113.2 115.45 137.05 130.15 139.80 [5,] 172.6 182.80 149.70 120.60 105.80 97.4 116.2 121.40 142.90 132.90 141.20 [,12] [1,] 156.0 [2,] 159.5 [3,] 161.6 [4,] 169.9 [5,] 169.9 $n [1] 12 12 12 12 12 12 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 152.1548 147.6751 122.1804 103.6257 96.12567 91.16851 95.01813 109.5221 [2,] 162.6452 162.2249 138.9196 109.8743 102.37433 93.63149 110.98187 115.1779 [,9] [,10] [,11] [,12] [1,] 115.9078 122.1591 134.3923 156.1227 [2,] 137.8922 130.1409 138.9077 167.0773 $out [1] 151.8 155.4 185.9 $group [1] 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" NA Warning message: In bxp(list(stats = c(140.1, 149.1, 157.4, 160.6, 172.6, 143.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6xq101196416577.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,] 119.1455 115.900 118.9750 [2,] 123.0636 118.375 121.9000 [3,] 125.9917 125.300 123.8187 [4,] 129.0250 132.200 127.5250 [5,] 131.3750 133.950 131.1875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 123.2726 118.9943 121.2531 [2,] 128.7107 131.6057 126.3844 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(119.145454545455, 123.063636363636, 125.991666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1sbbe1196416577.ps tmp/1sbbe1196416577.png") > system("convert tmp/2gbcd1196416577.ps tmp/2gbcd1196416577.png") > system("convert tmp/3jjp31196416577.ps tmp/3jjp31196416577.png") > system("convert tmp/4jzc31196416577.ps tmp/4jzc31196416577.png") > system("convert tmp/5ctf21196416577.ps tmp/5ctf21196416577.png") > system("convert tmp/6xq101196416577.ps tmp/6xq101196416577.png") > > > proc.time() user system elapsed 2.430 1.376 2.631