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(87,93,89,88,90,91,91,90,90,90,88,85,91,93,94,90,91,93,93,92,92,92,94,93,95,98,98,95,97,100,100,100,98,98,98,99,97,100,104,96,99,102,101,101,99,99,101,102,103,102,104,103,103,102,101,101,103,103,103,103,103,104,98,102,103,103,102,103,102,102,103,103) > 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,] 87 91 95 97 103 103 NA [2,] 93 93 98 100 102 104 NA [3,] 89 94 98 104 104 98 NA [4,] 88 90 95 96 103 102 NA [5,] 90 91 97 99 103 103 NA [6,] 91 93 100 102 102 103 NA [7,] 91 93 100 101 101 102 NA [8,] 90 92 100 101 101 103 NA [9,] 90 92 98 99 103 102 NA [10,] 90 92 98 99 103 102 NA [11,] 88 94 98 101 103 103 NA [12,] 85 93 99 102 103 103 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6 2 3 3 -1 1 NA [2,] -4 1 0 4 2 -6 NA [3,] -1 -4 -3 -8 -1 4 NA [4,] 2 1 2 3 0 1 NA [5,] 1 2 3 3 -1 0 NA [6,] 0 0 0 -1 -1 -1 NA [7,] -1 -1 0 0 0 1 NA [8,] 0 0 -2 -2 2 -1 NA [9,] 0 0 0 0 0 0 NA [10,] -2 2 0 2 0 1 NA [11,] -3 -1 1 1 0 0 NA [12,] 6 2 -2 1 0 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/18zza1456923732.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/27k9w1456923732.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/3ra2q1456923732.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/4w0l91456923732.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,] 87 93 89 88.0 90 91 91.0 90.0 90.0 90.0 88.0 85.0 [2,] 91 93 94 90.0 91 93 93.0 92.0 92.0 92.0 94.0 93.0 [3,] 96 99 98 95.5 98 101 100.5 100.5 98.5 98.5 99.5 100.5 [4,] 103 102 104 102.0 103 102 101.0 101.0 102.0 102.0 103.0 103.0 [5,] 103 104 104 103.0 103 103 102.0 103.0 103.0 103.0 103.0 103.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.25961 93.19471 91.54968 87.75961 90.25961 95.19471 95.33974 [2,] 103.74039 104.80529 104.45032 103.24039 105.74039 106.80529 105.66026 [,8] [,9] [,10] [,11] [,12] [1,] 94.69471 92.04968 92.04968 93.69471 94.04968 [2,] 106.30529 104.95032 104.95032 105.30529 106.95032 $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(87, 91, 96, 103, 103, 93, 93, 99, 102, 104, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59iry1456923732.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,] -1.0 -6.0 -8 0.0 -1.0 -1.0 -1 -2.0 0 -2.0 -3 -2 [2,] 1.0 -4.0 -4 1.0 0.0 -1.0 -1 -2.0 0 0.0 -1 0 [3,] 2.5 0.5 -2 1.5 1.5 -0.5 0 -0.5 0 0.5 0 1 [4,] 3.0 2.0 -1 2.0 3.0 0.0 0 0.0 0 2.0 1 2 [5,] 6.0 4.0 -1 3.0 3.0 0.0 1 2.0 0 2.0 1 2 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.209935 -3.370194 -3.9350969 0.8549677 -0.4350969 -1.1450323 -0.6450323 [2,] 3.790065 4.370194 -0.0649031 2.1450323 3.4350969 0.1450323 0.6450323 [,8] [,9] [,10] [,11] [,12] [1,] -1.7900646 0 -0.7900646 -1.290065 -0.413195 [2,] 0.7900646 0 1.7900646 1.290065 2.413195 $out [1] 4 6 $group [1] 3 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1, 1, 2.5, 3, 6, -6, -4, 0.5, 2, 4, -8, -4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hdbp1456923732.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,] 85.0 90.0 95.0 96.0 101 102 NA [2,] 88.0 91.5 97.5 99.0 102 102 NA [3,] 90.0 92.5 98.0 100.5 103 103 NA [4,] 90.5 93.0 99.5 101.5 103 103 NA [5,] 93.0 94.0 100.0 104.0 104 104 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.85973 91.81584 97.08779 99.35973 102.5439 102.5439 NA [2,] 91.14027 93.18416 98.91221 101.64027 103.4561 103.4561 NA $out [1] 98 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(85, 88, 90, 90.5, 93, 90, 91.5, 92.5, 93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e1ky1456923732.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.16667 95.50 95.8750 [2,] 97.25000 98.00 97.3125 [3,] 97.66667 98.75 97.6875 [4,] 97.91667 100.50 98.5000 [5,] 98.50000 101.00 98.7500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.36260 97.60973 97.14587 [2,] 97.97074 99.89027 98.22913 $out [1] 96.00000 95.66667 $group [1] 1 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.1666666666667, 97.25, 97.6666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18zza1456923732.ps tmp/18zza1456923732.png",intern=TRUE)) character(0) > try(system("convert tmp/27k9w1456923732.ps tmp/27k9w1456923732.png",intern=TRUE)) character(0) > try(system("convert tmp/3ra2q1456923732.ps tmp/3ra2q1456923732.png",intern=TRUE)) character(0) > try(system("convert tmp/4w0l91456923732.ps tmp/4w0l91456923732.png",intern=TRUE)) character(0) > try(system("convert tmp/59iry1456923732.ps tmp/59iry1456923732.png",intern=TRUE)) character(0) > try(system("convert tmp/6hdbp1456923732.ps tmp/6hdbp1456923732.png",intern=TRUE)) character(0) > try(system("convert tmp/7e1ky1456923732.ps tmp/7e1ky1456923732.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.682 0.495 3.203