R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(98.41,98.94,99.09,100.45,101.99,102.35,102.69,102.6,102.62,102.73,102.74,103.45,103.9,103.45,103.5,103.33,103.56,103.58,103.86,103.77,103.73,104.21,104.55,104.5,104.66,104.99,104.99,105.62,106.52,106.1,106.73,106.63,106.72,106.5,107.12,106.84,107.25,108.19,108.21,107.98,109.12,109.79,109.69,109.69,109.24,108.55,106.47,107.27,105.95,108.55,110.81,111.54,110.38,106.67,106.45,105.44,105.37,103.72,106.57,108.54,110.36,106.64,103.45,101.36,101.9,100.86,100.37,100.16,99.5,99.52,99.2,99.35,99.37,99.85,99.76,100.07,99.77,99.93,99.16,99.4,99.81,99.67,99.37,99.49,99.28,99.33,99.19,98.11,99.12,99.06,97.41,98.45,100.33,103.18,103.06,103.48,102.8,103.92,103.9,103.96,103.62,103.83,104.09,104.07,103.22,104.01,104.01,104.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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 98.41 103.90 104.66 107.25 105.95 110.36 99.37 99.28 102.80 NA [2,] 98.94 103.45 104.99 108.19 108.55 106.64 99.85 99.33 103.92 NA [3,] 99.09 103.50 104.99 108.21 110.81 103.45 99.76 99.19 103.90 NA [4,] 100.45 103.33 105.62 107.98 111.54 101.36 100.07 98.11 103.96 NA [5,] 101.99 103.56 106.52 109.12 110.38 101.90 99.77 99.12 103.62 NA [6,] 102.35 103.58 106.10 109.79 106.67 100.86 99.93 99.06 103.83 NA [7,] 102.69 103.86 106.73 109.69 106.45 100.37 99.16 97.41 104.09 NA [8,] 102.60 103.77 106.63 109.69 105.44 100.16 99.40 98.45 104.07 NA [9,] 102.62 103.73 106.72 109.24 105.37 99.50 99.81 100.33 103.22 NA [10,] 102.73 104.21 106.50 108.55 103.72 99.52 99.67 103.18 104.01 NA [11,] 102.74 104.55 107.12 106.47 106.57 99.20 99.37 103.06 104.01 NA [12,] 103.45 104.50 106.84 107.27 108.54 99.35 99.49 103.48 104.24 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.53 -0.45 0.33 0.94 2.60 -3.72 0.48 0.05 1.12 NA [2,] 0.15 0.05 0.00 0.02 2.26 -3.19 -0.09 -0.14 -0.02 NA [3,] 1.36 -0.17 0.63 -0.23 0.73 -2.09 0.31 -1.08 0.06 NA [4,] 1.54 0.23 0.90 1.14 -1.16 0.54 -0.30 1.01 -0.34 NA [5,] 0.36 0.02 -0.42 0.67 -3.71 -1.04 0.16 -0.06 0.21 NA [6,] 0.34 0.28 0.63 -0.10 -0.22 -0.49 -0.77 -1.65 0.26 NA [7,] -0.09 -0.09 -0.10 0.00 -1.01 -0.21 0.24 1.04 -0.02 NA [8,] 0.02 -0.04 0.09 -0.45 -0.07 -0.66 0.41 1.88 -0.85 NA [9,] 0.11 0.48 -0.22 -0.69 -1.65 0.02 -0.14 2.85 0.79 NA [10,] 0.01 0.34 0.62 -2.08 2.85 -0.32 -0.30 -0.12 0.00 NA [11,] 0.71 -0.05 -0.28 0.80 1.97 0.15 0.12 0.42 0.23 NA [12,] 0.45 0.16 0.41 -1.32 1.82 0.02 -0.21 -0.68 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/1j46y1447610693.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/29qkz1447610693.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/3jj8x1447610693.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/4fs511447610693.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,] 98.41 98.94 99.09 98.11 99.12 99.06 97.41 98.45 99.50 102.73 [2,] 99.37 99.85 99.76 100.45 101.90 100.86 100.37 100.16 100.33 102.73 [3,] 103.90 103.92 103.50 103.33 103.56 103.58 103.86 103.77 103.22 103.72 [4,] 105.95 106.64 104.99 105.62 106.52 106.10 106.45 105.44 105.37 104.21 [5,] 110.36 108.55 110.81 111.54 110.38 109.79 109.69 109.69 109.24 104.21 [,11] [,12] [1,] 99.20 99.35 [2,] 102.74 103.45 [3,] 104.01 104.24 [4,] 106.47 106.84 [5,] 107.12 108.54 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.4345 100.3439 100.7455 100.6071 101.1268 100.8203 100.6579 100.9892 [2,] 107.3655 107.4961 106.2545 106.0529 105.9932 106.3397 107.0621 106.5508 [,9] [,10] [,11] [,12] [1,] 100.5656 102.9405 102.0455 102.4546 [2,] 105.8744 104.4995 105.9745 106.0254 $out [1] 106.50 108.55 99.52 99.67 $group [1] 10 10 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.41, 99.37, 103.9, 105.95, 110.36, 98.94, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z0yv1447610693.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] [,12] [1,] -0.45 -0.14 -1.08 -1.16 -1.04 -0.77 -0.21 -0.85 -0.69 -0.32 -0.28 -1.320 [2,] 0.05 -0.09 -0.23 -0.30 -0.42 -0.49 -0.10 -0.45 -0.22 -0.30 0.12 -0.445 [3,] 0.48 0.00 0.06 0.54 0.02 -0.10 -0.09 -0.04 0.02 0.00 0.23 0.090 [4,] 0.94 0.05 0.63 1.01 0.21 0.28 0.00 0.09 0.48 0.34 0.71 0.430 [5,] 1.12 0.15 1.36 1.54 0.67 0.63 0.00 0.41 0.79 0.62 0.80 0.450 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01126667 -0.07373333 -0.3929333 -0.1499333 -0.3118 -0.5055333 [2,] 0.94873333 0.07373333 0.5129333 1.2299333 0.3518 0.3055333 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.14266667 -0.3244 -0.3486667 -0.3370667 -0.08073333 -0.3987876 [2,] -0.03733333 0.2444 0.3886667 0.3370667 0.54073333 0.5787876 $out [1] 2.60 -3.72 2.26 -3.19 -2.09 -3.71 -1.65 -1.01 0.24 1.04 1.88 -1.65 [13] 2.85 -2.08 2.85 1.97 1.82 $group [1] 1 1 2 2 3 5 6 7 7 7 8 9 9 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.450000000000003, 0.0499999999999972, 0.47999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66gzq1447610693.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,] 98.410 103.330 104.660 106.470 103.720 99.200 99.160 97.410 103.620 [2,] 99.770 103.530 105.305 107.625 105.695 99.510 99.385 98.755 103.725 [3,] 102.475 103.750 106.510 108.380 106.620 100.615 99.715 99.235 103.940 [4,] 102.710 104.055 106.725 109.465 109.465 102.675 99.830 101.695 104.040 [5,] 103.450 104.550 107.120 109.790 111.540 106.640 100.070 103.480 104.240 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.134 103.5105 105.8623 107.5408 104.9005 99.17142 99.51203 97.89405 [2,] 103.816 103.9895 107.1577 109.2192 108.3395 102.05858 99.91797 100.57595 [,9] [,10] [1,] 103.7963 NA [2,] 104.0837 NA $out [1] 110.36 102.80 103.22 $group [1] 6 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(98.41, 99.77, 102.475, 102.71, 103.45, 103.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ykp41447610693.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,] 103.3567 103.220 102.3750 [2,] 103.4733 103.530 102.8250 [3,] 103.5883 103.745 103.3275 [4,] 103.7194 103.910 103.8450 [5,] 103.9978 104.240 105.1450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 103.4761 103.5717 102.8623 [2,] 103.7006 103.9183 103.7927 $out [1] 104.1289 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(103.356666666667, 103.473333333333, 103.588333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1j46y1447610693.ps tmp/1j46y1447610693.png",intern=TRUE)) character(0) > try(system("convert tmp/29qkz1447610693.ps tmp/29qkz1447610693.png",intern=TRUE)) character(0) > try(system("convert tmp/3jj8x1447610693.ps tmp/3jj8x1447610693.png",intern=TRUE)) character(0) > try(system("convert tmp/4fs511447610693.ps tmp/4fs511447610693.png",intern=TRUE)) character(0) > try(system("convert tmp/5z0yv1447610693.ps tmp/5z0yv1447610693.png",intern=TRUE)) character(0) > try(system("convert tmp/66gzq1447610693.ps tmp/66gzq1447610693.png",intern=TRUE)) character(0) > try(system("convert tmp/7ykp41447610693.ps tmp/7ykp41447610693.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.412 0.482 2.905