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(92.1,93.91,95.46,94.54,95.63,96.32,96.42,96.95,96.52,96.82,96.4,96.69,96.72,98.57,98.6,96.44,97.09,97.36,97.74,96.78,96.45,97.66,98.69,98.21,97.33,99.05,100.09,98.1,97.68,97.44,99.19,98.32,97.83,97.71,97.51,97.62,96.49,98.92,99.69,97.06,97.63,97.97,99.01,97.89,97.23,96.93,96.97,97.68,97.73,99.03,100.35,99.38,99.3,99.77,101.11,101.15,101.59,100.95,99.23,100.41) > par1 = '5' > par1 <- '5' > #'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] 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 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 92.10 96.32 96.40 96.44 96.45 99.05 99.19 97.62 97.63 96.93 100.35 101.15 [2,] 93.91 96.42 96.69 97.09 97.66 100.09 98.32 96.49 97.97 96.97 99.38 101.59 [3,] 95.46 96.95 96.72 97.36 98.69 98.10 97.83 98.92 99.01 97.68 99.30 100.95 [4,] 94.54 96.52 98.57 97.74 98.21 97.68 97.71 99.69 97.89 97.73 99.77 99.23 [5,] 95.63 96.82 98.60 96.78 97.33 97.44 97.51 97.06 97.23 99.03 101.11 100.41 [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 1.81 0.10 0.29 0.65 1.21 1.04 -0.87 -1.13 0.34 0.04 -0.97 0.44 [2,] 1.55 0.53 0.03 0.27 1.03 -1.99 -0.49 2.43 1.04 0.71 -0.08 -0.64 [3,] -0.92 -0.43 1.85 0.38 -0.48 -0.42 -0.12 0.77 -1.12 0.05 0.47 -1.72 [4,] 1.09 0.30 0.03 -0.96 -0.88 -0.24 -0.20 -2.63 -0.66 1.30 1.34 1.18 [5,] 0.69 -0.42 -2.16 -0.33 1.72 1.75 0.11 0.57 -0.30 1.32 0.04 NA [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] 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/1rhlt1476360685.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/215o71476360685.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/36f9l1476360685.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/466bw1476360685.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] [1,] 96.320 93.910 95.460 96.520 95.630 [2,] 96.420 96.590 97.155 97.695 96.940 [3,] 97.275 97.375 97.965 97.815 97.385 [4,] 99.120 98.850 98.965 98.900 98.815 [5,] 101.150 101.590 100.950 99.770 101.110 $n [1] 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [1,] 96.04351 96.3442 97.13945 97.26539 96.5298 [2,] 98.50649 98.4058 98.79055 98.36461 98.2402 $out [1] 92.10 94.54 $group [1] 1 4 $names [1] "1" "2" "3" "4" "5" Warning message: In bxp(list(stats = c(96.32, 96.42, 97.275, 99.12, 101.15, 93.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50jri1476360685.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] [1,] -1.130 -1.990 -1.720 -2.630 -2.160 [2,] -0.415 -0.285 -0.700 -0.770 -0.315 [3,] 0.315 0.400 -0.270 -0.085 0.110 [4,] 0.845 1.035 0.425 1.135 1.005 [5,] 1.810 2.430 1.850 1.340 1.750 $n [1] 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.2596945 -0.2020609 -0.7831201 -0.9538833 -0.5188321 [2,] 0.8896945 1.0020609 0.2431201 0.7838833 0.7388321 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" Warning message: In bxp(list(stats = c(-1.13000000000001, -0.415000000000006, 0.314999999999998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68nto1476360685.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] [,11] [,12] [1,] 92.10 96.32 96.40 96.44 96.45 97.44 97.51 96.49 97.23 96.93 99.30 100.41 [2,] 93.91 96.42 96.69 96.78 97.33 97.68 97.71 97.06 97.63 96.97 99.38 100.41 [3,] 94.54 96.52 96.72 97.09 97.66 98.10 97.83 97.62 97.89 97.68 99.77 100.95 [4,] 95.46 96.82 98.57 97.36 98.21 99.05 98.32 98.92 97.97 97.73 100.35 101.15 [5,] 95.63 96.95 98.60 97.74 98.69 100.09 99.19 99.69 97.97 97.73 101.11 101.59 [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 93.44477 96.23736 95.3916 96.68017 97.03819 97.13196 97.39898 96.30573 [2,] 95.63523 96.80264 98.0484 97.49983 98.28181 99.06804 98.26102 98.93427 [,9] [,10] [,11] [,12] [,13] [1,] 97.64976 97.14299 99.0846 100.4271 NA [2,] 98.13024 98.21701 100.4554 101.4729 NA $out [1] 99.01 99.03 99.23 $group [1] 9 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(92.1, 93.91, 94.54, 95.46, 95.63, 96.32, 96.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7iubs1476360685.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.46917 97.275 97.61250 [2,] 97.71500 97.375 97.75750 [3,] 97.91250 97.385 97.85375 [4,] 97.94000 97.815 98.10000 [5,] 98.08083 97.965 98.21875 $n [1] 5 5 5 $conf [,1] [,2] [,3] [1,] 97.75352 97.0741 97.61174 [2,] 98.07148 97.6959 98.09576 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.4691666666667, 97.715, 97.9125, 97.94, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rhlt1476360685.ps tmp/1rhlt1476360685.png",intern=TRUE)) character(0) > try(system("convert tmp/215o71476360685.ps tmp/215o71476360685.png",intern=TRUE)) character(0) > try(system("convert tmp/36f9l1476360685.ps tmp/36f9l1476360685.png",intern=TRUE)) character(0) > try(system("convert tmp/466bw1476360685.ps tmp/466bw1476360685.png",intern=TRUE)) character(0) > try(system("convert tmp/50jri1476360685.ps tmp/50jri1476360685.png",intern=TRUE)) character(0) > try(system("convert tmp/68nto1476360685.ps tmp/68nto1476360685.png",intern=TRUE)) character(0) > try(system("convert tmp/7iubs1476360685.ps tmp/7iubs1476360685.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.462 0.178 2.696