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(89.8,89.2,89.9,88.9,84,86.3,89.3,90.6,88.3,91.6,95.4,96.8,92.5,93.6,93.8,92.7,88.3,90.4,91.2,91.5,88.9,88.6,89.1,89.4,86.7,89.8,90.9,91.4,90.2,92.2,94,95.8,95.1,96.2,96.8,97.1,96.5,97.2,97.8,99.9,101.2,103.3,104.5,100.8,95,93.4,93.1,94.9,96.9,100.9,100.2,101.8,105.4,106.4,105.6,107.5,109.5,108.6,109.2,110.3,110.3,107.9,107.7,108.1,108,105.9,105.9,104.7) > 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] 68 > (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] 6 6 6 6 6 6 6 6 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 89.8 92.5 86.7 96.5 96.9 110.3 [2,] 89.2 93.6 89.8 97.2 100.9 107.9 [3,] 89.9 93.8 90.9 97.8 100.2 107.7 [4,] 88.9 92.7 91.4 99.9 101.8 108.1 [5,] 84.0 88.3 90.2 101.2 105.4 108.0 [6,] 86.3 90.4 92.2 103.3 106.4 105.9 [7,] 89.3 91.2 94.0 104.5 105.6 105.9 [8,] 90.6 91.5 95.8 100.8 107.5 104.7 [9,] 88.3 88.9 95.1 95.0 109.5 NA [10,] 91.6 88.6 96.2 93.4 108.6 NA [11,] 95.4 89.1 96.8 93.1 109.2 NA [12,] 96.8 89.4 97.1 94.9 110.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.6 1.1 3.1 0.7 4.0 -2.4 [2,] 0.7 0.2 1.1 0.6 -0.7 -0.2 [3,] -1.0 -1.1 0.5 2.1 1.6 0.4 [4,] -4.9 -4.4 -1.2 1.3 3.6 -0.1 [5,] 2.3 2.1 2.0 2.1 1.0 -2.1 [6,] 3.0 0.8 1.8 1.2 -0.8 0.0 [7,] 1.3 0.3 1.8 -3.7 1.9 -1.2 [8,] -2.3 -2.6 -0.7 -5.8 2.0 NA [9,] 3.3 -0.3 1.1 -1.6 -0.9 NA [10,] 3.8 0.5 0.6 -0.3 0.6 NA [11,] 1.4 0.3 0.3 1.8 1.1 NA [12,] -4.3 -2.7 -0.6 2.0 0.0 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/1o1fz1457473846.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/2ovs11457473846.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/34k711457473846.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/485tv1457473846.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,] 86.7 89.2 89.9 88.9 84.0 86.30 89.30 90.6 88.3 88.6 89.1 94.9 [2,] 89.8 89.8 90.9 91.4 88.3 90.40 91.20 91.5 88.9 91.6 93.1 94.9 [3,] 94.5 95.4 95.8 96.3 95.7 97.75 99.25 98.3 95.0 93.4 95.4 96.8 [4,] 96.9 100.9 100.2 101.8 105.4 105.90 105.60 104.7 95.1 96.2 96.8 97.1 [5,] 96.9 107.9 107.7 108.1 108.0 106.40 105.90 107.5 95.1 96.2 96.8 97.1 $n [1] 6 6 6 6 6 6 6 6 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.92027 88.24014 89.8012 89.59166 84.66995 87.752 89.96153 [2,] 99.07973 102.55986 101.7988 103.00834 106.73005 107.748 108.53847 [,8] [,9] [,10] [,11] [,12] [1,] 89.78557 90.6191 90.14965 92.78559 95.24549 [2,] 106.81443 99.3809 96.65035 98.01441 98.35451 $out [1] 110.3 109.5 108.6 109.2 89.4 110.3 $group [1] 1 9 10 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(86.7, 89.8, 94.5, 96.9, 96.9, 89.2, 89.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s2kz1457473846.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,] -2.4 -0.7 -1.10 -4.90 1.00 -0.8 -3.7 -2.6 -1.6 0.5 0.3 -4.3 [2,] -0.6 -0.2 -1.00 -4.40 1.00 0.0 -1.2 -2.6 -0.9 0.5 0.3 -2.7 [3,] 0.9 0.4 0.45 -0.65 2.05 1.0 0.8 -2.3 -0.3 0.6 1.1 -0.6 [4,] 3.1 0.7 1.60 1.30 2.10 1.8 1.8 -0.7 1.1 0.6 1.4 0.0 [5,] 4.0 1.1 2.10 3.60 2.30 3.0 1.9 2.0 3.3 0.6 1.8 2.0 $n [1] 6 6 6 6 6 6 6 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.48662 -0.1805291 -1.227084 -4.326684 1.340464 -0.1610581 -1.135097 [2,] 3.28662 0.9805291 2.127084 3.026684 2.759536 2.1610581 2.735097 [,8] [,9] [,10] [,11] [,12] [1,] -3.6425352 -1.713195 0.5293403 0.3227428 -2.507813 [2,] -0.9574648 1.113195 0.6706597 1.8772572 1.307813 $out [1] -2.1 -5.8 3.8 -0.3 $group [1] 5 8 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.39999999999999, -0.599999999999994, 0.899999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/643ek1457473846.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,] 86.30 88.3 86.70 93.10 96.90 104.70 [2,] 88.60 89.0 90.55 94.95 101.35 105.90 [3,] 89.55 90.8 93.10 97.50 106.00 107.80 [4,] 91.10 92.6 96.00 101.00 108.90 108.05 [5,] 91.60 93.8 97.10 104.50 110.30 110.30 $n [1] 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 88.40973 89.15802 90.61422 94.74055 102.5564 106.599 [2,] 90.69027 92.44198 95.58578 100.25945 109.4436 109.001 $out [1] 84.0 95.4 96.8 $group [1] 1 1 1 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(86.3, 88.6, 89.55, 91.1, 91.6, 88.3, 89, 90.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7osml1457473846.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,] 95.36000 93.400 92.00000 [2,] 95.93167 95.200 94.42500 [3,] 96.71833 95.750 95.80625 [4,] 97.55833 97.275 97.30625 [5,] 98.48333 99.250 98.61250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 95.97640 94.80358 94.49209 [2,] 97.46027 96.69642 97.12041 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.36, 95.9316666666667, 96.7183333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o1fz1457473846.ps tmp/1o1fz1457473846.png",intern=TRUE)) character(0) > try(system("convert tmp/2ovs11457473846.ps tmp/2ovs11457473846.png",intern=TRUE)) character(0) > try(system("convert tmp/34k711457473846.ps tmp/34k711457473846.png",intern=TRUE)) character(0) > try(system("convert tmp/485tv1457473846.ps tmp/485tv1457473846.png",intern=TRUE)) character(0) > try(system("convert tmp/5s2kz1457473846.ps tmp/5s2kz1457473846.png",intern=TRUE)) character(0) > try(system("convert tmp/643ek1457473846.ps tmp/643ek1457473846.png",intern=TRUE)) character(0) > try(system("convert tmp/7osml1457473846.ps tmp/7osml1457473846.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.519 0.422 2.962