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.38,1.96,1.36,1.24,1.35,1.23,1.09,1.08,1.33,1.35,1.38,1.5,1.47,2.09,1.52,1.29,1.52,1.27,1.35,1.29,1.41,1.39,1.45,1.53,1.45,2.11,1.53,1.38,1.54,1.35,1.29,1.33,1.47,1.47,1.54,1.59,1.5,2,1.51,1.4,1.62,1.44,1.29,1.28,1.4,1.39,1.46,1.49,1.45,2.05,1.59,1.42,1.73,1.39,1.23,1.37,1.51,1.47,1.5,1.54,1.54,2.15,1.62,1.4,1.65,1.49,1.45,1.45,1.51,1.48,1.56,1.57,1.57,2.28,1.7,1.56,1.8,1.56,1.51,1.46,1.51,1.55,1.57,1.64,1.58,2.16,1.77,1.54,1.64,1.53,1.49,1.43,1.52,1.56,1.59,1.64) > 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,] 1.38 1.47 1.45 1.50 1.45 1.54 1.57 1.58 NA [2,] 1.96 2.09 2.11 2.00 2.05 2.15 2.28 2.16 NA [3,] 1.36 1.52 1.53 1.51 1.59 1.62 1.70 1.77 NA [4,] 1.24 1.29 1.38 1.40 1.42 1.40 1.56 1.54 NA [5,] 1.35 1.52 1.54 1.62 1.73 1.65 1.80 1.64 NA [6,] 1.23 1.27 1.35 1.44 1.39 1.49 1.56 1.53 NA [7,] 1.09 1.35 1.29 1.29 1.23 1.45 1.51 1.49 NA [8,] 1.08 1.29 1.33 1.28 1.37 1.45 1.46 1.43 NA [9,] 1.33 1.41 1.47 1.40 1.51 1.51 1.51 1.52 NA [10,] 1.35 1.39 1.47 1.39 1.47 1.48 1.55 1.56 NA [11,] 1.38 1.45 1.54 1.46 1.50 1.56 1.57 1.59 NA [12,] 1.50 1.53 1.59 1.49 1.54 1.57 1.64 1.64 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.58 0.62 0.66 0.50 0.60 0.61 0.71 0.58 NA [2,] -0.60 -0.57 -0.58 -0.49 -0.46 -0.53 -0.58 -0.39 NA [3,] -0.12 -0.23 -0.15 -0.11 -0.17 -0.22 -0.14 -0.23 NA [4,] 0.11 0.23 0.16 0.22 0.31 0.25 0.24 0.10 NA [5,] -0.12 -0.25 -0.19 -0.18 -0.34 -0.16 -0.24 -0.11 NA [6,] -0.14 0.08 -0.06 -0.15 -0.16 -0.04 -0.05 -0.04 NA [7,] -0.01 -0.06 0.04 -0.01 0.14 0.00 -0.05 -0.06 NA [8,] 0.25 0.12 0.14 0.12 0.14 0.06 0.05 0.09 NA [9,] 0.02 -0.02 0.00 -0.01 -0.04 -0.03 0.04 0.04 NA [10,] 0.03 0.06 0.07 0.07 0.03 0.08 0.02 0.03 NA [11,] 0.12 0.08 0.05 0.03 0.04 0.01 0.07 0.05 NA [12,] -0.03 -0.08 -0.09 -0.04 0.00 0.00 -0.06 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/1h6q31413562471.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/2ffyb1413562471.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/3kl6y1413562471.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/44pl01413562471.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,] 1.380 1.960 1.360 1.240 1.35 1.230 1.09 1.080 1.330 1.350 1.380 1.490 [2,] 1.450 2.025 1.515 1.335 1.53 1.310 1.26 1.285 1.405 1.390 1.455 1.515 [3,] 1.485 2.100 1.560 1.400 1.63 1.415 1.32 1.350 1.490 1.470 1.520 1.555 [4,] 1.555 2.155 1.660 1.480 1.69 1.510 1.47 1.440 1.510 1.515 1.565 1.615 [5,] 1.580 2.280 1.770 1.560 1.80 1.560 1.51 1.460 1.520 1.560 1.590 1.640 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.426345 2.02738 1.479001 1.319001 1.540622 1.303277 1.202691 1.263415 [2,] 1.543655 2.17262 1.640999 1.480999 1.719378 1.526723 1.437309 1.436585 [,9] [,10] [,11] [,12] [1,] 1.431345 1.400173 1.458552 1.499139 [2,] 1.548655 1.539827 1.581448 1.610861 $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(1.38, 1.45, 1.485, 1.555, 1.58, 1.96, 2.025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ak5x1413562471.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.500 -0.600 -0.230 0.100 -0.340 -0.160 -0.060 0.050 -0.040 0.020 0.010 [2,] 0.580 -0.580 -0.225 0.135 -0.245 -0.145 -0.055 0.075 -0.025 0.030 0.035 [3,] 0.605 -0.550 -0.160 0.225 -0.185 -0.055 -0.010 0.120 -0.005 0.045 0.050 [4,] 0.640 -0.475 -0.130 0.245 -0.140 -0.040 0.020 0.140 0.030 0.070 0.075 [5,] 0.710 -0.390 -0.110 0.310 -0.110 0.080 0.040 0.140 0.040 0.080 0.120 [,12] [1,] -0.090 [2,] -0.070 [3,] -0.040 [4,] -0.015 [5,] 0.000 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.5714831 -0.6086545 -0.2130684 0.1635524 -0.2436545 -0.113654507 [2,] 0.6385169 -0.4913455 -0.1069316 0.2864476 -0.1263455 0.003654507 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.05189608 0.08369007 -0.03572379 0.02265543 0.02765543 -0.072845113 [2,] 0.03189608 0.15630993 0.02572379 0.06734457 0.07234457 -0.007154887 $out [1] 0.14 0.25 $group [1] 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.5, 0.58, 0.605, 0.64, 0.71, -0.6, -0.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tlge1413562471.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,] 1.080 1.27 1.290 1.280 1.230 1.400 1.460 1.430 NA [2,] 1.235 1.32 1.365 1.395 1.405 1.465 1.530 1.525 NA [3,] 1.350 1.43 1.470 1.450 1.485 1.525 1.565 1.570 NA [4,] 1.380 1.52 1.540 1.505 1.565 1.595 1.670 1.640 NA [5,] 1.500 1.53 1.590 1.620 1.730 1.650 1.800 1.770 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.283865 1.338779 1.390181 1.399828 1.412023 1.465706 1.501145 1.517548 [2,] 1.416135 1.521221 1.549819 1.500172 1.557977 1.584294 1.628855 1.622452 [,9] [1,] NA [2,] NA $out [1] 1.96 2.09 2.11 2.00 2.05 2.15 2.28 2.16 $group [1] 1 2 3 4 5 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(1.08, 1.235, 1.35, 1.38, 1.5, 1.27, 1.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fpgm1413562471.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.336250 1.3200 1.361250 [2,] 1.405625 1.4075 1.409375 [3,] 1.475000 1.4875 1.478750 [4,] 1.568750 1.5575 1.570625 [5,] 1.606250 1.6300 1.602500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.400598 1.419084 1.405203 [2,] 1.549402 1.555916 1.552297 $out [1] 2.100 2.100 2.095 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.33625, 1.405625, 1.475, 1.56875, 1.60625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h6q31413562471.ps tmp/1h6q31413562471.png",intern=TRUE)) character(0) > try(system("convert tmp/2ffyb1413562471.ps tmp/2ffyb1413562471.png",intern=TRUE)) character(0) > try(system("convert tmp/3kl6y1413562471.ps tmp/3kl6y1413562471.png",intern=TRUE)) character(0) > try(system("convert tmp/44pl01413562471.ps tmp/44pl01413562471.png",intern=TRUE)) character(0) > try(system("convert tmp/5ak5x1413562471.ps tmp/5ak5x1413562471.png",intern=TRUE)) character(0) > try(system("convert tmp/6tlge1413562471.ps tmp/6tlge1413562471.png",intern=TRUE)) character(0) > try(system("convert tmp/7fpgm1413562471.ps tmp/7fpgm1413562471.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 0.429 2.960