R version 2.5.1 (2007-06-27) 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. 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(89.28,89.47,89.53,90.72,90.91,91.38,91.49,90.9,90.93,90.57,91.28,90.83,91.5,91.58,92.49,94.16,95.46,95.8,95.32,95.41,95.35,95.68,95.59,94.96,96.92,96.06,96.59,96.67,97.27,96.38,96.47,96.05,96.76,96.51,96.55,95.97,97,97.46,97.9,98.42,98.54,99,98.94,99.02,100.07,98.72,98.73,98.04,99.08,99.22,99.57,100.44,100.84,100.75,100.49,99.98,99.96,99.76,100.11,99.79,100.29,101.12,102.65,102.71,103.39,102.8,102.07,102.15,101.21,101.27,101.86,101.65,101.94,102.62,102.71,103.39,104.51,104.09,104.29,104.57,105.39,105.15,106.13,105.46,106.47,106.62,106.52,108.04,107.15,107.32,107.76,107.26,107.89) > 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] 93 > (np <- floor(n / par1)) [1] 7 > 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] 8 8 8 8 8 8 8 8 8 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.28 91.50 96.92 97.00 99.08 100.29 101.94 106.47 [2,] 89.47 91.58 96.06 97.46 99.22 101.12 102.62 106.62 [3,] 89.53 92.49 96.59 97.90 99.57 102.65 102.71 106.52 [4,] 90.72 94.16 96.67 98.42 100.44 102.71 103.39 108.04 [5,] 90.91 95.46 97.27 98.54 100.84 103.39 104.51 107.15 [6,] 91.38 95.80 96.38 99.00 100.75 102.80 104.09 107.32 [7,] 91.49 95.32 96.47 98.94 100.49 102.07 104.29 107.76 [8,] 90.90 95.41 96.05 99.02 99.98 102.15 104.57 107.26 [9,] 90.93 95.35 96.76 100.07 99.96 101.21 105.39 107.89 [10,] 90.57 95.68 96.51 98.72 99.76 101.27 105.15 NA [11,] 91.28 95.59 96.55 98.73 100.11 101.86 106.13 NA [12,] 90.83 94.96 95.97 98.04 99.79 101.65 105.46 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/1utl21193401253.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/26lbs1193401253.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/3lld41193401253.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/4qxih1193401253.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,] 89.280 89.47 89.530 90.720 90.910 91.380 91.490 90.90 90.930 [2,] 94.210 93.82 94.540 95.415 96.365 96.090 95.895 95.73 96.055 [3,] 98.040 98.34 98.735 99.430 99.690 99.875 99.715 99.50 100.015 [4,] 101.115 101.87 102.680 103.050 103.950 103.445 103.180 103.36 103.300 [5,] 106.470 106.62 106.520 108.040 107.150 107.320 107.760 107.26 107.890 [,10] [,11] [,12] [1,] 90.570 91.280 90.830 [2,] 96.095 96.070 95.465 [3,] 98.720 98.730 98.040 [4,] 100.515 100.985 100.720 [5,] 105.150 106.130 105.460 $n [1] 8 8 8 8 8 8 8 8 8 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.18277 93.84315 94.18788 95.16498 95.45291 95.7664 95.6455 [2,] 101.89723 102.83685 103.28212 103.69502 103.92709 103.9836 103.7845 [,8] [,9] [,10] [,11] [,12] [1,] 95.23777 95.96784 96.08045 95.79484 94.9018 [2,] 103.76223 104.06216 101.35955 101.66516 101.1782 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: some notches went outside hinges ('box'): maybe set notch=FALSE in: bxp(list(stats = c(89.28, 94.21, 98.04, 101.115, 106.47, 89.47, > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/55vhb1193401253.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] [1,] 89.280 91.500 95.970 97.00 99.080 100.290 101.94 106.47 [2,] 90.050 93.325 96.220 97.97 99.665 101.240 103.05 106.62 [3,] 90.865 95.335 96.530 98.63 99.970 101.965 104.40 107.26 [4,] 91.105 95.525 96.715 98.97 100.465 102.680 105.27 107.76 [5,] 91.490 95.800 97.270 100.07 100.840 103.390 106.13 108.04 $n [1] 12 12 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 90.3838 94.33157 96.30423 98.1739 99.60511 101.3082 103.3874 106.6596 [2,] 91.3462 96.33843 96.75577 99.0861 100.33489 102.6218 105.4126 107.8604 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: some notches went outside hinges ('box'): maybe set notch=FALSE in: bxp(list(stats = c(89.28, 90.05, 90.865, 91.105, 91.49, 91.5, > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6jf6e1193401253.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,] 97.81000 98.0400 98.09250 [2,] 98.16857 98.5300 98.26125 [3,] 98.96295 99.0825 99.21875 [4,] 99.64687 99.7025 99.43250 [5,] 99.75875 100.0150 100.24375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.28868 98.54771 98.68454 [2,] 99.63721 99.61729 99.75296 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: some notches went outside hinges ('box'): maybe set notch=FALSE in: bxp(list(stats = c(97.81, 98.1685714285714, 98.9629464285714, > dev.off() null device 1 > > system("convert tmp/1utl21193401253.ps tmp/1utl21193401253.png") > system("convert tmp/26lbs1193401253.ps tmp/26lbs1193401253.png") > system("convert tmp/3lld41193401253.ps tmp/3lld41193401253.png") > system("convert tmp/4qxih1193401253.ps tmp/4qxih1193401253.png") > system("convert tmp/55vhb1193401253.ps tmp/55vhb1193401253.png") > system("convert tmp/6jf6e1193401253.ps tmp/6jf6e1193401253.png") > > > proc.time() user system elapsed 1.362 0.835 1.588