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(93.09,93.02,93.23,92.7,92.68,93.11,93.02,93.29,93.2,92.86,93.04,92.8,93.11,93.42,94.01,94.47,94.07,94.33,94.43,95.37,95.83,95.46,96,95.35,96.85,97.84,98.38,98.9,99.51,99.95,99.93,101.4,101.7,101.65,102.33,101.56,101.91,102.29,102.44,102.84,103.2,103.23,103.16,103.31,103.04,102.57,102.88,101.91,102.59,103.27,103.59,104.35,104.6,105.08,104.93,105.15,104.67,104.55,109.82,109.25) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 93.09 93.11 96.85 101.91 102.59 NA [2,] 93.02 93.42 97.84 102.29 103.27 NA [3,] 93.23 94.01 98.38 102.44 103.59 NA [4,] 92.70 94.47 98.90 102.84 104.35 NA [5,] 92.68 94.07 99.51 103.20 104.60 NA [6,] 93.11 94.33 99.95 103.23 105.08 NA [7,] 93.02 94.43 99.93 103.16 104.93 NA [8,] 93.29 95.37 101.40 103.31 105.15 NA [9,] 93.20 95.83 101.70 103.04 104.67 NA [10,] 92.86 95.46 101.65 102.57 104.55 NA [11,] 93.04 96.00 102.33 102.88 109.82 NA [12,] 92.80 95.35 101.56 101.91 109.25 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.07 0.31 0.99 0.38 0.68 NA [2,] 0.21 0.59 0.54 0.15 0.32 NA [3,] -0.53 0.46 0.52 0.40 0.76 NA [4,] -0.02 -0.40 0.61 0.36 0.25 NA [5,] 0.43 0.26 0.44 0.03 0.48 NA [6,] -0.09 0.10 -0.02 -0.07 -0.15 NA [7,] 0.27 0.94 1.47 0.15 0.22 NA [8,] -0.09 0.46 0.30 -0.27 -0.48 NA [9,] -0.34 -0.37 -0.05 -0.47 -0.12 NA [10,] 0.18 0.54 0.68 0.31 5.27 NA [11,] -0.24 -0.65 -0.77 -0.97 -0.57 NA [12,] 0.31 1.50 0.35 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/1nczt1489660045.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/2tcjy1489660045.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/31hlu1489660045.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/40ky81489660045.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,] 93.09 93.02 93.23 92.70 92.68 93.11 93.02 93.29 93.20 92.86 [2,] 93.11 93.42 94.01 94.47 94.07 94.33 94.43 95.37 95.83 95.46 [3,] 96.85 97.84 98.38 98.90 99.51 99.95 99.93 101.40 101.70 101.65 [4,] 101.91 102.29 102.44 102.84 103.20 103.23 103.16 103.31 103.04 102.57 [5,] 102.59 103.27 103.59 104.35 104.60 105.08 104.93 105.15 104.67 104.55 [,11] [,12] [1,] 93.04 92.80 [2,] 96.00 95.35 [3,] 102.33 101.56 [4,] 102.88 101.91 [5,] 109.82 109.25 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.63194 91.57248 92.42338 92.98578 93.05876 93.66128 93.7614 [2,] 103.06806 104.10752 104.33662 104.81422 105.96124 106.23872 106.0986 [,8] [,9] [,10] [,11] [,12] [1,] 95.78962 96.60543 96.62609 97.46861 96.92472 [2,] 107.01038 106.79457 106.67391 107.19139 106.19528 $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(93.09, 93.11, 96.85, 101.91, 102.59, 93.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52m1r1489660045.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.07 0.15 0.40 -0.40 0.03 -0.15 0.15 -0.48 -0.47 0.18 -0.97 0.310 [2,] 0.31 0.21 0.40 -0.02 0.26 -0.09 0.22 -0.27 -0.37 0.31 -0.77 0.330 [3,] 0.38 0.32 0.46 0.25 0.43 -0.07 0.27 -0.09 -0.34 0.54 -0.65 0.515 [4,] 0.68 0.54 0.52 0.36 0.44 -0.02 0.94 0.30 -0.12 0.68 -0.57 1.090 [5,] 0.99 0.59 0.52 0.61 0.48 -0.02 1.47 0.46 -0.05 0.68 -0.57 1.500 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.1185589 0.08682283 0.3752083 -0.01850704 0.3028125 -0.11946182 [2,] 0.6414411 0.55317717 0.5447917 0.51850704 0.5571875 -0.02053818 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.2387502 -0.4927606 -0.5166494 0.2785589 -0.7913195 -0.0854 [2,] 0.7787502 0.3127606 -0.1633506 0.8014411 -0.5086805 1.1154 $out [1] -0.53 0.76 0.10 5.27 -0.24 $group [1] 3 3 6 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0700000000000074, 0.310000000000002, 0.38000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/657651489660045.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] [1,] 92.680 93.110 96.850 101.910 102.590 NA [2,] 92.830 94.040 98.640 102.365 103.970 NA [3,] 93.030 94.450 99.940 102.860 104.635 NA [4,] 93.155 95.415 101.605 103.180 105.115 NA [5,] 93.290 96.000 102.330 103.310 105.150 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.88177 93.82285 98.58764 102.4883 104.1128 NA [2,] 93.17823 95.07715 101.29236 103.2317 105.1572 NA $out [1] 109.82 109.25 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.68, 92.83, 93.03, 93.155, 93.29, 93.11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ukd61489660045.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,] 97.510 96.850 97.5100 [2,] 98.491 98.640 98.4275 [3,] 99.117 99.940 98.7175 [4,] 99.696 101.605 99.1775 [5,] 100.814 102.330 99.4400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.56739 98.58764 98.37542 [2,] 99.66661 101.29236 99.05958 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.51, 98.491, 99.117, 99.696, 100.814, 96.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nczt1489660045.ps tmp/1nczt1489660045.png",intern=TRUE)) character(0) > try(system("convert tmp/2tcjy1489660045.ps tmp/2tcjy1489660045.png",intern=TRUE)) character(0) > try(system("convert tmp/31hlu1489660045.ps tmp/31hlu1489660045.png",intern=TRUE)) character(0) > try(system("convert tmp/40ky81489660045.ps tmp/40ky81489660045.png",intern=TRUE)) character(0) > try(system("convert tmp/52m1r1489660045.ps tmp/52m1r1489660045.png",intern=TRUE)) character(0) > try(system("convert tmp/657651489660045.ps tmp/657651489660045.png",intern=TRUE)) character(0) > try(system("convert tmp/7ukd61489660045.ps tmp/7ukd61489660045.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.732 0.176 2.969