R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(103.71,103.07,103.93,102.9,101.54,102.13,101.08,101.33,101.24,100.58,99.87,99.1,98.98,98.77,98.05,97.94,97.65,97.2,97.39,97.35,98.01,97.81,97.56,98.05,97.82,99.05,98.86,97.64,97.77,98.07,98.36,100,99.52,98.82,98.98,98.6,98.8,99.62,99.35,99.87,99.53,99.88,99.26,99.51,100.64,100.85,101.44,101.26,101.67,102.93,103.81,106.19,106.94,108.51,108.41,108.97,109.25,109.97,108.92,109.01,108.86,107.36,107.99,107.94,108.54,108.37,108.77,107.15,108.61,109.02,109.16,109.55) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (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.71 98.98 97.82 98.80 101.67 108.86 NA [2,] 103.07 98.77 99.05 99.62 102.93 107.36 NA [3,] 103.93 98.05 98.86 99.35 103.81 107.99 NA [4,] 102.90 97.94 97.64 99.87 106.19 107.94 NA [5,] 101.54 97.65 97.77 99.53 106.94 108.54 NA [6,] 102.13 97.20 98.07 99.88 108.51 108.37 NA [7,] 101.08 97.39 98.36 99.26 108.41 108.77 NA [8,] 101.33 97.35 100.00 99.51 108.97 107.15 NA [9,] 101.24 98.01 99.52 100.64 109.25 108.61 NA [10,] 100.58 97.81 98.82 100.85 109.97 109.02 NA [11,] 99.87 97.56 98.98 101.44 108.92 109.16 NA [12,] 99.10 98.05 98.60 101.26 109.01 109.55 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.64 -0.21 1.23 0.82 1.26 -1.50 NA [2,] 0.86 -0.72 -0.19 -0.27 0.88 0.63 NA [3,] -1.03 -0.11 -1.22 0.52 2.38 -0.05 NA [4,] -1.36 -0.29 0.13 -0.34 0.75 0.60 NA [5,] 0.59 -0.45 0.30 0.35 1.57 -0.17 NA [6,] -1.05 0.19 0.29 -0.62 -0.10 0.40 NA [7,] 0.25 -0.04 1.64 0.25 0.56 -1.62 NA [8,] -0.09 0.66 -0.48 1.13 0.28 1.46 NA [9,] -0.66 -0.20 -0.70 0.21 0.72 0.41 NA [10,] -0.71 -0.25 0.16 0.59 -1.05 0.14 NA [11,] -0.77 0.49 -0.38 -0.18 0.09 0.39 NA [12,] -0.12 -0.23 0.20 0.41 -0.15 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/1zben1457445308.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/228sl1457445308.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/3q0yq1457445308.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/46qb01457445308.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] [1,] 97.820 98.770 98.05 97.640 97.650 97.200 97.39 97.350 98.01 [2,] 98.800 99.050 98.86 97.940 97.770 98.070 98.36 99.510 99.52 [3,] 100.325 101.275 101.58 101.385 100.535 101.005 100.17 100.665 100.94 [4,] 103.710 103.070 103.93 106.190 106.940 108.370 108.41 107.150 108.61 [5,] 108.860 107.360 107.99 107.940 108.540 108.510 108.77 108.970 109.25 [,10] [,11] [,12] [1,] 97.810 97.560 98.05 [2,] 98.820 98.980 98.60 [3,] 100.715 100.655 100.18 [4,] 109.020 108.920 109.01 [5,] 109.970 109.160 109.55 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.15789 98.68197 98.30969 96.06348 94.62005 94.36117 93.68743 [2,] 103.49211 103.86803 104.85031 106.70652 106.44995 107.64883 106.65257 [,8] [,9] [,10] [,11] [,12] [1,] 95.73695 95.07666 94.13567 94.24338 93.46521 [2,] 105.59305 106.80334 107.29433 107.06662 106.89479 $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(97.82, 98.8, 100.325, 103.71, 108.86, 98.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5l4x21457445308.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,] -1.500 -0.72 -1.22 -1.36 -0.450 -1.050 -0.04 -0.48 -0.700 -1.050 -0.770 [2,] -0.640 -0.27 -1.03 -0.34 -0.170 -0.620 -0.04 -0.09 -0.660 -0.710 -0.380 [3,] 0.305 0.22 -0.08 -0.08 0.325 0.045 0.25 0.47 0.005 -0.055 -0.045 [4,] 1.230 0.86 0.52 0.60 0.590 0.290 0.56 1.13 0.410 0.160 0.390 [5,] 1.260 0.88 2.38 0.75 1.570 0.400 0.56 1.46 0.720 0.590 0.490 [,12] [1,] -0.23 [2,] -0.15 [3,] -0.12 [4,] 0.20 [5,] 0.41 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.9012104 -0.5088865 -1.0798001 -0.6863304 -0.1652245 -0.5419794 [2,] 1.5112104 0.9488865 0.9198001 0.5263304 0.8152245 0.6319794 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1370194 -0.3169394 -0.6851846 -0.6161781 -0.5416749 -0.3673091 [2,] 0.6370194 1.2569394 0.6951846 0.5061781 0.4516749 0.1273091 $out [1] 1.64 -1.62 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.5, -0.640000000000001, 0.305, 1.23, 1.26000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6c53g1457445308.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,] 99.100 97.200 97.640 98.800 101.67 107.150 NA [2,] 100.830 97.475 97.945 99.430 105.00 107.965 NA [3,] 101.435 97.875 98.710 99.745 108.46 108.575 NA [4,] 102.985 98.050 99.015 100.745 108.99 108.940 NA [5,] 103.930 98.770 100.000 101.440 109.97 109.550 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.4521 97.61274 98.22197 99.14522 106.6401 108.1303 NA [2,] 102.4179 98.13726 99.19803 100.34478 110.2799 109.0197 NA $out [1] 98.98 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(99.1, 100.83, 101.435, 102.985, 103.93, 97.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lnru1457445308.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,] 101.6400 100.17 101.0225 [2,] 101.9967 100.43 101.6681 [3,] 102.2858 100.69 102.6225 [4,] 102.6250 101.14 103.0087 [5,] 102.8783 101.58 103.2837 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.9992 100.3662 102.011 [2,] 102.5724 101.0138 103.234 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.64, 101.996666666667, 102.285833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zben1457445308.ps tmp/1zben1457445308.png",intern=TRUE)) character(0) > try(system("convert tmp/228sl1457445308.ps tmp/228sl1457445308.png",intern=TRUE)) character(0) > try(system("convert tmp/3q0yq1457445308.ps tmp/3q0yq1457445308.png",intern=TRUE)) character(0) > try(system("convert tmp/46qb01457445308.ps tmp/46qb01457445308.png",intern=TRUE)) character(0) > try(system("convert tmp/5l4x21457445308.ps tmp/5l4x21457445308.png",intern=TRUE)) character(0) > try(system("convert tmp/6c53g1457445308.ps tmp/6c53g1457445308.png",intern=TRUE)) character(0) > try(system("convert tmp/7lnru1457445308.ps tmp/7lnru1457445308.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.465 0.422 2.913