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(1.9,2,2,1.8,1.6,1.4,0.2,0.3,0.4,0.7,1,1.1,0.8,0.8,1,1.1,1,0.8,1.6,1.5,1.6,1.6,1.6,1.9,2,1.9,2,2.1,2.3,2.3,2.6,2.6,2.7,2.6,2.6,2.4,2.5,2.5,2.5,2.4,2.1,2.1,2.3,2.3,2.3,2.9,2.8,2.9,3,3,2.9,2.6,2.8,2.9,3.1,2.8,2.4,1.6,1.5,1.7,1.4,1.1,0.8,1.2,0.8,0.9,0.9,1,0.9,1.1,1,0.7,0,0.2,0.4,0.6,1.1,1,1,0.8,0.6,0.6,0.7,0.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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.9 0.8 2.0 2.5 3.0 1.4 0.0 NA [2,] 2.0 0.8 1.9 2.5 3.0 1.1 0.2 NA [3,] 2.0 1.0 2.0 2.5 2.9 0.8 0.4 NA [4,] 1.8 1.1 2.1 2.4 2.6 1.2 0.6 NA [5,] 1.6 1.0 2.3 2.1 2.8 0.8 1.1 NA [6,] 1.4 0.8 2.3 2.1 2.9 0.9 1.0 NA [7,] 0.2 1.6 2.6 2.3 3.1 0.9 1.0 NA [8,] 0.3 1.5 2.6 2.3 2.8 1.0 0.8 NA [9,] 0.4 1.6 2.7 2.3 2.4 0.9 0.6 NA [10,] 0.7 1.6 2.6 2.9 1.6 1.1 0.6 NA [11,] 1.0 1.6 2.6 2.8 1.5 1.0 0.7 NA [12,] 1.1 1.9 2.4 2.9 1.7 0.7 0.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.1 0.0 -0.1 0.0 0.0 -0.3 0.2 NA [2,] 0.0 0.2 0.1 0.0 -0.1 -0.3 0.2 NA [3,] -0.2 0.1 0.1 -0.1 -0.3 0.4 0.2 NA [4,] -0.2 -0.1 0.2 -0.3 0.2 -0.4 0.5 NA [5,] -0.2 -0.2 0.0 0.0 0.1 0.1 -0.1 NA [6,] -1.2 0.8 0.3 0.2 0.2 0.0 0.0 NA [7,] 0.1 -0.1 0.0 0.0 -0.3 0.1 -0.2 NA [8,] 0.1 0.1 0.1 0.0 -0.4 -0.1 -0.2 NA [9,] 0.3 0.0 -0.1 0.6 -0.8 0.2 0.0 NA [10,] 0.3 0.0 0.0 -0.1 -0.1 -0.1 0.1 NA [11,] 0.1 0.3 -0.2 0.1 0.2 -0.3 0.0 NA [12,] -0.3 0.1 0.1 0.1 -0.3 -0.7 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/15kqp1457981769.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/2zhiz1457981769.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/3kzse1457981769.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/4fsvy1457981769.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,] 0.00 0.20 0.40 0.60 0.80 0.80 0.20 0.30 0.40 0.6 0.7 0.70 [2,] 1.10 0.95 0.90 1.15 1.05 0.95 0.95 0.90 0.75 0.9 1.0 0.90 [3,] 1.90 1.90 2.00 1.80 1.60 1.40 1.60 1.50 1.60 1.6 1.5 1.70 [4,] 2.25 2.25 2.25 2.25 2.20 2.20 2.45 2.45 2.35 2.1 2.1 2.15 [5,] 3.00 3.00 2.90 2.60 2.80 2.90 3.10 2.80 2.70 2.9 2.8 2.90 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.213239 1.123661 1.193802 1.143098 0.9132386 0.6535202 0.7042242 0.574365 [2,] 2.586761 2.676339 2.806198 2.456902 2.2867614 2.1464798 2.4957758 2.425635 [,9] [,10] [,11] [,12] [1,] 0.6445058 0.8833794 0.8430977 0.9535202 [2,] 2.5554942 2.3166206 2.1569023 2.4464798 $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(0, 1.1, 1.9, 2.25, 3, 0.2, 0.95, 1.9, 2.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5d8gp1457981769.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.10 -0.30 -0.30 -0.40 -0.20 0.00 -0.30 -0.40 -0.10 -0.10 -0.30 -0.7 [2,] -0.05 -0.05 -0.15 -0.25 -0.15 0.00 -0.15 -0.15 -0.05 -0.10 -0.10 -0.3 [3,] 0.00 0.00 0.10 -0.10 0.00 0.20 0.00 0.00 0.00 0.00 0.10 -0.1 [4,] 0.05 0.15 0.15 0.20 0.05 0.25 0.05 0.10 0.25 0.05 0.15 0.1 [5,] 0.20 0.20 0.40 0.50 0.10 0.30 0.10 0.10 0.60 0.10 0.30 0.1 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.05971839 -0.1194368 -0.07915516 -0.3687327 -0.1194368 0.05070403 [2,] 0.05971839 0.1194368 0.27915516 0.1687327 0.1194368 0.34929597 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1194368 -0.149296 -0.1791552 -0.08957758 -0.04929597 -0.3580129 [2,] 0.1194368 0.149296 0.1791552 0.08957758 0.24929597 0.1580129 $out [1] -0.3 -1.2 0.8 -0.8 0.3 $group [1] 1 6 6 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.1, -0.05, 0, 0.05, 0.2, -0.3, -0.05, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/607xm1457981769.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] [1,] 0.20 0.8 1.90 2.10 1.50 0.70 0.00 NA [2,] 0.55 0.9 2.05 2.30 2.05 0.85 0.50 NA [3,] 1.25 1.3 2.35 2.45 2.80 0.95 0.65 NA [4,] 1.85 1.6 2.60 2.65 2.95 1.10 0.90 NA [5,] 2.00 1.9 2.70 2.90 3.10 1.40 1.10 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.6570613 0.9807253 2.099141 2.290363 2.389504 0.8359733 0.4675573 NA [2,] 1.8429387 1.6192747 2.600859 2.609637 3.210496 1.0640267 0.8324427 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(0.2, 0.55, 1.25, 1.85, 2, 0.8, 0.9, 1.3, 1.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7gqzw1457981769.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.557143 1.40 1.5000 [2,] 1.607143 1.55 1.5500 [3,] 1.635714 1.60 1.5875 [4,] 1.664286 1.85 1.6750 [5,] 1.685714 2.00 1.7000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.609651 1.463168 1.530487 [2,] 1.661778 1.736832 1.644513 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.55714285714286, 1.60714285714286, 1.63571428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15kqp1457981769.ps tmp/15kqp1457981769.png",intern=TRUE)) character(0) > try(system("convert tmp/2zhiz1457981769.ps tmp/2zhiz1457981769.png",intern=TRUE)) character(0) > try(system("convert tmp/3kzse1457981769.ps tmp/3kzse1457981769.png",intern=TRUE)) character(0) > try(system("convert tmp/4fsvy1457981769.ps tmp/4fsvy1457981769.png",intern=TRUE)) character(0) > try(system("convert tmp/5d8gp1457981769.ps tmp/5d8gp1457981769.png",intern=TRUE)) character(0) > try(system("convert tmp/607xm1457981769.ps tmp/607xm1457981769.png",intern=TRUE)) character(0) > try(system("convert tmp/7gqzw1457981769.ps tmp/7gqzw1457981769.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.576 0.485 3.091