R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.06,4.07,4.07,4.07,4.07,4.07,4.30,4.44,4.52,4.52,4.52,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.61,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.66,4.70,4.72,4.73,4.73,4.74,4.74,4.74,4.76,4.88,4.88,4.88,4.88,4.89,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.98,5.00,5.03,5.04,5.04,5.05,5.05,5.05,5.06) > 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,] 4.00 4.07 4.53 4.63 4.88 4.97 NA [2,] 4.00 4.07 4.53 4.63 4.88 4.97 NA [3,] 4.00 4.30 4.53 4.66 4.88 4.97 NA [4,] 4.00 4.44 4.61 4.70 4.89 4.98 NA [5,] 4.00 4.52 4.63 4.72 4.97 5.00 NA [6,] 4.00 4.52 4.63 4.73 4.97 5.03 NA [7,] 4.00 4.52 4.63 4.73 4.97 5.04 NA [8,] 4.00 4.53 4.63 4.74 4.97 5.04 NA [9,] 4.06 4.53 4.63 4.74 4.97 5.05 NA [10,] 4.07 4.53 4.63 4.74 4.97 5.05 NA [11,] 4.07 4.53 4.63 4.76 4.97 5.05 NA [12,] 4.07 4.53 4.63 4.88 4.97 5.06 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [2,] 0.00 0.23 0.00 0.03 0.00 0.00 NA [3,] 0.00 0.14 0.08 0.04 0.01 0.01 NA [4,] 0.00 0.08 0.02 0.02 0.08 0.02 NA [5,] 0.00 0.00 0.00 0.01 0.00 0.03 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.01 NA [7,] 0.00 0.01 0.00 0.01 0.00 0.00 NA [8,] 0.06 0.00 0.00 0.00 0.00 0.01 NA [9,] 0.01 0.00 0.00 0.00 0.00 0.00 NA [10,] 0.00 0.00 0.00 0.02 0.00 0.00 NA [11,] 0.00 0.00 0.00 0.12 0.00 0.01 NA [12,] 0.00 0.00 0.00 0.00 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/1krgq1368881956.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/2mgfs1368881956.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/3txxd1368881956.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/4lx1j1368881956.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,] 4.00 4.00 4.000 4.000 4.000 4.00 4.00 4.000 4.060 4.070 4.070 4.070 [2,] 4.07 4.07 4.300 4.440 4.520 4.52 4.52 4.530 4.530 4.530 4.530 4.530 [3,] 4.58 4.58 4.595 4.655 4.675 4.68 4.68 4.685 4.685 4.685 4.695 4.755 [4,] 4.88 4.88 4.880 4.890 4.970 4.97 4.97 4.970 4.970 4.970 4.970 4.970 [5,] 4.97 4.97 4.970 4.980 5.000 5.03 5.04 5.040 5.050 5.050 5.050 5.060 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4.057524 4.057524 4.220881 4.364735 4.384735 4.389735 4.389735 4.401186 [2,] 5.102476 5.102476 4.969119 4.945265 4.965265 4.970265 4.970265 4.968814 [,9] [,10] [,11] [,12] [1,] 4.401186 4.401186 4.411186 4.471186 [2,] 4.968814 4.968814 4.978814 5.038814 $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(4, 4.07, 4.58, 4.88, 4.97, 4, 4.07, 4.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ro7g1368881956.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 0.00 0.000 0.00 0.00 0 0.00 0.00 0 0 0.00 0 [2,] 0 0.00 0.010 0.02 0.00 0 0.00 0.00 0 0 0.00 0 [3,] 0 0.00 0.025 0.02 0.00 0 0.00 0.00 0 0 0.00 0 [4,] 0 0.03 0.080 0.08 0.01 0 0.01 0.01 0 0 0.01 0 [5,] 0 0.03 0.140 0.08 0.01 0 0.01 0.01 0 0 0.01 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 -0.01935097 -0.02015226 -0.01870194 -0.006450323 0 -0.006450323 [2,] 0 0.01935097 0.07015226 0.05870194 0.006450323 0 0.006450323 [,8] [,9] [,10] [,11] [,12] [1,] -0.006450323 0 0 -0.006450323 0 [2,] 0.006450323 0 0 0.006450323 0 $out [1] 0.23 0.03 0.01 0.06 0.01 0.02 0.12 $group [1] 2 5 6 8 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0, 0, 0.0300000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lokm1368881956.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,] 4.000 4.30 4.53 4.63 4.880 4.970 NA [2,] 4.000 4.37 4.57 4.68 4.885 4.975 NA [3,] 4.000 4.52 4.63 4.73 4.970 5.035 NA [4,] 4.065 4.53 4.63 4.74 4.970 5.050 NA [5,] 4.070 4.53 4.63 4.76 4.970 5.060 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.970353 4.447023 4.602634 4.702634 4.931231 5.000792 NA [2,] 4.029647 4.592977 4.657366 4.757366 5.008769 5.069208 NA $out [1] 4.07 4.07 4.88 $group [1] 2 2 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(4, 4, 4, 4.065, 4.07, 4.3, 4.37, 4.52, 4.53, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79h321368881956.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,] 4.513333 4.580 4.501250 [2,] 4.580000 4.625 4.626875 [3,] 4.647500 4.680 4.728750 [4,] 4.664167 4.685 4.733750 [5,] 4.690000 4.755 4.751250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.609111 4.652634 4.680004 [2,] 4.685889 4.707366 4.777496 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4.51333333333333, 4.58, 4.6475, 4.66416666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1krgq1368881956.ps tmp/1krgq1368881956.png",intern=TRUE)) character(0) > try(system("convert tmp/2mgfs1368881956.ps tmp/2mgfs1368881956.png",intern=TRUE)) character(0) > try(system("convert tmp/3txxd1368881956.ps tmp/3txxd1368881956.png",intern=TRUE)) character(0) > try(system("convert tmp/4lx1j1368881956.ps tmp/4lx1j1368881956.png",intern=TRUE)) character(0) > try(system("convert tmp/5ro7g1368881956.ps tmp/5ro7g1368881956.png",intern=TRUE)) character(0) > try(system("convert tmp/6lokm1368881956.ps tmp/6lokm1368881956.png",intern=TRUE)) character(0) > try(system("convert tmp/79h321368881956.ps tmp/79h321368881956.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.262 0.922 5.559