R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(1.11,1.11,1.2,1.21,1.31,1.37,1.37,1.26,1.23,1.17,1.06,0.95,0.92,0.92,0.9,0.93,0.93,0.97,0.96,0.99,0.98,0.96,1,0.99,1.03,1.02,1.07,1.13,1.15,1.16,1.14,1.15,1.15,1.16,1.17,1.22,1.26,1.29,1.36,1.38,1.37,1.37,1.37,1.36,1.38,1.4,1.44,1.42,1.45,1.45,1.49,1.48,1.44,1.39,1.41,1.48,1.51,1.49,1.46,1.43,1.42,1.43,1.42,1.39,1.36,1.36,1.39,1.39,1.43,1.38,1.36,1.38) > 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,] 1.11 0.92 1.03 1.26 1.45 1.42 NA [2,] 1.11 0.92 1.02 1.29 1.45 1.43 NA [3,] 1.20 0.90 1.07 1.36 1.49 1.42 NA [4,] 1.21 0.93 1.13 1.38 1.48 1.39 NA [5,] 1.31 0.93 1.15 1.37 1.44 1.36 NA [6,] 1.37 0.97 1.16 1.37 1.39 1.36 NA [7,] 1.37 0.96 1.14 1.37 1.41 1.39 NA [8,] 1.26 0.99 1.15 1.36 1.48 1.39 NA [9,] 1.23 0.98 1.15 1.38 1.51 1.43 NA [10,] 1.17 0.96 1.16 1.40 1.49 1.38 NA [11,] 1.06 1.00 1.17 1.44 1.46 1.36 NA [12,] 0.95 0.99 1.22 1.42 1.43 1.38 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.00 -0.01 0.03 0.00 0.01 NA [2,] 0.09 -0.02 0.05 0.07 0.04 -0.01 NA [3,] 0.01 0.03 0.06 0.02 -0.01 -0.03 NA [4,] 0.10 0.00 0.02 -0.01 -0.04 -0.03 NA [5,] 0.06 0.04 0.01 0.00 -0.05 0.00 NA [6,] 0.00 -0.01 -0.02 0.00 0.02 0.03 NA [7,] -0.11 0.03 0.01 -0.01 0.07 0.00 NA [8,] -0.03 -0.01 0.00 0.02 0.03 0.04 NA [9,] -0.06 -0.02 0.01 0.02 -0.02 -0.05 NA [10,] -0.11 0.04 0.01 0.04 -0.03 -0.02 NA [11,] -0.11 -0.01 0.05 -0.02 -0.03 0.02 NA [12,] -0.03 0.04 0.04 0.03 -0.01 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/1a4wz1416130936.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/2igmd1416130936.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/3vr9g1416130936.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/4wfnl1416130936.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.920 0.92 0.90 0.930 0.930 0.970 0.96 0.99 0.980 0.960 1.000 0.95 [2,] 1.030 1.02 1.07 1.130 1.150 1.160 1.14 1.15 1.150 1.160 1.060 0.99 [3,] 1.185 1.20 1.28 1.295 1.335 1.365 1.37 1.31 1.305 1.275 1.265 1.30 [4,] 1.420 1.43 1.42 1.390 1.370 1.370 1.39 1.39 1.430 1.400 1.440 1.42 [5,] 1.450 1.45 1.49 1.480 1.440 1.390 1.41 1.48 1.510 1.490 1.460 1.43 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.9334374 0.9355368 1.054239 1.127292 1.193093 1.229543 1.208742 1.155192 [2,] 1.4365626 1.4644632 1.505761 1.462708 1.476907 1.500457 1.531258 1.464808 [,9] [,10] [,11] [,12] [1,] 1.124391 1.120192 1.019888 1.022636 [2,] 1.485609 1.429808 1.510112 1.577364 $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.92, 1.03, 1.185, 1.42, 1.45, 0.92, 1.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55dyy1416130936.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.01 -0.020 -0.030 -0.040 -0.050 -0.02 -0.010 -0.03 -0.06 -0.110 -0.030 [2,] 0.00 -0.010 -0.010 -0.030 0.000 -0.01 -0.010 -0.01 -0.05 -0.030 -0.030 [3,] 0.00 0.045 0.015 -0.005 0.005 0.00 0.005 0.01 -0.02 -0.005 -0.015 [4,] 0.01 0.070 0.030 0.020 0.040 0.02 0.030 0.03 0.01 0.040 0.020 [5,] 0.01 0.090 0.060 0.020 0.060 0.03 0.070 0.04 0.02 0.040 0.050 [,12] [1,] -0.03 [2,] -0.01 [3,] 0.03 [4,] 0.04 [5,] 0.04 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.006450323 -0.006602584 -0.01080129 -0.03725161 -0.02080129 -0.01935097 [2,] 0.006450323 0.096602584 0.04080129 0.02725161 0.03080129 0.01935097 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.02080129 -0.01580129 -0.05870194 -0.05015226 -0.04725161 -0.005329874 [2,] 0.03080129 0.03580129 0.01870194 0.04015226 0.01725161 0.065329874 $out [1] 0.03 0.10 -0.11 -0.11 $group [1] 1 4 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.01, 0, 0, 0.01, 0.01, -0.02, -0.01, 0.045, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68js71416130936.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.950 0.900 1.02 1.36 1.390 1.36 NA [2,] 1.110 0.925 1.10 1.36 1.435 1.37 NA [3,] 1.205 0.960 1.15 1.37 1.455 1.39 NA [4,] 1.285 0.985 1.16 1.39 1.485 1.42 NA [5,] 1.370 1.000 1.22 1.42 1.510 1.43 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.125181 0.9326336 1.122634 1.356317 1.432195 1.367195 NA [2,] 1.284819 0.9873664 1.177366 1.383683 1.477805 1.412805 NA $out [1] 1.26 1.29 1.44 $group [1] 4 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.95, 1.11, 1.205, 1.285, 1.37, 0.9, 0.925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7224p1416130936.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.198333 1.2000 1.21500 [2,] 1.235833 1.2700 1.24125 [3,] 1.256667 1.2975 1.27375 [4,] 1.270833 1.3225 1.28500 [5,] 1.280000 1.3700 1.29375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.240703 1.273554 1.253795 [2,] 1.272630 1.321446 1.293705 $out [1] 1.185 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.19833333333333, 1.23583333333333, 1.25666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1a4wz1416130936.ps tmp/1a4wz1416130936.png",intern=TRUE)) character(0) > try(system("convert tmp/2igmd1416130936.ps tmp/2igmd1416130936.png",intern=TRUE)) character(0) > try(system("convert tmp/3vr9g1416130936.ps tmp/3vr9g1416130936.png",intern=TRUE)) character(0) > try(system("convert tmp/4wfnl1416130936.ps tmp/4wfnl1416130936.png",intern=TRUE)) character(0) > try(system("convert tmp/55dyy1416130936.ps tmp/55dyy1416130936.png",intern=TRUE)) character(0) > try(system("convert tmp/68js71416130936.ps tmp/68js71416130936.png",intern=TRUE)) character(0) > try(system("convert tmp/7224p1416130936.ps tmp/7224p1416130936.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.455 0.502 2.985