R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(101.03,100.65,100.66,100.54,100.51,100.53,100.53,101.02,101.07,101.37,101.45,101.44,101.45,100.99,101.11,101.31,101.53,101.6,101.61,102.04,102.36,102.74,102.96,103.01,103.02,102.34,102.38,102.54,102.71,102.78,102.78,103.27,103.4,103.74,103.89,103.92,99.68,99.06,99.12,99.37,99.63,99.69,99.76,100.16,100.46,100.83,101.09,101.14,101.25,101.09,101.18,101.14,101.23,101.17,100.84,101.04,101.18,101.1,101.21,101.26,101.85,101.82,101.93,101.95,101.97,102.04,101.37,101.2,101.14,101.27,101.39,101.4) > 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,] 101.03 101.45 103.02 99.68 101.25 101.85 NA [2,] 100.65 100.99 102.34 99.06 101.09 101.82 NA [3,] 100.66 101.11 102.38 99.12 101.18 101.93 NA [4,] 100.54 101.31 102.54 99.37 101.14 101.95 NA [5,] 100.51 101.53 102.71 99.63 101.23 101.97 NA [6,] 100.53 101.60 102.78 99.69 101.17 102.04 NA [7,] 100.53 101.61 102.78 99.76 100.84 101.37 NA [8,] 101.02 102.04 103.27 100.16 101.04 101.20 NA [9,] 101.07 102.36 103.40 100.46 101.18 101.14 NA [10,] 101.37 102.74 103.74 100.83 101.10 101.27 NA [11,] 101.45 102.96 103.89 101.09 101.21 101.39 NA [12,] 101.44 103.01 103.92 101.14 101.26 101.40 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.38 -0.46 -0.68 -0.62 -0.16 -0.03 NA [2,] 0.01 0.12 0.04 0.06 0.09 0.11 NA [3,] -0.12 0.20 0.16 0.25 -0.04 0.02 NA [4,] -0.03 0.22 0.17 0.26 0.09 0.02 NA [5,] 0.02 0.07 0.07 0.06 -0.06 0.07 NA [6,] 0.00 0.01 0.00 0.07 -0.33 -0.67 NA [7,] 0.49 0.43 0.49 0.40 0.20 -0.17 NA [8,] 0.05 0.32 0.13 0.30 0.14 -0.06 NA [9,] 0.30 0.38 0.34 0.37 -0.08 0.13 NA [10,] 0.08 0.22 0.15 0.26 0.11 0.12 NA [11,] -0.01 0.05 0.03 0.05 0.05 0.01 NA [12,] 0.01 0.01 -4.24 0.11 0.59 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/1e49b1489143904.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/2bhjn1489143904.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/3lvfs1489143904.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/4vurg1489143904.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,] 101.03 99.06 99.120 99.370 99.63 99.690 99.760 100.16 100.46 100.83 [2,] 101.03 100.65 100.660 100.540 100.51 100.530 100.530 101.02 101.07 101.10 [3,] 101.35 101.04 101.145 101.225 101.38 101.385 101.105 101.12 101.16 101.32 [4,] 101.85 101.82 101.930 101.950 101.97 102.040 101.610 102.04 102.36 102.74 [5,] 103.02 102.34 102.380 102.540 102.71 102.780 102.780 103.27 103.40 103.74 [,11] [,12] [1,] 101.09 101.14 [2,] 101.21 101.26 [3,] 101.42 101.42 [4,] 102.96 103.01 [5,] 103.89 103.92 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.8211 100.2853 100.3258 100.3155 100.4383 100.411 100.4084 100.4621 [2,] 101.8789 101.7947 101.9642 102.1345 102.3217 102.359 101.8016 101.7779 [,9] [,10] [,11] [,12] [1,] 100.3279 100.2621 100.2912 100.2912 [2,] 101.9921 102.3779 102.5488 102.5488 $out [1] 99.68 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(101.03, 101.03, 101.35, 101.85, 103.02, 99.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b0p01489143904.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.68 0.010 -0.12 -0.03 0.020 -0.67 -0.170 -0.060 -0.08 0.080 -0.01 0.01 [2,] -0.62 0.040 -0.04 0.02 0.020 -0.33 0.200 0.050 0.13 0.110 0.01 0.01 [3,] -0.42 0.075 0.09 0.13 0.065 0.00 0.415 0.135 0.32 0.135 0.04 0.01 [4,] -0.16 0.110 0.20 0.22 0.070 0.01 0.490 0.300 0.37 0.220 0.05 0.11 [5,] -0.03 0.120 0.25 0.26 0.070 0.07 0.490 0.320 0.38 0.260 0.05 0.11 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.7167149 0.02984774 -0.06480775 0.0009935402 0.03274839 -0.219311 [2,] -0.1232851 0.12015226 0.24480775 0.2590064598 0.09725161 0.219311 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.2279406 -0.02625807 0.1651922 0.06404645 0.01419871 -0.06065975 [2,] 0.6020594 0.29625807 0.4748078 0.20595355 0.06580129 0.08065975 $out [1] -0.06 -4.24 0.59 $group [1] 5 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.679999999999993, -0.620000000000005, -0.420000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mk0n1489143904.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,] 100.510 100.990 102.340 99.060 101.040 101.14 NA [2,] 100.535 101.380 102.625 99.500 101.095 101.32 NA [3,] 100.840 101.605 102.900 99.725 101.175 101.61 NA [4,] 101.220 102.550 103.570 100.645 101.220 101.94 NA [5,] 101.450 103.010 103.920 101.140 101.260 102.04 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.5276 101.0714 102.469 99.20276 101.118 101.3272 NA [2,] 101.1524 102.1386 103.331 100.24724 101.232 101.8928 NA $out [1] 100.84 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100.51, 100.535, 100.84, 101.22, 101.45, 100.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7b1pd1489143904.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,] 100.9917 101.0400 101.0788 [2,] 101.1450 101.1325 101.2488 [3,] 101.3408 101.2725 101.3637 [4,] 101.7217 101.3825 101.6731 [5,] 102.0283 101.4200 101.9563 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.0778 101.1585 101.1702 [2,] 101.6039 101.3865 101.5573 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.991666666667, 101.145, 101.340833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e49b1489143904.ps tmp/1e49b1489143904.png",intern=TRUE)) character(0) > try(system("convert tmp/2bhjn1489143904.ps tmp/2bhjn1489143904.png",intern=TRUE)) character(0) > try(system("convert tmp/3lvfs1489143904.ps tmp/3lvfs1489143904.png",intern=TRUE)) character(0) > try(system("convert tmp/4vurg1489143904.ps tmp/4vurg1489143904.png",intern=TRUE)) character(0) > try(system("convert tmp/5b0p01489143904.ps tmp/5b0p01489143904.png",intern=TRUE)) character(0) > try(system("convert tmp/6mk0n1489143904.ps tmp/6mk0n1489143904.png",intern=TRUE)) character(0) > try(system("convert tmp/7b1pd1489143904.ps tmp/7b1pd1489143904.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.986 0.199 3.308