R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 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(0.978,0.973,0.96,0.978,0.985,1.035,1.015,1.05,1.022,1.042,1.058,1.056,1.098,1.097,1.139,1.182,1.189,1.191,1.168,1.168,1.177,1.184,1.2,1.251,1.288,1.313,1.363,1.377,1.342,1.334,1.348,1.327,1.349,1.361,1.393,1.38,1.421,1.432,1.457,1.453,1.428,1.383,1.408,1.458,1.474,1.491,1.476,1.446,1.451,1.472,1.449,1.415,1.39,1.394,1.418,1.426,1.437,1.406,1.387,1.404) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.978 1.098 1.288 1.421 1.451 NA [2,] 0.973 1.097 1.313 1.432 1.472 NA [3,] 0.960 1.139 1.363 1.457 1.449 NA [4,] 0.978 1.182 1.377 1.453 1.415 NA [5,] 0.985 1.189 1.342 1.428 1.390 NA [6,] 1.035 1.191 1.334 1.383 1.394 NA [7,] 1.015 1.168 1.348 1.408 1.418 NA [8,] 1.050 1.168 1.327 1.458 1.426 NA [9,] 1.022 1.177 1.349 1.474 1.437 NA [10,] 1.042 1.184 1.361 1.491 1.406 NA [11,] 1.058 1.200 1.393 1.476 1.387 NA [12,] 1.056 1.251 1.380 1.446 1.404 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.005 -0.001 0.025 0.011 0.021 NA [2,] -0.013 0.042 0.050 0.025 -0.023 NA [3,] 0.018 0.043 0.014 -0.004 -0.034 NA [4,] 0.007 0.007 -0.035 -0.025 -0.025 NA [5,] 0.050 0.002 -0.008 -0.045 0.004 NA [6,] -0.020 -0.023 0.014 0.025 0.024 NA [7,] 0.035 0.000 -0.021 0.050 0.008 NA [8,] -0.028 0.009 0.022 0.016 0.011 NA [9,] 0.020 0.007 0.012 0.017 -0.031 NA [10,] 0.016 0.016 0.032 -0.015 -0.019 NA [11,] -0.002 0.051 -0.013 -0.030 0.017 NA [12,] 0.042 0.037 0.041 0.005 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/1d9vl1398957492.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/2vsp21398957492.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/3hs2i1398957492.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/4i4qh1398957492.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.978 0.973 0.960 0.978 0.985 1.035 1.015 1.050 1.022 1.042 1.058 1.056 [2,] 1.098 1.097 1.139 1.182 1.189 1.191 1.168 1.168 1.177 1.184 1.200 1.251 [3,] 1.288 1.313 1.363 1.377 1.342 1.334 1.348 1.327 1.349 1.361 1.387 1.380 [4,] 1.421 1.432 1.449 1.415 1.390 1.383 1.408 1.426 1.437 1.406 1.393 1.404 [5,] 1.451 1.472 1.457 1.453 1.428 1.394 1.418 1.458 1.474 1.491 1.476 1.446 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.059769 1.07629 1.143955 1.212363 1.199974 1.198333 1.178417 1.144698 [2,] 1.516231 1.54971 1.582045 1.541637 1.484026 1.469667 1.517583 1.509302 [,9] [,10] [,11] [,12] [1,] 1.165285 1.204135 1.250627 1.271891 [2,] 1.532715 1.517865 1.523373 1.488109 $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.978, 1.098, 1.288, 1.421, 1.451, 0.973, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dwvw1398957492.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] [1,] -0.005 -0.023 -0.034 -0.035 -0.008 -0.023 -0.021 0.009 0.007 -0.019 -0.030 [2,] -0.001 -0.013 -0.004 -0.025 -0.008 -0.020 0.000 0.009 0.007 -0.015 -0.013 [3,] 0.011 0.025 0.014 -0.025 0.002 0.014 0.008 0.011 0.012 0.016 -0.002 [4,] 0.021 0.042 0.018 0.007 0.004 0.024 0.035 0.016 0.017 0.016 0.017 [5,] 0.025 0.050 0.043 0.007 0.004 0.025 0.050 0.022 0.020 0.032 0.051 [,12] [1,] 0.0050 [2,] 0.0210 [3,] 0.0390 [4,] 0.0415 [5,] 0.0420 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.004545145 -0.01386286 -0.001545145 -0.047611119 -0.00647917 -0.01709029 [2,] 0.026545145 0.06386286 0.029545145 -0.002388881 0.01047917 0.04509029 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.01673091 0.006053818 0.004934025 -0.005904522 -0.02319792 0.022805 [2,] 0.03273091 0.015946182 0.019065975 0.037904522 0.01919792 0.055195 $out [1] 0.050 -0.045 -0.028 -0.031 $group [1] 5 5 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.005, -0.00100000000000011, 0.0109999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68tbs1398957492.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] [1,] 0.9600 1.1390 1.2880 1.3830 1.3870 NA [2,] 0.9780 1.1535 1.3305 1.4245 1.3990 NA [3,] 1.0185 1.1795 1.3485 1.4495 1.4165 NA [4,] 1.0460 1.1900 1.3700 1.4660 1.4430 NA [5,] 1.0580 1.2000 1.3930 1.4910 1.4720 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.9874847 1.162852 1.330484 1.430572 1.396431 NA [2,] 1.0495153 1.196148 1.366516 1.468428 1.436569 NA $out [1] 1.098 1.097 1.251 $group [1] 2 2 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(0.96, 0.978, 1.0185, 1.046, 1.058, 1.139, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7aq4u1398957492.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,] 1.2472 1.2880 1.28700 [2,] 1.2671 1.3305 1.28750 [3,] 1.2773 1.3485 1.29450 [4,] 1.2943 1.3700 1.29775 [5,] 1.3074 1.3870 1.30700 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.264894 1.330484 1.289825 [2,] 1.289706 1.366516 1.299175 $out [1] 1.2595 1.2645 1.3275 $group [1] 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.2472, 1.2671, 1.2773, 1.2943, 1.3074, 1.288, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d9vl1398957492.ps tmp/1d9vl1398957492.png",intern=TRUE)) character(0) > try(system("convert tmp/2vsp21398957492.ps tmp/2vsp21398957492.png",intern=TRUE)) character(0) > try(system("convert tmp/3hs2i1398957492.ps tmp/3hs2i1398957492.png",intern=TRUE)) character(0) > try(system("convert tmp/4i4qh1398957492.ps tmp/4i4qh1398957492.png",intern=TRUE)) character(0) > try(system("convert tmp/5dwvw1398957492.ps tmp/5dwvw1398957492.png",intern=TRUE)) character(0) > try(system("convert tmp/68tbs1398957492.ps tmp/68tbs1398957492.png",intern=TRUE)) character(0) > try(system("convert tmp/7aq4u1398957492.ps tmp/7aq4u1398957492.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.599 0.782 5.407