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(5.06,5.05,5.05,5.04,5.06,5.07,5.09,5.08,5.09,5.09,5.09,5.1,5.12,5.14,5.14,5.14,5.13,5.15,5.16,5.17,5.17,5.18,5.21,5.19,5.22,5.24,5.21,5.24,5.28,5.3,5.32,5.32,5.29,5.3,5.32,5.31,5.35,5.36,5.33,5.35,5.35,5.35,5.37,5.39,5.4,5.39,5.4,5.4,5.4,5.38,5.32,5.36,5.35,5.39,5.4,5.41,5.36,5.38,5.41,5.35,5.4,5.41,5.42,5.41,5.41,5.42,5.4,5.42,5.41,5.34,5.46,5.45,5.47,5.48,5.43,5.5,5.51,5.51,5.52,5.55,5.55,5.48,5.61,5.59,5.68,5.71,5.68,5.7,5.76,5.78,5.77,5.85,5.82,5.84,5.89,5.84) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5.06 5.12 5.22 5.35 5.40 5.40 5.47 5.68 NA [2,] 5.05 5.14 5.24 5.36 5.38 5.41 5.48 5.71 NA [3,] 5.05 5.14 5.21 5.33 5.32 5.42 5.43 5.68 NA [4,] 5.04 5.14 5.24 5.35 5.36 5.41 5.50 5.70 NA [5,] 5.06 5.13 5.28 5.35 5.35 5.41 5.51 5.76 NA [6,] 5.07 5.15 5.30 5.35 5.39 5.42 5.51 5.78 NA [7,] 5.09 5.16 5.32 5.37 5.40 5.40 5.52 5.77 NA [8,] 5.08 5.17 5.32 5.39 5.41 5.42 5.55 5.85 NA [9,] 5.09 5.17 5.29 5.40 5.36 5.41 5.55 5.82 NA [10,] 5.09 5.18 5.30 5.39 5.38 5.34 5.48 5.84 NA [11,] 5.09 5.21 5.32 5.40 5.41 5.46 5.61 5.89 NA [12,] 5.10 5.19 5.31 5.40 5.35 5.45 5.59 5.84 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.01 0.02 0.02 0.01 -0.02 0.01 0.01 0.03 NA [2,] 0.00 0.00 -0.03 -0.03 -0.06 0.01 -0.05 -0.03 NA [3,] -0.01 0.00 0.03 0.02 0.04 -0.01 0.07 0.02 NA [4,] 0.02 -0.01 0.04 0.00 -0.01 0.00 0.01 0.06 NA [5,] 0.01 0.02 0.02 0.00 0.04 0.01 0.00 0.02 NA [6,] 0.02 0.01 0.02 0.02 0.01 -0.02 0.01 -0.01 NA [7,] -0.01 0.01 0.00 0.02 0.01 0.02 0.03 0.08 NA [8,] 0.01 0.00 -0.03 0.01 -0.05 -0.01 0.00 -0.03 NA [9,] 0.00 0.01 0.01 -0.01 0.02 -0.07 -0.07 0.02 NA [10,] 0.00 0.03 0.02 0.01 0.03 0.12 0.13 0.05 NA [11,] 0.01 -0.02 -0.01 0.00 -0.06 -0.01 -0.02 -0.05 NA [12,] 0.02 0.03 0.04 0.00 0.05 0.02 0.09 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/1t59e1413829558.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/2v95v1413829558.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/3t9yi1413829558.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/4z41d1413829558.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,] 5.060 5.050 5.050 5.040 5.060 5.070 5.090 5.080 5.09 5.090 5.090 5.100 [2,] 5.170 5.190 5.175 5.190 5.205 5.225 5.240 5.245 5.23 5.240 5.265 5.250 [3,] 5.375 5.370 5.325 5.355 5.350 5.370 5.385 5.400 5.38 5.360 5.405 5.375 [4,] 5.435 5.445 5.425 5.455 5.460 5.465 5.460 5.485 5.48 5.435 5.535 5.520 [5,] 5.680 5.710 5.680 5.700 5.760 5.780 5.770 5.550 5.82 5.480 5.890 5.840 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5.226967 5.227553 5.185346 5.206967 5.207553 5.235933 5.262105 5.265933 [2,] 5.523033 5.512447 5.464654 5.503033 5.492447 5.504067 5.507895 5.534067 [,9] [,10] [,11] [,12] [1,] 5.240346 5.25107 5.254174 5.224174 [2,] 5.519654 5.46893 5.555826 5.525826 $out [1] 5.85 5.84 $group [1] 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5.06, 5.17, 5.375, 5.435, 5.68, 5.05, 5.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53ps01413829558.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] [1,] -0.02 -0.06 -0.010 -0.010 0.000 -2.000000e-02 -0.010 -0.050 -0.070 0.000 [2,] 0.00 -0.04 -0.005 -0.005 0.005 -4.440892e-16 0.005 -0.030 -0.040 0.015 [3,] 0.01 -0.03 0.020 0.005 0.015 1.000000e-02 0.015 -0.005 0.005 0.030 [4,] 0.02 0.00 0.035 0.030 0.020 2.000000e-02 0.025 0.005 0.015 0.085 [5,] 0.03 0.01 0.070 0.060 0.040 2.000000e-02 0.030 0.010 0.020 0.130 [,11] [,12] [1,] -0.060 0.000 [2,] -0.035 0.020 [3,] -0.015 0.030 [4,] -0.005 0.045 [5,] 0.010 0.050 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.001172287 -0.052344574 -0.002344574 -0.0145515 0.006620785 -0.001172287 [2,] 0.021172287 -0.007655426 0.042344574 0.0245515 0.023379215 0.021172287 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.003827713 -0.0245515 -0.02572379 -0.009103005 -0.031758431 0.0150704 [2,] 0.026172287 0.0145515 0.03572379 0.069103005 0.001758431 0.0449296 $out [1] 0.08 0.09 $group [1] 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0200000000000005, 0, 0.0100000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qxeg1413829558.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] [,8] [,9] [1,] 5.040 5.120 5.210 5.330 5.320 5.400 5.43 5.680 NA [2,] 5.055 5.140 5.240 5.350 5.355 5.405 5.48 5.705 NA [3,] 5.075 5.155 5.295 5.365 5.380 5.410 5.51 5.775 NA [4,] 5.090 5.175 5.315 5.395 5.400 5.420 5.55 5.840 NA [5,] 5.100 5.210 5.320 5.400 5.410 5.420 5.61 5.890 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5.059036 5.139036 5.260792 5.344475 5.359475 5.403158 5.478073 5.713426 [2,] 5.090964 5.170964 5.329208 5.385525 5.400525 5.416842 5.541927 5.836574 [,9] [1,] NA [2,] NA $out [1] 5.34 5.46 5.45 $group [1] 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(5.04, 5.055, 5.075, 5.09, 5.1, 5.12, 5.14, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7l1oq1413829558.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,] 5.322500 5.3250 5.306250 [2,] 5.344375 5.3575 5.322500 [3,] 5.373125 5.3725 5.346875 [4,] 5.392500 5.3825 5.361250 [5,] 5.423750 5.4050 5.395000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.351175 5.361097 5.329201 [2,] 5.395075 5.383903 5.364549 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(5.3225, 5.344375, 5.373125, 5.3925, 5.42375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1t59e1413829558.ps tmp/1t59e1413829558.png",intern=TRUE)) character(0) > try(system("convert tmp/2v95v1413829558.ps tmp/2v95v1413829558.png",intern=TRUE)) character(0) > try(system("convert tmp/3t9yi1413829558.ps tmp/3t9yi1413829558.png",intern=TRUE)) character(0) > try(system("convert tmp/4z41d1413829558.ps tmp/4z41d1413829558.png",intern=TRUE)) character(0) > try(system("convert tmp/53ps01413829558.ps tmp/53ps01413829558.png",intern=TRUE)) character(0) > try(system("convert tmp/6qxeg1413829558.ps tmp/6qxeg1413829558.png",intern=TRUE)) character(0) > try(system("convert tmp/7l1oq1413829558.ps tmp/7l1oq1413829558.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.518 0.382 2.939