R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) 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(108.56,108.71,116.73,118.88,119.6,119.62,119.64,119.74,119.74,119.74,119.9,119.9,119.9,119.9,119.9,121.02,122.95,123.62,123.67,123.81,123.83,123.83,123.83,123.83,123.89,123.89,124.44,125.51,125.89,126.12,126.25,126.25,126.3,126.31,126.38,125.51,126.82,126.86,126.86,127.28,128.72,128.77,128.84,128.88,128.88,128.88,128.88,128.88,128.89,128.9,128.92,129.05,129.83,130.54,130.82,130.91,131.04,131.07,131.15,131.2,131.2,131.42,131.45,131.7,134.24,135.17,135.51,135.65,136.02,136.07,136.13,136.07) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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 > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 72 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 108.56 119.90 123.89 126.82 128.89 131.20 NA [2,] 108.71 119.90 123.89 126.86 128.90 131.42 NA [3,] 116.73 119.90 124.44 126.86 128.92 131.45 NA [4,] 118.88 121.02 125.51 127.28 129.05 131.70 NA [5,] 119.60 122.95 125.89 128.72 129.83 134.24 NA [6,] 119.62 123.62 126.12 128.77 130.54 135.17 NA [7,] 119.64 123.67 126.25 128.84 130.82 135.51 NA [8,] 119.74 123.81 126.25 128.88 130.91 135.65 NA [9,] 119.74 123.83 126.30 128.88 131.04 136.02 NA [10,] 119.74 123.83 126.31 128.88 131.07 136.07 NA [11,] 119.90 123.83 126.38 128.88 131.15 136.13 NA [12,] 119.90 123.83 125.51 128.88 131.20 136.07 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.15 0.00 0.00 0.04 0.01 0.22 NA [2,] 8.02 0.00 0.55 0.00 0.02 0.03 NA [3,] 2.15 1.12 1.07 0.42 0.13 0.25 NA [4,] 0.72 1.93 0.38 1.44 0.78 2.54 NA [5,] 0.02 0.67 0.23 0.05 0.71 0.93 NA [6,] 0.02 0.05 0.13 0.07 0.28 0.34 NA [7,] 0.10 0.14 0.00 0.04 0.09 0.14 NA [8,] 0.00 0.02 0.05 0.00 0.13 0.37 NA [9,] 0.00 0.00 0.01 0.00 0.03 0.05 NA [10,] 0.16 0.00 0.07 0.00 0.08 0.06 NA [11,] 0.00 0.00 -0.87 0.00 0.05 -0.06 NA [12,] 0.00 0.06 1.31 0.01 0.00 NA 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/wessaorg/rcomp/tmp/1ux061369626422.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2vk381369626422.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3n2xf1369626422.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/45ukq1369626422.ps",horizontal=F,onefile=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,] 108.560 108.710 116.73 118.880 119.600 119.620 119.640 119.740 119.74 [2,] 119.900 119.900 119.90 121.020 122.950 123.620 123.670 123.810 123.83 [3,] 125.355 125.375 125.65 126.395 127.305 127.445 127.545 127.565 127.59 [4,] 128.890 128.900 128.92 129.050 129.830 130.540 130.820 130.910 131.04 [5,] 131.200 131.420 131.45 131.700 134.240 135.170 135.510 135.650 136.02 [,10] [,11] [,12] [1,] 119.740 119.90 119.900 [2,] 123.830 123.83 123.830 [3,] 127.595 127.63 127.195 [4,] 131.070 131.15 131.200 [5,] 136.070 136.13 136.070 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 119.5562 119.5697 119.8318 121.2154 122.8672 122.9814 122.933 122.9853 [2,] 131.1538 131.1803 131.4682 131.5746 131.7428 131.9086 132.157 132.1447 [,9] [,10] [,11] [,12] [1,] 122.9393 122.925 122.9084 122.4411 [2,] 132.2407 132.265 132.3516 131.9489 $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(108.56, 119.9, 125.355, 128.89, 131.2, 108.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/561ct1369626422.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.000 0.000 0.130 0.38 0.02 0.02 0.000 0.000 0.000 0.000 -0.06 0.00 [2,] 0.000 0.000 0.250 0.72 0.05 0.05 0.040 0.000 0.000 0.000 -0.06 0.00 [3,] 0.025 0.025 0.745 1.11 0.45 0.10 0.095 0.035 0.005 0.065 0.00 0.01 [4,] 0.150 0.550 1.120 1.93 0.71 0.28 0.140 0.130 0.030 0.080 0.00 0.06 [5,] 0.220 0.550 2.150 2.54 0.93 0.34 0.140 0.130 0.050 0.160 0.05 0.06 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.07175484 -0.3297678 0.1838219 0.3295109 0.02427868 -0.04835743 [2,] 0.12175484 0.3797678 1.3061781 1.8904891 0.87572132 0.24835743 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.03049677 -0.0488542 -0.01435097 0.01339742 -0.03870194 -0.03239585 [2,] 0.15950323 0.1188542 0.02435097 0.11660258 0.03870194 0.05239585 $out [1] 8.02 0.37 -0.87 1.31 $group [1] 2 8 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.0250000000000128, 0.149999999999991, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jqe81369626422.ps",horizontal=F,onefile=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] [1,] 116.730 119.900 123.890 126.820 128.890 131.200 NA [2,] 117.805 120.460 124.975 127.070 128.985 131.575 NA [3,] 119.630 123.645 126.005 128.805 130.680 135.340 NA [4,] 119.740 123.830 126.275 128.880 131.055 136.045 NA [5,] 119.900 123.830 126.380 128.880 131.200 136.130 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 118.7474 122.1079 125.4121 127.9794 129.7359 133.3012 NA [2,] 120.5126 125.1821 126.5979 129.6306 131.6241 137.3788 NA $out [1] 108.56 108.71 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(116.73, 117.805, 119.63, 119.74, 119.9, 119.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ow881369626422.ps",horizontal=F,onefile=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,] 123.2100 125.3550 124.6350 [2,] 125.1450 126.0225 125.0475 [3,] 127.3808 127.3750 127.2456 [4,] 127.6000 127.5775 127.4544 [5,] 127.7117 127.6300 127.5250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 126.2611 126.6658 126.1478 [2,] 128.5006 128.0842 128.3434 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(123.21, 125.145, 127.380833333333, 127.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ux061369626422.ps tmp/1ux061369626422.png",intern=TRUE)) character(0) > try(system("convert tmp/2vk381369626422.ps tmp/2vk381369626422.png",intern=TRUE)) character(0) > try(system("convert tmp/3n2xf1369626422.ps tmp/3n2xf1369626422.png",intern=TRUE)) character(0) > try(system("convert tmp/45ukq1369626422.ps tmp/45ukq1369626422.png",intern=TRUE)) character(0) > try(system("convert tmp/561ct1369626422.ps tmp/561ct1369626422.png",intern=TRUE)) character(0) > try(system("convert tmp/6jqe81369626422.ps tmp/6jqe81369626422.png",intern=TRUE)) character(0) > try(system("convert tmp/7ow881369626422.ps tmp/7ow881369626422.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.383 0.959 5.326