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(103.77,103.82,103.86,103.9,103.63,103.65,103.7,103.77,103.94,104.03,104.03,104.29,104.35,104.67,104.73,104.86,104.05,104.15,104.27,104.33,104.41,104.4,104.41,104.6,104.61,104.65,104.55,104.51,104.74,104.89,104.91,104.93,104.95,104.97,105.16,105.29,105.35,105.36,105.45,105.3,105.73,105.86,105.85,105.95,105.97,106.15,105.37,105.39,105.39,105.38,105.23,105.34,104.98,105.16,105.27,105.27,105.33,105.33,105.46,105.54,105.59,105.57,105.62,105.57,105.33,105.34,105.5,105.47,105.59,105.65,105.8,105.87) > 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,] 103.77 104.35 104.61 105.35 105.39 105.59 NA [2,] 103.82 104.67 104.65 105.36 105.38 105.57 NA [3,] 103.86 104.73 104.55 105.45 105.23 105.62 NA [4,] 103.90 104.86 104.51 105.30 105.34 105.57 NA [5,] 103.63 104.05 104.74 105.73 104.98 105.33 NA [6,] 103.65 104.15 104.89 105.86 105.16 105.34 NA [7,] 103.70 104.27 104.91 105.85 105.27 105.50 NA [8,] 103.77 104.33 104.93 105.95 105.27 105.47 NA [9,] 103.94 104.41 104.95 105.97 105.33 105.59 NA [10,] 104.03 104.40 104.97 106.15 105.33 105.65 NA [11,] 104.03 104.41 105.16 105.37 105.46 105.80 NA [12,] 104.29 104.60 105.29 105.39 105.54 105.87 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.05 0.32 0.04 0.01 -0.01 -0.02 NA [2,] 0.04 0.06 -0.10 0.09 -0.15 0.05 NA [3,] 0.04 0.13 -0.04 -0.15 0.11 -0.05 NA [4,] -0.27 -0.81 0.23 0.43 -0.36 -0.24 NA [5,] 0.02 0.10 0.15 0.13 0.18 0.01 NA [6,] 0.05 0.12 0.02 -0.01 0.11 0.16 NA [7,] 0.07 0.06 0.02 0.10 0.00 -0.03 NA [8,] 0.17 0.08 0.02 0.02 0.06 0.12 NA [9,] 0.09 -0.01 0.02 0.18 0.00 0.06 NA [10,] 0.00 0.01 0.19 -0.78 0.13 0.15 NA [11,] 0.26 0.19 0.13 0.02 0.08 0.07 NA [12,] 0.06 0.01 0.06 0.00 0.05 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/1g17e1413229089.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/2vlh41413229089.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/31uj51413229089.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/497lw1413229089.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] [1,] 103.77 103.820 103.86 103.90 103.63 103.650 103.70 103.77 103.94 104.03 [2,] 104.35 104.650 104.55 104.51 104.05 104.150 104.27 104.33 104.41 104.40 [3,] 104.98 105.015 104.98 105.08 104.86 105.025 105.09 105.10 105.14 105.15 [4,] 105.39 105.380 105.45 105.34 105.33 105.340 105.50 105.47 105.59 105.65 [5,] 105.59 105.570 105.62 105.57 105.73 105.860 105.85 105.95 105.97 106.15 [,11] [,12] [1,] 104.030 104.29 [2,] 104.410 104.60 [3,] 105.265 105.34 [4,] 105.460 105.54 [5,] 105.800 105.87 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.3092 104.5441 104.3995 104.5446 104.0344 104.2574 104.2966 104.3647 [2,] 105.6508 105.4859 105.5605 105.6154 105.6856 105.7926 105.8834 105.8353 [,9] [,10] [,11] [,12] [1,] 104.3789 104.3437 104.5877 104.7337 [2,] 105.9011 105.9563 105.9423 105.9463 $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(103.77, 104.35, 104.98, 105.39, 105.59, 103.82, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50gol1413229089.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.020 -0.150 -1.500000e-01 -0.810 0.010 -0.01 -0.03 0.02 -0.01 0.00 [2,] -0.010 -0.100 -5.000000e-02 -0.360 0.020 0.02 0.00 0.02 0.00 0.00 [3,] 0.025 0.045 7.105427e-15 -0.255 0.115 0.08 0.04 0.07 0.04 0.07 [4,] 0.050 0.060 1.100000e-01 0.230 0.150 0.12 0.07 0.12 0.09 0.15 [5,] 0.050 0.090 1.300000e-01 0.430 0.180 0.16 0.10 0.17 0.18 0.19 [,11] [,12] [1,] 0.020 0.00 [2,] 0.070 0.01 [3,] 0.105 0.05 [4,] 0.190 0.06 [5,] 0.260 0.06 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.01370194 -0.05820517 -0.1032052 -0.6355691 0.0311458 0.01549677 [2,] 0.06370194 0.14820517 0.1032052 0.1255691 0.1988542 0.14450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.005152261 0.00549677 -0.01805291 -0.02675484 0.02759612 0.01467013 [2,] 0.085152261 0.13450323 0.09805291 0.16675484 0.18240388 0.08532987 $out [1] 0.32 -0.78 $group [1] 1 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0200000000000102, -0.0100000000000051, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6eomd1413229089.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,] 103.630 104.050 104.51 105.300 105.160 105.330 NA [2,] 103.735 104.300 104.63 105.365 105.250 105.485 NA [3,] 103.840 104.405 104.90 105.590 105.330 105.580 NA [4,] 103.985 104.635 104.96 105.905 105.385 105.635 NA [5,] 104.290 104.860 105.29 106.150 105.540 105.800 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.726 104.2522 104.7495 105.3437 105.2684 105.5116 NA [2,] 103.954 104.5578 105.0505 105.8363 105.3916 105.6484 NA $out [1] 104.98 105.87 $group [1] 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(103.63, 103.735, 103.84, 103.985, 104.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wyxr1413229089.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,] 104.7433 104.8600 104.8150 [2,] 104.8750 104.9975 104.9169 [3,] 104.9150 105.0850 104.9794 [4,] 105.0350 105.1450 105.0263 [5,] 105.1633 105.3400 105.1375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.842 105.0177 104.9295 [2,] 104.988 105.1523 105.0293 $out [1] 104.7325 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104.743333333333, 104.875, 104.915, 105.035, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1g17e1413229089.ps tmp/1g17e1413229089.png",intern=TRUE)) character(0) > try(system("convert tmp/2vlh41413229089.ps tmp/2vlh41413229089.png",intern=TRUE)) character(0) > try(system("convert tmp/31uj51413229089.ps tmp/31uj51413229089.png",intern=TRUE)) character(0) > try(system("convert tmp/497lw1413229089.ps tmp/497lw1413229089.png",intern=TRUE)) character(0) > try(system("convert tmp/50gol1413229089.ps tmp/50gol1413229089.png",intern=TRUE)) character(0) > try(system("convert tmp/6eomd1413229089.ps tmp/6eomd1413229089.png",intern=TRUE)) character(0) > try(system("convert tmp/7wyxr1413229089.ps tmp/7wyxr1413229089.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.485 0.422 2.938