R version 3.3.0 (2016-05-03) -- "Supposedly Educational" 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(87.5,87.3,87.8,88.1,88.0,87.8,87.0,87.2,87.0,89.4,89.1,87.8,87.8,88.0,86.5,84.1,84.3,84.7,85.7,86.4,86.0,86.9,89.1,90.7,89.8,89.4,88.6,86.8,86.8,89.5,88.5,91.2,92.3,92.0,92.8,92.9,92.7,94.2,94.0,94.3,94.8,94.7,95.1,97.0,97.9,97.3,96.5,98.1,99.3,99.9,99.9,99.9,99.8,99.5,99.9,100.1,100.1,100.2,100.6,100.8,100.8,100.5,101.0,100.5,99.0,97.9,97.6,97.2,96.5,96.3,96.3,96.2,95.6,93.5,93.2,93.6,94.6,96.1,98.4,99.6,99.4,99.7,100.1,99.9) > par1 = '36' > par1 <- '36' > #'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] 2 > 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] 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > arr [,1] [,2] [,3] [1,] 87.5 92.7 95.6 [2,] 87.3 94.2 93.5 [3,] 87.8 94.0 93.2 [4,] 88.1 94.3 93.6 [5,] 88.0 94.8 94.6 [6,] 87.8 94.7 96.1 [7,] 87.0 95.1 98.4 [8,] 87.2 97.0 99.6 [9,] 87.0 97.9 99.4 [10,] 89.4 97.3 99.7 [11,] 89.1 96.5 100.1 [12,] 87.8 98.1 99.9 [13,] 87.8 99.3 NA [14,] 88.0 99.9 NA [15,] 86.5 99.9 NA [16,] 84.1 99.9 NA [17,] 84.3 99.8 NA [18,] 84.7 99.5 NA [19,] 85.7 99.9 NA [20,] 86.4 100.1 NA [21,] 86.0 100.1 NA [22,] 86.9 100.2 NA [23,] 89.1 100.6 NA [24,] 90.7 100.8 NA [25,] 89.8 100.8 NA [26,] 89.4 100.5 NA [27,] 88.6 101.0 NA [28,] 86.8 100.5 NA [29,] 86.8 99.0 NA [30,] 89.5 97.9 NA [31,] 88.5 97.6 NA [32,] 91.2 97.2 NA [33,] 92.3 96.5 NA [34,] 92.0 96.3 NA [35,] 92.8 96.3 NA [36,] 92.9 96.2 NA > darr [,1] [,2] [,3] [1,] -0.2 1.5 -2.1 [2,] 0.5 -0.2 -0.3 [3,] 0.3 0.3 0.4 [4,] -0.1 0.5 1.0 [5,] -0.2 -0.1 1.5 [6,] -0.8 0.4 2.3 [7,] 0.2 1.9 1.2 [8,] -0.2 0.9 -0.2 [9,] 2.4 -0.6 0.3 [10,] -0.3 -0.8 0.4 [11,] -1.3 1.6 -0.2 [12,] 0.0 1.2 NA [13,] 0.2 0.6 NA [14,] -1.5 0.0 NA [15,] -2.4 0.0 NA [16,] 0.2 -0.1 NA [17,] 0.4 -0.3 NA [18,] 1.0 0.4 NA [19,] 0.7 0.2 NA [20,] -0.4 0.0 NA [21,] 0.9 0.1 NA [22,] 2.2 0.4 NA [23,] 1.6 0.2 NA [24,] -0.9 0.0 NA [25,] -0.4 -0.3 NA [26,] -0.8 0.5 NA [27,] -1.8 -0.5 NA [28,] 0.0 -1.5 NA [29,] 2.7 -1.1 NA [30,] -1.0 -0.3 NA [31,] 2.7 -0.4 NA [32,] 1.1 -0.7 NA [33,] -0.3 -0.2 NA [34,] 0.8 0.0 NA [35,] 0.1 -0.1 NA [36,] -0.2 -0.6 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/1jfgw1463386564.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/2s7r21463386564.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/3l3x51463386564.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/4tkbj1463386564.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] [,13] [1,] 87.50 87.30 87.8 88.10 88.0 87.80 87.00 87.2 87.00 89.40 89.1 87.80 87.80 [2,] 90.10 90.40 90.5 90.85 91.3 91.25 91.05 92.1 92.45 93.35 92.8 92.95 87.80 [3,] 92.70 93.50 93.2 93.60 94.6 94.70 95.10 97.0 97.90 97.30 96.5 98.10 93.55 [4,] 94.15 93.85 93.6 93.95 94.7 95.40 96.75 98.3 98.65 98.50 98.3 99.00 99.30 [5,] 95.60 94.20 94.0 94.30 94.8 96.10 98.40 99.6 99.40 99.70 100.1 99.90 99.30 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 88.00 86.5 84.1 84.30 84.7 85.7 86.40 86.00 86.90 89.10 90.70 [2,] 88.00 86.5 84.1 84.30 84.7 85.7 86.40 86.00 86.90 89.10 90.70 [3,] 93.95 93.2 92.0 92.05 92.1 92.8 93.25 93.05 93.55 94.85 95.75 [4,] 99.90 99.9 99.9 99.80 99.5 99.9 100.10 100.10 100.20 100.60 100.80 [5,] 99.90 99.9 99.9 99.80 99.5 99.9 100.10 100.10 100.20 100.60 100.80 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 89.8 89.40 88.6 86.80 86.8 89.5 88.50 91.2 92.3 92.00 92.80 92.90 [2,] 89.8 89.40 88.6 86.80 86.8 89.5 88.50 91.2 92.3 92.00 92.80 92.90 [3,] 95.3 94.95 94.8 93.65 92.9 93.7 93.05 94.2 94.4 94.15 94.55 94.55 [4,] 100.8 100.50 101.0 100.50 99.0 97.9 97.60 97.2 96.5 96.30 96.30 96.20 [5,] 100.8 100.50 101.0 100.50 99.0 97.9 97.60 97.2 96.5 96.30 96.30 96.20 $n [1] 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.00554 90.35286 90.37214 90.77214 91.49847 90.91431 89.90038 91.34428 [2,] 96.39446 96.64714 96.02786 96.42786 97.70153 98.48569 100.29962 102.65572 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [1,] 92.24428 92.6021 91.48283 92.58111 80.70187 80.65498 78.22914 [2,] 103.55572 101.9979 101.51717 103.61889 106.39813 107.24502 108.17086 [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 74.34779 74.73295 75.56502 76.93535 77.94397 77.29708 78.69086 [2,] 109.65221 109.36705 108.63498 108.66465 108.55603 108.80292 108.40914 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [1,] 82.00187 84.46599 83.01048 82.54876 80.94636 78.34397 79.26981 [2,] 107.69813 107.03401 107.58952 107.35124 108.65364 108.95603 106.53019 [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 84.31528 82.88322 87.49663 89.70764 89.34592 90.6397 90.86315 [2,] 103.08472 103.21678 100.90337 99.09236 98.95408 98.4603 98.23685 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" Warning message: In bxp(list(stats = c(87.5, 90.1, 92.7, 94.15, 95.6, 87.3, 90.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/567ky1463386564.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.10 -0.30 0.30 -0.10 -0.20 -0.80 0.20 -0.20 -0.60 -0.80 -1.30 0.0 [2,] -1.15 -0.25 0.30 0.20 -0.15 -0.20 0.70 -0.20 -0.15 -0.55 -0.75 0.0 [3,] -0.20 -0.20 0.30 0.50 -0.10 0.40 1.20 -0.20 0.30 -0.30 -0.20 0.6 [4,] 0.65 0.15 0.35 0.75 0.70 1.35 1.55 0.35 1.35 0.05 0.70 1.2 [5,] 1.50 0.50 0.40 1.00 1.50 2.30 1.90 0.90 2.40 0.40 1.60 1.2 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 0.2 -1.50 -2.4 -0.10 -0.30 0.4 0.20 -0.4 0.1 0.4 0.2 -0.90 [2,] 0.2 -1.50 -2.4 -0.10 -0.30 0.4 0.20 -0.4 0.1 0.4 0.2 -0.90 [3,] 0.4 -0.75 -1.2 0.05 0.05 0.7 0.45 -0.2 0.5 1.3 0.9 -0.45 [4,] 0.6 0.00 0.0 0.20 0.40 1.0 0.70 0.0 0.9 2.2 1.6 0.00 [5,] 0.6 0.00 0.0 0.20 0.40 1.0 0.70 0.0 0.9 2.2 1.6 0.00 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -0.40 -0.80 -1.80 -1.50 -1.1 -1.00 -0.40 -0.7 -0.30 0.0 -1.000000e-01 [2,] -0.40 -0.80 -1.80 -1.50 -1.1 -1.00 -0.40 -0.7 -0.30 0.0 -1.000000e-01 [3,] -0.35 -0.15 -1.15 -0.75 0.8 -0.65 1.15 0.2 -0.25 0.4 7.105427e-15 [4,] -0.30 0.50 -0.50 0.00 2.7 -0.30 2.70 1.1 -0.20 0.8 1.000000e-01 [5,] -0.30 0.50 -0.50 0.00 2.7 -0.30 2.70 1.1 -0.20 0.8 1.000000e-01 [,36] [1,] -0.6 [2,] -0.6 [3,] -0.4 [4,] -0.2 [5,] -0.2 $n [1] 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.841984 -0.5648854 0.2543893 -0.001717384 -0.8753814 -1.013931 0.4246186 [2,] 1.441984 0.1648854 0.3456107 1.001717384 0.6753814 1.813931 1.9753814 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -0.7017174 -1.06832 -0.8473281 -1.522709 -0.7406745 -0.04689149 -2.4258431 [2,] 0.3017174 1.66832 0.2473281 1.122709 1.9406745 0.84689149 0.9258431 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -3.881349 -0.2851686 -0.7320601 0.02966277 -0.1086144 -0.6468915 -0.393783 [2,] 1.481349 0.3851686 0.8320601 1.37033723 1.0086144 0.2468915 1.393783 [,22] [,23] [,24] [,25] [,26] [,27] [1,] -0.7110117 -0.6641202 -1.4555058 -0.4617229 -1.602397 -2.6023973 [2,] 3.3110117 2.4641202 0.5555058 -0.2382771 1.302397 0.3023973 [,28] [,29] [,30] [,31] [,32] [,33] [,34] [1,] -2.4258431 -3.445469 -1.4320601 -2.313409 -1.811012 -0.3617229 -0.493783 [2,] 0.9258431 5.045469 0.1320601 4.613409 2.211012 -0.1382771 1.293783 [,35] [,36] [1,] -0.2234457 -0.84689149 [2,] 0.2234457 0.04689149 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" Warning message: In bxp(list(stats = c(-2.09999999999999, -1.15, -0.200000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6b6z71463386564.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] [1,] 84.10 92.7 93.20 [2,] 86.85 96.3 94.10 [3,] 87.80 98.0 97.25 [4,] 89.40 100.0 99.65 [5,] 92.90 101.0 100.10 $n [1] 36 36 12 $conf [,1] [,2] [,3] [1,] 87.1285 97.02567 94.71861 [2,] 88.4715 98.97433 99.78139 $out numeric(0) $group numeric(0) $names [1] "1" "2" NA Warning message: In bxp(list(stats = c(84.1, 86.85, 87.8, 89.4, 92.9, 92.7, 96.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wija1463386564.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,] 91.66667 92.00 92.000 [2,] 92.83333 93.20 92.950 [3,] 93.60000 94.05 93.675 [4,] 94.68333 94.90 94.825 [5,] 95.75000 97.30 95.975 $n [1] 36 36 36 $conf [,1] [,2] [,3] [1,] 93.11283 93.60233 93.18125 [2,] 94.08717 94.49767 94.16875 $out [1] 97.9 98.1 $group [1] 2 2 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1jfgw1463386564.ps tmp/1jfgw1463386564.png",intern=TRUE)) character(0) > try(system("convert tmp/2s7r21463386564.ps tmp/2s7r21463386564.png",intern=TRUE)) character(0) > try(system("convert tmp/3l3x51463386564.ps tmp/3l3x51463386564.png",intern=TRUE)) character(0) > try(system("convert tmp/4tkbj1463386564.ps tmp/4tkbj1463386564.png",intern=TRUE)) character(0) > try(system("convert tmp/567ky1463386564.ps tmp/567ky1463386564.png",intern=TRUE)) character(0) > try(system("convert tmp/6b6z71463386564.ps tmp/6b6z71463386564.png",intern=TRUE)) character(0) > try(system("convert tmp/7wija1463386564.ps tmp/7wija1463386564.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.409 0.505 2.943