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(83.61,83.89,83.4,82.96,82.76,83.35,87.78,88.99,88.92,88.91,89.79,90.54,93.15,92.79,93.21,95.35,100.91,103.69,104.04,104.16,104.71,105.18,104.92,104.83,104.9,105.05,104.6,103.21,102.52,101.09,101.19,102.34,102.62,102.47,101.82,101.86,101.54,101.98,101.23,100.4,99.94,99.94,100,98.8,99.07,99.46,99.18,98.47,97.12,96.91,96.09,97.17,96.8,97.13,99.9,100.56,100.84,99.81,100.44,100.07,101.32,103.98,104.81,106.23,106.48,107.59,107.16,107.54,107.1,106.38,106.64,106.13) > par1 = '6' > par1 <- '6' > #'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] 12 > 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] 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 83.61 87.78 93.15 104.04 104.90 101.19 101.54 100.00 97.12 99.90 101.32 [2,] 83.89 88.99 92.79 104.16 105.05 102.34 101.98 98.80 96.91 100.56 103.98 [3,] 83.40 88.92 93.21 104.71 104.60 102.62 101.23 99.07 96.09 100.84 104.81 [4,] 82.96 88.91 95.35 105.18 103.21 102.47 100.40 99.46 97.17 99.81 106.23 [5,] 82.76 89.79 100.91 104.92 102.52 101.82 99.94 99.18 96.80 100.44 106.48 [6,] 83.35 90.54 103.69 104.83 101.09 101.86 99.94 98.47 97.13 100.07 107.59 [,12] [,13] [1,] 107.16 NA [2,] 107.54 NA [3,] 107.10 NA [4,] 106.38 NA [5,] 106.64 NA [6,] 106.13 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.28 1.21 -0.36 0.12 0.15 1.15 0.44 -1.20 -0.21 0.66 2.66 0.38 [2,] -0.49 -0.07 0.42 0.55 -0.45 0.28 -0.75 0.27 -0.82 0.28 0.83 -0.44 [3,] -0.44 -0.01 2.14 0.47 -1.39 -0.15 -0.83 0.39 1.08 -1.03 1.42 -0.72 [4,] -0.20 0.88 5.56 -0.26 -0.69 -0.65 -0.46 -0.28 -0.37 0.63 0.25 0.26 [5,] 0.59 0.75 2.78 -0.09 -1.43 0.04 0.00 -0.71 0.33 -0.37 1.11 -0.51 [6,] 4.43 2.61 0.35 0.07 0.10 -0.32 0.06 -1.35 2.77 1.25 -0.43 NA [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] 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/1ma1n1456927315.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/2j81w1456927315.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/39n5h1456927315.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/41l3e1456927315.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] [1,] 87.780 83.89 83.400 88.910 89.790 90.54 [2,] 95.135 94.85 94.650 96.260 97.990 97.80 [3,] 100.595 101.27 101.035 100.105 100.675 100.58 [4,] 102.790 104.07 104.655 104.195 103.720 104.26 [5,] 107.160 107.54 107.100 106.380 106.640 107.59 $n [1] 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 97.1035 97.0647 96.47165 96.48579 98.06151 97.63355 [2,] 104.0865 105.4753 105.59835 103.72421 103.28849 103.52645 $out [1] 83.61 82.96 82.76 83.35 $group [1] 1 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" Warning message: In bxp(list(stats = c(87.78, 95.135, 100.595, 102.79, 107.16, 83.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5n7sa1456927315.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] [1,] -1.200 -0.82 -1.390 -0.690 -1.43 -1.35 [2,] -0.045 -0.47 -0.775 -0.415 -0.44 -0.13 [3,] 0.330 0.10 -0.080 -0.230 0.02 0.10 [4,] 0.905 0.35 0.775 0.445 0.67 1.93 [5,] 1.210 0.83 2.140 0.880 1.11 4.43 $n [1] 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1033014 -0.2740075 -0.7869654 -0.6222518 -0.4862785 -0.8813591 [2,] 0.7633014 0.4740075 0.6269654 0.1622518 0.5262785 1.0813591 $out [1] 2.66 5.56 2.78 $group [1] 1 4 5 $names [1] "1" "2" "3" "4" "5" "6" Warning message: In bxp(list(stats = c(-1.2, -0.0450000000000088, 0.330000000000005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mhhy1456927315.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] [,10] [1,] 82.760 87.780 92.79 104.04 101.090 101.19 99.940 98.470 96.800 99.810 [2,] 82.960 88.910 93.15 104.16 102.520 101.82 99.940 98.800 96.800 99.900 [3,] 83.375 88.955 94.28 104.77 103.905 102.10 100.815 99.125 97.015 100.255 [4,] 83.610 89.790 100.91 104.92 104.900 102.47 101.540 99.460 97.130 100.560 [5,] 83.890 90.540 103.69 105.18 105.050 102.62 101.980 100.000 97.170 100.840 [,11] [,12] [,13] [1,] 101.32 106.13 NA [2,] 103.98 106.38 NA [3,] 105.52 106.87 NA [4,] 106.48 107.16 NA [5,] 107.59 107.54 NA $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82.95573 88.38737 89.27455 104.2798 102.3698 101.6807 99.78295 98.69928 [2,] 83.79427 89.52263 99.28545 105.2602 105.4402 102.5193 101.84705 99.55072 [,9] [,10] [,11] [,12] [,13] [1,] 96.80214 99.82928 103.9074 106.3669 NA [2,] 97.22786 100.68072 107.1326 107.3731 NA $out [1] 96.09 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(82.76, 82.96, 83.375, 83.61, 83.89, 87.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qjk01456927315.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,] 98.47583 100.105 99.14625 [2,] 98.88333 100.580 99.95250 [3,] 98.93833 100.635 100.10375 [4,] 99.35000 101.035 100.85250 [5,] 99.55750 101.270 101.05500 $n [1] 6 6 6 $conf [,1] [,2] [,3] [1,] 98.63732 100.3415 99.52322 [2,] 99.23935 100.9285 100.68428 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.4758333333333, 98.8833333333333, 98.9383333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ma1n1456927315.ps tmp/1ma1n1456927315.png",intern=TRUE)) character(0) > try(system("convert tmp/2j81w1456927315.ps tmp/2j81w1456927315.png",intern=TRUE)) character(0) > try(system("convert tmp/39n5h1456927315.ps tmp/39n5h1456927315.png",intern=TRUE)) character(0) > try(system("convert tmp/41l3e1456927315.ps tmp/41l3e1456927315.png",intern=TRUE)) character(0) > try(system("convert tmp/5n7sa1456927315.ps tmp/5n7sa1456927315.png",intern=TRUE)) character(0) > try(system("convert tmp/6mhhy1456927315.ps tmp/6mhhy1456927315.png",intern=TRUE)) character(0) > try(system("convert tmp/7qjk01456927315.ps tmp/7qjk01456927315.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.572 0.535 3.139