R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(7.72,7.67,7.84,7.79,7.83,7.94,8.02,8.06,8.12,8.13,7.97,8.01,8,7.9,7.99,8.02,8.08,8.02,8.07,8.11,8.19,8.16,8.08,8.22,8.15,8.19,8.31,8.3,8.34,8.31,8.38,8.34,8.44,8.64,8.6,8.61,8.54,8.69,8.73,8.91,9.01,9.08,8.94,9.03,9.02,8.96,9.03,8.94,8.95,8.95,8.99,8.93,8.98,8.95,9.02,8.92,9.1,9.06,8.97,8.89,8.99,8.79,8.83,8.61,8.71,8.91,8.91,8.89,8.98,9,8.99,8.88) > 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,] 7.72 8.00 8.15 8.54 8.95 8.99 NA [2,] 7.67 7.90 8.19 8.69 8.95 8.79 NA [3,] 7.84 7.99 8.31 8.73 8.99 8.83 NA [4,] 7.79 8.02 8.30 8.91 8.93 8.61 NA [5,] 7.83 8.08 8.34 9.01 8.98 8.71 NA [6,] 7.94 8.02 8.31 9.08 8.95 8.91 NA [7,] 8.02 8.07 8.38 8.94 9.02 8.91 NA [8,] 8.06 8.11 8.34 9.03 8.92 8.89 NA [9,] 8.12 8.19 8.44 9.02 9.10 8.98 NA [10,] 8.13 8.16 8.64 8.96 9.06 9.00 NA [11,] 7.97 8.08 8.60 9.03 8.97 8.99 NA [12,] 8.01 8.22 8.61 8.94 8.89 8.88 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.05 -0.10 0.04 0.15 0.00 -0.20 NA [2,] 0.17 0.09 0.12 0.04 0.04 0.04 NA [3,] -0.05 0.03 -0.01 0.18 -0.06 -0.22 NA [4,] 0.04 0.06 0.04 0.10 0.05 0.10 NA [5,] 0.11 -0.06 -0.03 0.07 -0.03 0.20 NA [6,] 0.08 0.05 0.07 -0.14 0.07 0.00 NA [7,] 0.04 0.04 -0.04 0.09 -0.10 -0.02 NA [8,] 0.06 0.08 0.10 -0.01 0.18 0.09 NA [9,] 0.01 -0.03 0.20 -0.06 -0.04 0.02 NA [10,] -0.16 -0.08 -0.04 0.07 -0.09 -0.01 NA [11,] 0.04 0.14 0.01 -0.09 -0.08 -0.11 NA [12,] -0.01 -0.07 -0.07 0.01 0.10 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/1ybd11362672930.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/2tgro1362672930.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/389621362672930.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/4yper1362672930.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] [,10] [,11] [,12] [1,] 7.720 7.67 7.84 7.790 7.830 7.94 8.020 8.060 8.12 8.13 7.970 8.010 [2,] 8.000 7.90 7.99 8.020 8.080 8.02 8.070 8.110 8.19 8.16 8.080 8.220 [3,] 8.345 8.44 8.52 8.455 8.525 8.61 8.645 8.615 8.71 8.80 8.785 8.745 [4,] 8.950 8.79 8.83 8.910 8.980 8.95 8.940 8.920 9.02 9.00 8.990 8.890 [5,] 8.990 8.95 8.99 8.930 9.010 9.08 9.020 9.030 9.10 9.06 9.030 8.940 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.732219 7.865921 7.978173 7.880921 7.944471 8.01012 8.083822 8.092524 [2,] 8.957781 9.014079 9.061827 9.029079 9.105529 9.20988 9.206178 9.137476 [,9] [,10] [,11] [,12] [1,] 8.174623 8.258173 8.198021 8.312828 [2,] 9.245377 9.341827 9.371979 9.177172 $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(7.72, 8, 8.345, 8.95, 8.99, 7.67, 7.9, 8.44, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5q47x1362672930.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.200 0.040 -0.06 0.040 -0.06 0.00 -0.10 0.060 -0.06 -0.16 -0.110 -0.07 [2,] -0.100 0.040 -0.06 0.040 -0.03 0.00 -0.04 0.060 -0.04 -0.09 -0.090 -0.07 [3,] -0.025 0.065 -0.03 0.055 0.02 0.06 0.01 0.085 -0.01 -0.06 -0.035 -0.01 [4,] 0.040 0.120 0.03 0.100 0.11 0.07 0.04 0.100 0.02 -0.01 0.040 0.01 [5,] 0.150 0.170 0.03 0.100 0.20 0.08 0.09 0.100 0.02 0.07 0.140 0.10 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.11530452 0.01339742 -0.08805291 0.01629806 -0.07030452 0.01484774 [2,] 0.06530452 0.11660258 0.02805291 0.09370194 0.11030452 0.10515226 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.04160258 0.05919871 -0.04870194 -0.111602584 -0.1188542 -0.0665278 [2,] 0.06160258 0.11080129 0.02870194 -0.008397416 0.0488542 0.0465278 $out [1] 0.18 -0.22 -0.14 -0.01 0.18 0.20 $group [1] 3 3 6 8 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.200000000000001, -0.0999999999999996, -0.0249999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67v1g1362672930.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,] 7.670 7.900 8.150 8.540 8.890 8.610 NA [2,] 7.810 8.010 8.305 8.820 8.940 8.810 NA [3,] 7.955 8.075 8.340 8.950 8.960 8.900 NA [4,] 8.040 8.135 8.520 9.025 9.005 8.985 NA [5,] 8.130 8.220 8.640 9.080 9.100 9.000 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 7.850095 8.017987 8.241937 8.856498 8.930353 8.820181 NA [2,] 8.059905 8.132013 8.438063 9.043502 8.989647 8.979819 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(7.67, 7.81, 7.955, 8.04, 8.13, 7.9, 8.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lsl21362672931.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,] 8.365000 8.3450 8.368750 [2,] 8.437500 8.4875 8.452500 [3,] 8.545833 8.6125 8.534375 [4,] 8.599167 8.7275 8.600000 [5,] 8.658333 8.8000 8.635000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.472096 8.503034 8.467099 [2,] 8.619571 8.721966 8.601651 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(8.365, 8.4375, 8.54583333333333, 8.59916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ybd11362672930.ps tmp/1ybd11362672930.png",intern=TRUE)) character(0) > try(system("convert tmp/2tgro1362672930.ps tmp/2tgro1362672930.png",intern=TRUE)) character(0) > try(system("convert tmp/389621362672930.ps tmp/389621362672930.png",intern=TRUE)) character(0) > try(system("convert tmp/4yper1362672930.ps tmp/4yper1362672930.png",intern=TRUE)) character(0) > try(system("convert tmp/5q47x1362672930.ps tmp/5q47x1362672930.png",intern=TRUE)) character(0) > try(system("convert tmp/67v1g1362672930.ps tmp/67v1g1362672930.png",intern=TRUE)) character(0) > try(system("convert tmp/7lsl21362672931.ps tmp/7lsl21362672931.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.461 0.628 4.078