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(0.9,0.9,0.9,0.9,0.9,0.91,0.91,0.91,0.91,0.91,0.92,0.92,0.92,0.92,0.92,0.93,0.93,0.93,0.93,0.93,0.92,0.93,0.93,0.93,0.94,0.95,0.95,0.96,0.97,0.97,0.97,0.98,0.98,0.98,0.98,0.98,0.98,1,1.01,1.01,1.02,1.02,1.02,1.02,1.03,1.03,1.03,1.03,1.03,1.04,1.05,1.05,1.05,1.05,1.06,1.06,1.06,1.06,1.06,1.06,1.06,1.07,1.08,1.09,1.09,1.09,1.09,1.09,1.09,1.09,1.09,1.09) > 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,] 0.90 0.92 0.94 0.98 1.03 1.06 NA [2,] 0.90 0.92 0.95 1.00 1.04 1.07 NA [3,] 0.90 0.92 0.95 1.01 1.05 1.08 NA [4,] 0.90 0.93 0.96 1.01 1.05 1.09 NA [5,] 0.90 0.93 0.97 1.02 1.05 1.09 NA [6,] 0.91 0.93 0.97 1.02 1.05 1.09 NA [7,] 0.91 0.93 0.97 1.02 1.06 1.09 NA [8,] 0.91 0.93 0.98 1.02 1.06 1.09 NA [9,] 0.91 0.92 0.98 1.03 1.06 1.09 NA [10,] 0.91 0.93 0.98 1.03 1.06 1.09 NA [11,] 0.92 0.93 0.98 1.03 1.06 1.09 NA [12,] 0.92 0.93 0.98 1.03 1.06 1.09 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.00 0.01 0.02 0.01 0.01 NA [2,] 0.00 0.00 0.00 0.01 0.01 0.01 NA [3,] 0.00 0.01 0.01 0.00 0.00 0.01 NA [4,] 0.00 0.00 0.01 0.01 0.00 0.00 NA [5,] 0.01 0.00 0.00 0.00 0.00 0.00 NA [6,] 0.00 0.00 0.00 0.00 0.01 0.00 NA [7,] 0.00 0.00 0.01 0.00 0.00 0.00 NA [8,] 0.00 -0.01 0.00 0.01 0.00 0.00 NA [9,] 0.00 0.01 0.00 0.00 0.00 0.00 NA [10,] 0.01 0.00 0.00 0.00 0.00 0.00 NA [11,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [12,] 0.00 0.01 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/1zbim1350402112.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/2zras1350402112.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/3sep81350402112.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/485gs1350402112.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,] 0.90 0.900 0.90 0.900 0.900 0.910 0.910 0.91 0.910 0.910 0.920 0.920 [2,] 0.92 0.920 0.92 0.930 0.930 0.930 0.930 0.93 0.920 0.930 0.930 0.930 [3,] 0.96 0.975 0.98 0.985 0.995 0.995 0.995 1.00 1.005 1.005 1.005 1.005 [4,] 1.03 1.040 1.05 1.050 1.050 1.050 1.060 1.06 1.060 1.060 1.060 1.060 [5,] 1.06 1.070 1.08 1.090 1.090 1.090 1.090 1.09 1.090 1.090 1.090 1.090 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.8890464 0.8975961 0.8961458 0.9075961 0.9175961 0.9175961 0.9111458 [2,] 1.0309536 1.0524039 1.0638542 1.0624039 1.0724039 1.0724039 1.0788542 [,8] [,9] [,10] [,11] [,12] [1,] 0.9161458 0.9146955 0.9211458 0.9211458 0.9211458 [2,] 1.0838542 1.0953045 1.0888542 1.0888542 1.0888542 $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(0.9, 0.92, 0.96, 1.03, 1.06, 0.9, 0.92, 0.975, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gfgq1350402112.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.000 0.000 0.00 0 0 0 0 0 0 0 0 [2,] 0.00 0.000 0.000 0.00 0 0 0 0 0 0 0 0 [3,] 0.01 0.005 0.005 0.00 0 0 0 0 0 0 0 0 [4,] 0.01 0.010 0.010 0.01 0 0 0 0 0 0 0 0 [5,] 0.02 0.010 0.010 0.01 0 0 0 0 0 0 0 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.003549677 -0.001450323 -0.001450323 -0.006450323 0 0 0 0 [2,] 0.016450323 0.011450323 0.011450323 0.006450323 0 0 0 0 [,9] [,10] [,11] [,12] [1,] 0 0 0 0 [2,] 0 0 0 0 $out [1] 0.01 0.01 0.01 -0.01 0.01 0.01 0.01 0.01 $group [1] 5 6 7 8 8 9 10 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.01, 0.01, 0.02, 0, 0, 0.005, 0.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6k7vc1350402112.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,] 0.90 0.92 0.940 0.98 1.040 1.080 NA [2,] 0.90 0.92 0.955 1.01 1.050 1.085 NA [3,] 0.91 0.93 0.970 1.02 1.055 1.090 NA [4,] 0.91 0.93 0.980 1.03 1.060 1.090 NA [5,] 0.92 0.93 0.980 1.03 1.060 1.090 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9054389 0.9254389 0.9585973 1.010878 1.050439 1.087719 NA [2,] 0.9145611 0.9345611 0.9814027 1.029122 1.059561 1.092281 NA $out [1] 1.03 1.06 1.07 $group [1] 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.9, 0.9, 0.91, 0.91, 0.92, 0.92, 0.92, 0.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7db1z1350402112.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,] 0.9716667 0.9600 0.971250 [2,] 0.9875000 0.9825 0.986250 [3,] 0.9958333 0.9950 0.992500 [4,] 0.9991667 1.0050 0.996875 [5,] 1.0016667 1.0050 0.997500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.9905121 0.9847376 0.9876539 [2,] 1.0011546 1.0052624 0.9973461 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(0.971666666666667, 0.9875, 0.995833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zbim1350402112.ps tmp/1zbim1350402112.png",intern=TRUE)) character(0) > try(system("convert tmp/2zras1350402112.ps tmp/2zras1350402112.png",intern=TRUE)) character(0) > try(system("convert tmp/3sep81350402112.ps tmp/3sep81350402112.png",intern=TRUE)) character(0) > try(system("convert tmp/485gs1350402112.ps tmp/485gs1350402112.png",intern=TRUE)) character(0) > try(system("convert tmp/5gfgq1350402112.ps tmp/5gfgq1350402112.png",intern=TRUE)) character(0) > try(system("convert tmp/6k7vc1350402112.ps tmp/6k7vc1350402112.png",intern=TRUE)) character(0) > try(system("convert tmp/7db1z1350402112.ps tmp/7db1z1350402112.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.412 0.726 4.129