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(8.41,8.39,8.43,8.44,8.49,8.47,8.53,8.52,8.51,8.53,8.54,8.53,8.47,8.63,8.67,8.73,8.57,8.55,8.63,8.65,8.44,8.62,8.37,8.59,8.84,8.72,8.8,8.69,8.68,8.57,8.85,8.85,8.85,8.93,8.75,8.78,8.77,9.03,9.01,9.07,8.99,9.02,8.99,8.98,8.94,8.94,8.75,8.86,8.87,8.84,8.84,9.91,10.18,10.34,10.36,10.26,10.16,10.31,10.46,10.54,10.47,10.48,10.46,11.3,11.58,11.69,11.63,11.51,11.37,11.42,11.7,11.75,11.43,11.36,11.3,11.85,11.99,12.07,12.21,12.13,12.3,12.27,12.32,12.38,12.4,12.33,12.25,12.41,12.38,12.58,12.45,12.43,12.38,12.34,11.98,12.24) > 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,] 8.41 8.47 8.84 8.77 8.87 10.47 11.43 12.40 NA [2,] 8.39 8.63 8.72 9.03 8.84 10.48 11.36 12.33 NA [3,] 8.43 8.67 8.80 9.01 8.84 10.46 11.30 12.25 NA [4,] 8.44 8.73 8.69 9.07 9.91 11.30 11.85 12.41 NA [5,] 8.49 8.57 8.68 8.99 10.18 11.58 11.99 12.38 NA [6,] 8.47 8.55 8.57 9.02 10.34 11.69 12.07 12.58 NA [7,] 8.53 8.63 8.85 8.99 10.36 11.63 12.21 12.45 NA [8,] 8.52 8.65 8.85 8.98 10.26 11.51 12.13 12.43 NA [9,] 8.51 8.44 8.85 8.94 10.16 11.37 12.30 12.38 NA [10,] 8.53 8.62 8.93 8.94 10.31 11.42 12.27 12.34 NA [11,] 8.54 8.37 8.75 8.75 10.46 11.70 12.32 11.98 NA [12,] 8.53 8.59 8.78 8.86 10.54 11.75 12.38 12.24 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.02 0.16 -0.12 0.26 -0.03 0.01 -0.07 -0.07 NA [2,] 0.04 0.04 0.08 -0.02 0.00 -0.02 -0.06 -0.08 NA [3,] 0.01 0.06 -0.11 0.06 1.07 0.84 0.55 0.16 NA [4,] 0.05 -0.16 -0.01 -0.08 0.27 0.28 0.14 -0.03 NA [5,] -0.02 -0.02 -0.11 0.03 0.16 0.11 0.08 0.20 NA [6,] 0.06 0.08 0.28 -0.03 0.02 -0.06 0.14 -0.13 NA [7,] -0.01 0.02 0.00 -0.01 -0.10 -0.12 -0.08 -0.02 NA [8,] -0.01 -0.21 0.00 -0.04 -0.10 -0.14 0.17 -0.05 NA [9,] 0.02 0.18 0.08 0.00 0.15 0.05 -0.03 -0.04 NA [10,] 0.01 -0.25 -0.18 -0.19 0.15 0.28 0.05 -0.36 NA [11,] -0.01 0.22 0.03 0.11 0.08 0.05 0.06 0.26 NA [12,] -0.06 0.25 -0.01 0.01 -0.07 -0.32 0.02 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/1s36z1424981223.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/2of2b1424981223.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/3rluy1424981223.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/4gu891424981223.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] [1,] 8.410 8.390 8.430 8.440 8.490 8.47 8.530 8.52 8.440 8.530 8.370 [2,] 8.620 8.675 8.735 8.710 8.625 8.56 8.740 8.75 8.680 8.775 8.645 [3,] 8.855 8.935 8.925 9.490 9.585 9.68 9.675 9.62 9.550 9.625 9.605 [4,] 10.950 10.920 10.880 11.575 11.785 11.88 11.920 11.82 11.835 11.845 11.840 [5,] 12.400 12.330 12.250 12.410 12.380 12.58 12.450 12.43 12.380 12.340 12.320 [,12] [1,] 8.530 [2,] 8.685 [3,] 9.700 [4,] 11.995 [5,] 12.380 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 7.553429 7.680911 7.726772 7.88957 7.819779 7.8254 7.898606 [2,] 10.156571 10.189089 10.123228 11.09043 11.350221 11.5346 11.451394 [,8] [,9] [,10] [,11] [,12] [1,] 7.905054 7.787572 7.910054 7.820227 7.850986 [2,] 11.334946 11.312428 11.339946 11.389773 11.549014 $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(8.41, 8.62, 8.855, 10.95, 12.4, 8.39, 8.675, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s9fi1424981223.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.120 -0.08 -0.110 -0.160 -0.110 -0.130 -0.120 -0.210 -0.040 -0.360 [2,] -0.070 -0.04 0.035 -0.055 -0.020 -0.045 -0.090 -0.120 -0.015 -0.220 [3,] -0.025 -0.01 0.110 0.020 0.055 0.040 -0.015 -0.045 0.035 -0.085 [4,] 0.085 0.04 0.695 0.205 0.135 0.110 -0.005 -0.005 0.115 0.100 [5,] 0.260 0.08 1.070 0.280 0.200 0.280 0.020 0.000 0.180 0.280 [,11] [,12] [1,] -0.010 -0.070 [2,] 0.040 -0.065 [3,] 0.070 -0.010 [4,] 0.165 0.015 [5,] 0.260 0.020 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.11158523 -0.05468915 -0.2586855 -0.1252397 -0.03158523 -0.04658523 [2,] 0.06158523 0.03468915 0.4786855 0.1652397 0.14158523 0.12658523 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.06248222 -0.10924065 -0.03761987 -0.26375659 0.0001732054 -0.05777471 [2,] 0.03248222 0.01924065 0.10761987 0.09375659 0.1398267946 0.03777471 $out [1] 0.17 0.25 -0.32 $group [1] 8 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.119999999999999, -0.0700000000000003, -0.0249999999999995, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6usmx1424981223.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,] 8.390 8.370 8.570 8.750 8.84 10.460 11.300 12.24 NA [2,] 8.435 8.510 8.705 8.900 9.39 10.890 11.640 12.29 NA [3,] 8.500 8.605 8.790 8.985 10.22 11.465 12.100 12.38 NA [4,] 8.530 8.640 8.850 9.015 10.35 11.660 12.285 12.42 NA [5,] 8.540 8.730 8.930 9.070 10.54 11.750 12.380 12.58 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 8.45667 8.545706 8.723865 8.932548 9.782138 11.1138 11.80581 12.32071 [2,] 8.54333 8.664294 8.856135 9.037452 10.657862 11.8162 12.39419 12.43929 [,9] [1,] NA [2,] NA $out [1] 11.98 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(8.39, 8.435, 8.5, 8.53, 8.54, 8.37, 8.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7igwt1424981223.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,] 9.70750 8.8550 9.69875 [2,] 9.88625 9.2125 9.89875 [3,] 10.11375 9.5950 10.17938 [4,] 10.16812 9.6500 10.23813 [5,] 10.20875 9.7000 10.30250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.985185 9.395453 10.02458 [2,] 10.242315 9.794547 10.33417 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(9.7075, 9.88625, 10.11375, 10.168125, 10.20875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1s36z1424981223.ps tmp/1s36z1424981223.png",intern=TRUE)) character(0) > try(system("convert tmp/2of2b1424981223.ps tmp/2of2b1424981223.png",intern=TRUE)) character(0) > try(system("convert tmp/3rluy1424981223.ps tmp/3rluy1424981223.png",intern=TRUE)) character(0) > try(system("convert tmp/4gu891424981223.ps tmp/4gu891424981223.png",intern=TRUE)) character(0) > try(system("convert tmp/5s9fi1424981223.ps tmp/5s9fi1424981223.png",intern=TRUE)) character(0) > try(system("convert tmp/6usmx1424981223.ps tmp/6usmx1424981223.png",intern=TRUE)) character(0) > try(system("convert tmp/7igwt1424981223.ps tmp/7igwt1424981223.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.572 0.412 3.012