R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(1.38,1.96,1.36,1.24,1.35,1.23,1.09,1.08,1.33,1.35,1.38,1.5,1.47,2.09,1.52,1.29,1.52,1.27,1.35,1.29,1.41,1.39,1.45,1.53,1.45,2.11,1.53,1.38,1.54,1.35,1.29,1.33,1.47,1.47,1.54,1.59,1.5,2,1.51,1.4,1.62,1.44,1.29,1.28,1.4,1.39,1.46,1.49,1.45,2.05,1.59,1.42,1.73,1.39,1.23,1.37,1.51,1.47,1.5,1.54,1.54,2.15,1.62,1.4,1.65,1.49,1.45,1.45,1.51,1.48,1.56,1.57) > 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,] 1.38 1.47 1.45 1.50 1.45 1.54 NA [2,] 1.96 2.09 2.11 2.00 2.05 2.15 NA [3,] 1.36 1.52 1.53 1.51 1.59 1.62 NA [4,] 1.24 1.29 1.38 1.40 1.42 1.40 NA [5,] 1.35 1.52 1.54 1.62 1.73 1.65 NA [6,] 1.23 1.27 1.35 1.44 1.39 1.49 NA [7,] 1.09 1.35 1.29 1.29 1.23 1.45 NA [8,] 1.08 1.29 1.33 1.28 1.37 1.45 NA [9,] 1.33 1.41 1.47 1.40 1.51 1.51 NA [10,] 1.35 1.39 1.47 1.39 1.47 1.48 NA [11,] 1.38 1.45 1.54 1.46 1.50 1.56 NA [12,] 1.50 1.53 1.59 1.49 1.54 1.57 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.58 0.62 0.66 0.50 0.60 0.61 NA [2,] -0.60 -0.57 -0.58 -0.49 -0.46 -0.53 NA [3,] -0.12 -0.23 -0.15 -0.11 -0.17 -0.22 NA [4,] 0.11 0.23 0.16 0.22 0.31 0.25 NA [5,] -0.12 -0.25 -0.19 -0.18 -0.34 -0.16 NA [6,] -0.14 0.08 -0.06 -0.15 -0.16 -0.04 NA [7,] -0.01 -0.06 0.04 -0.01 0.14 0.00 NA [8,] 0.25 0.12 0.14 0.12 0.14 0.06 NA [9,] 0.02 -0.02 0.00 -0.01 -0.04 -0.03 NA [10,] 0.03 0.06 0.07 0.07 0.03 0.08 NA [11,] 0.12 0.08 0.05 0.03 0.04 0.01 NA [12,] -0.03 -0.08 -0.09 -0.04 0.00 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/10e5m1476113565.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/2zwpl1476113565.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/330a71476113565.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/41kcx1476113565.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] [,11] [,12] [1,] 1.38 1.96 1.510 1.24 1.35 1.23 1.09 1.28 1.33 1.35 1.38 1.490 [2,] 1.45 2.00 1.510 1.29 1.52 1.27 1.23 1.28 1.40 1.39 1.45 1.500 [3,] 1.46 2.07 1.525 1.39 1.58 1.37 1.29 1.31 1.44 1.43 1.48 1.535 [4,] 1.50 2.11 1.590 1.40 1.65 1.44 1.35 1.37 1.51 1.47 1.54 1.570 [5,] 1.54 2.15 1.620 1.42 1.73 1.49 1.45 1.45 1.51 1.48 1.56 1.590 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.427748 1.999046 1.473397 1.319046 1.496146 1.260345 1.212596 1.251947 [2,] 1.492252 2.140954 1.576603 1.460954 1.663854 1.479655 1.367404 1.368053 [,9] [,10] [,11] [,12] [1,] 1.369046 1.378397 1.421947 1.489848 [2,] 1.510954 1.481603 1.538053 1.580152 $out [1] 1.36 1.08 $group [1] 3 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.38, 1.45, 1.46, 1.5, 1.54, 1.96, 2, 2.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5r2fj1476113565.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.580 -0.60 -0.23 0.110 -0.340 -0.16 -0.060 0.12 -0.040 0.030 0.010 -0.09 [2,] 0.580 -0.58 -0.22 0.160 -0.250 -0.15 -0.010 0.12 -0.030 0.030 0.030 -0.08 [3,] 0.605 -0.55 -0.16 0.225 -0.185 -0.10 -0.005 0.13 -0.015 0.065 0.045 -0.04 [4,] 0.620 -0.49 -0.12 0.250 -0.160 -0.04 0.040 0.14 0.000 0.070 0.080 -0.03 [5,] 0.660 -0.46 -0.11 0.310 -0.120 0.08 0.040 0.14 0.020 0.080 0.120 0.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.5791987 -0.6080529 -0.22450323 0.1669471 -0.2430529 -0.17095355 [2,] 0.6308013 -0.4919471 -0.09549677 0.2830529 -0.1269471 -0.02904645 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.03725161 0.1170994 -0.034350969 0.03919871 0.01274839 -0.075329874 [2,] 0.02725161 0.1429006 0.004350969 0.09080129 0.07725161 -0.004670126 $out [1] 0.50 0.14 0.25 0.06 $group [1] 1 7 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.58, 0.58, 0.605, 0.62, 0.66, -0.6, -0.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v24w1476113565.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,] 1.080 1.27 1.290 1.280 1.230 1.400 NA [2,] 1.235 1.32 1.365 1.395 1.405 1.465 NA [3,] 1.350 1.43 1.470 1.450 1.485 1.525 NA [4,] 1.380 1.52 1.540 1.505 1.565 1.595 NA [5,] 1.500 1.53 1.590 1.620 1.730 1.650 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.283865 1.338779 1.390181 1.399828 1.412023 1.465706 NA [2,] 1.416135 1.521221 1.549819 1.500172 1.557977 1.584294 NA $out [1] 1.96 2.09 2.11 2.00 2.05 2.15 $group [1] 1 2 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.08, 1.235, 1.35, 1.38, 1.5, 1.27, 1.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/782y51476113565.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,] 1.283333 1.29 1.290000 [2,] 1.358333 1.38 1.357500 [3,] 1.451667 1.45 1.461250 [4,] 1.529167 1.53 1.539375 [5,] 1.568333 1.58 1.583750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.373748 1.381584 1.378296 [2,] 1.529585 1.518416 1.544204 $out [1] 2.06000 2.07000 2.05875 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.28333333333333, 1.35833333333333, 1.45166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10e5m1476113565.ps tmp/10e5m1476113565.png",intern=TRUE)) character(0) > try(system("convert tmp/2zwpl1476113565.ps tmp/2zwpl1476113565.png",intern=TRUE)) character(0) > try(system("convert tmp/330a71476113565.ps tmp/330a71476113565.png",intern=TRUE)) character(0) > try(system("convert tmp/41kcx1476113565.ps tmp/41kcx1476113565.png",intern=TRUE)) character(0) > try(system("convert tmp/5r2fj1476113565.ps tmp/5r2fj1476113565.png",intern=TRUE)) character(0) > try(system("convert tmp/6v24w1476113565.ps tmp/6v24w1476113565.png",intern=TRUE)) character(0) > try(system("convert tmp/782y51476113565.ps tmp/782y51476113565.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.752 0.178 3.006