R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" 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(3.65,3.66,3.69,3.7,3.7,3.71,3.71,3.71,3.72,3.72,3.73,3.74,3.78,3.78,3.79,3.79,3.8,3.81,3.83,3.84,3.88,3.91,3.96,3.96,3.97,3.98,3.99,3.99,4,4,4.02,4.02,4.02,4.03,4.03,4.03,4.04,4.04,4.05,4.05,4.05,4.05,4.06,4.06,4.06,4.06,4.07,4.07,4.08,4.08,4.08,4.09,4.09,4.09,4.09,4.1,4.1,4.11,4.11,4.12,4.12,4.12,4.12,4.12,4.15,4.15,4.15,4.15,4.16,4.16,4.16,4.2) > 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,] 3.65 3.78 3.97 4.04 4.08 4.12 NA [2,] 3.66 3.78 3.98 4.04 4.08 4.12 NA [3,] 3.69 3.79 3.99 4.05 4.08 4.12 NA [4,] 3.70 3.79 3.99 4.05 4.09 4.12 NA [5,] 3.70 3.80 4.00 4.05 4.09 4.15 NA [6,] 3.71 3.81 4.00 4.05 4.09 4.15 NA [7,] 3.71 3.83 4.02 4.06 4.09 4.15 NA [8,] 3.71 3.84 4.02 4.06 4.10 4.15 NA [9,] 3.72 3.88 4.02 4.06 4.10 4.16 NA [10,] 3.72 3.91 4.03 4.06 4.11 4.16 NA [11,] 3.73 3.96 4.03 4.07 4.11 4.16 NA [12,] 3.74 3.96 4.03 4.07 4.12 4.20 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.01 0.00 0.01 0.00 0.00 0.00 NA [2,] 0.03 0.01 0.01 0.01 0.00 0.00 NA [3,] 0.01 0.00 0.00 0.00 0.01 0.00 NA [4,] 0.00 0.01 0.01 0.00 0.00 0.03 NA [5,] 0.01 0.01 0.00 0.00 0.00 0.00 NA [6,] 0.00 0.02 0.02 0.01 0.00 0.00 NA [7,] 0.00 0.01 0.00 0.00 0.01 0.00 NA [8,] 0.01 0.04 0.00 0.00 0.00 0.01 NA [9,] 0.00 0.03 0.01 0.00 0.01 0.00 NA [10,] 0.01 0.05 0.00 0.01 0.00 0.00 NA [11,] 0.01 0.00 0.00 0.00 0.01 0.04 NA [12,] 0.04 0.01 0.01 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/16ddb1350631965.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/2ukz01350631965.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/34xvn1350631965.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/4fsk21350631965.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,] 3.650 3.66 3.69 3.70 3.700 3.710 3.71 3.71 3.72 3.720 3.96 3.74 [2,] 3.780 3.78 3.79 3.79 3.800 3.810 3.83 3.84 3.88 3.910 3.96 3.96 [3,] 4.005 4.01 4.02 4.02 4.025 4.025 4.04 4.04 4.04 4.045 4.05 4.05 [4,] 4.080 4.08 4.08 4.09 4.090 4.090 4.09 4.10 4.10 4.110 4.11 4.12 [5,] 4.120 4.12 4.12 4.12 4.150 4.150 4.15 4.15 4.16 4.160 4.16 4.20 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3.81149 3.81649 3.832941 3.82649 3.837941 3.844391 3.872292 3.872292 [2,] 4.19851 4.20351 4.207059 4.21351 4.212059 4.205609 4.207708 4.207708 [,9] [,10] [,11] [,12] [1,] 3.898093 3.915994 3.953245 3.946795 [2,] 4.181907 4.174006 4.146755 4.153205 $out [1] 3.73 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3.65, 3.78, 4.005, 4.08, 4.12, 3.66, 3.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/593s41350631965.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.00 0.00 0.00 0.000 0.00 0.000 0.00 0.000 0.000 0.000 0.000 0.01 [2,] 0.00 0.00 0.00 0.000 0.00 0.000 0.00 0.000 0.000 0.000 0.000 0.01 [3,] 0.00 0.01 0.00 0.005 0.00 0.005 0.00 0.005 0.005 0.005 0.005 0.01 [4,] 0.01 0.01 0.01 0.010 0.01 0.020 0.01 0.010 0.010 0.010 0.010 0.01 [5,] 0.01 0.01 0.01 0.010 0.01 0.020 0.01 0.010 0.010 0.010 0.010 0.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.006450323 0.003549677 -0.006450323 -0.001450323 -0.006450323 [2,] 0.006450323 0.016450323 0.006450323 0.011450323 0.006450323 [,6] [,7] [,8] [,9] [,10] [1,] -0.007900646 -0.006450323 -0.001450323 -0.001450323 -0.001450323 [2,] 0.017900646 0.006450323 0.011450323 0.011450323 0.011450323 [,11] [,12] [1,] -0.001450323 0.01 [2,] 0.011450323 0.01 $out [1] 0.03 0.03 0.04 0.03 0.05 0.04 0.04 0.00 $group [1] 2 4 8 9 10 11 12 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, 0.00999999999999979, 0.0100000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q7bn1350631965.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,] 3.660 3.780 3.970 4.040 4.080 4.12 NA [2,] 3.695 3.790 3.990 4.050 4.085 4.12 NA [3,] 3.710 3.820 4.010 4.055 4.090 4.15 NA [4,] 3.720 3.895 4.025 4.060 4.105 4.16 NA [5,] 3.740 3.960 4.030 4.070 4.120 4.20 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.698597 3.772109 3.994036 4.050439 4.080878 4.131756 NA [2,] 3.721403 3.867891 4.025964 4.059561 4.099122 4.168244 NA $out [1] 3.65 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(3.66, 3.695, 3.71, 3.72, 3.74, 3.78, 3.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7oknw1350631965.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,] 3.940000 4.0050 3.948750 [2,] 3.955000 4.0200 3.958125 [3,] 3.972500 4.0325 3.974375 [4,] 3.994167 4.0425 4.010625 [5,] 4.020000 4.0500 4.042500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.954636 4.022238 3.950429 [2,] 3.990364 4.042762 3.998321 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3.94, 3.955, 3.9725, 3.99416666666667, 4.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16ddb1350631965.ps tmp/16ddb1350631965.png",intern=TRUE)) character(0) > try(system("convert tmp/2ukz01350631965.ps tmp/2ukz01350631965.png",intern=TRUE)) character(0) > try(system("convert tmp/34xvn1350631965.ps tmp/34xvn1350631965.png",intern=TRUE)) character(0) > try(system("convert tmp/4fsk21350631965.ps tmp/4fsk21350631965.png",intern=TRUE)) character(0) > try(system("convert tmp/593s41350631965.ps tmp/593s41350631965.png",intern=TRUE)) character(0) > try(system("convert tmp/6q7bn1350631965.ps tmp/6q7bn1350631965.png",intern=TRUE)) character(0) > try(system("convert tmp/7oknw1350631965.ps tmp/7oknw1350631965.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.384 0.739 4.113