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(94.94,96.24,95.77,94.41,95.09,95.37,95.17,95.05,95.33,95.42,95.95,96.12,96.94,98.73,98.03,97.42,98.39,98.77,98.46,98.3,98.25,98.33,98.61,98.99,98.8,100.26,100.85,98.87,99.81,100.44,100.07,99.8,99.77,99.9,100.58,100.86,101.05,101.3,101.45,101.13,101.38,101.03,100.79,100.84,101.17,101.36,101.14,101.24,100.98,102.23,99.96,101.43,101.72,101.51,101.29,101.55,101.6,101.88,102.11,102.24) > 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] 60 > (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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 94.94 96.94 98.80 101.05 100.98 NA [2,] 96.24 98.73 100.26 101.30 102.23 NA [3,] 95.77 98.03 100.85 101.45 99.96 NA [4,] 94.41 97.42 98.87 101.13 101.43 NA [5,] 95.09 98.39 99.81 101.38 101.72 NA [6,] 95.37 98.77 100.44 101.03 101.51 NA [7,] 95.17 98.46 100.07 100.79 101.29 NA [8,] 95.05 98.30 99.80 100.84 101.55 NA [9,] 95.33 98.25 99.77 101.17 101.60 NA [10,] 95.42 98.33 99.90 101.36 101.88 NA [11,] 95.95 98.61 100.58 101.14 102.11 NA [12,] 96.12 98.99 100.86 101.24 102.24 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.30 1.79 1.46 0.25 1.25 NA [2,] -0.47 -0.70 0.59 0.15 -2.27 NA [3,] -1.36 -0.61 -1.98 -0.32 1.47 NA [4,] 0.68 0.97 0.94 0.25 0.29 NA [5,] 0.28 0.38 0.63 -0.35 -0.21 NA [6,] -0.20 -0.31 -0.37 -0.24 -0.22 NA [7,] -0.12 -0.16 -0.27 0.05 0.26 NA [8,] 0.28 -0.05 -0.03 0.33 0.05 NA [9,] 0.09 0.08 0.13 0.19 0.28 NA [10,] 0.53 0.28 0.68 -0.22 0.23 NA [11,] 0.17 0.38 0.28 0.10 0.13 NA [12,] 0.82 -0.19 0.19 -0.26 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/1fdkk1476383817.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/2yegt1476383817.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/3s5h21476383817.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/401mt1476383817.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] [1,] 94.94 96.24 95.77 94.41 95.09 98.77 95.17 95.05 95.33 95.42 [2,] 96.94 98.73 98.03 97.42 98.39 98.77 98.46 98.30 98.25 98.33 [3,] 98.80 100.26 99.96 98.87 99.81 100.44 100.07 99.80 99.77 99.90 [4,] 100.98 101.30 100.85 101.13 101.38 101.03 100.79 100.84 101.17 101.36 [5,] 101.05 102.23 101.45 101.43 101.72 101.51 101.29 101.55 101.60 101.88 [,11] [,12] [1,] 95.95 96.12 [2,] 98.61 98.99 [3,] 100.58 100.86 [4,] 101.14 101.24 [5,] 102.11 102.24 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.94535 98.44404 97.9674 96.24852 97.69727 98.84309 98.42363 [2,] 101.65465 102.07596 101.9526 101.49148 101.92273 102.03691 101.71637 [,8] [,9] [,10] [,11] [,12] [1,] 98.00524 97.70674 97.75901 98.79231 99.27016 [2,] 101.59476 101.83326 102.04099 102.36769 102.44984 $out [1] 95.37 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.94, 96.94, 98.8, 100.98, 101.05, 96.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qpmf1476383817.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.25 -0.70 -1.98 0.25 -0.35 -0.37 -0.27 -0.05 0.08 0.23 0.10 -0.260 [2,] 1.25 -0.70 -1.36 0.29 -0.21 -0.31 -0.16 -0.03 0.09 0.23 0.13 -0.225 [3,] 1.30 -0.47 -0.61 0.68 0.28 -0.24 -0.12 0.05 0.13 0.28 0.17 0.000 [4,] 1.46 0.15 -0.32 0.94 0.38 -0.22 0.05 0.28 0.19 0.53 0.28 0.505 [5,] 1.46 0.59 -0.32 0.97 0.63 -0.20 0.26 0.33 0.28 0.68 0.38 0.820 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.151615 -1.0706079 -1.3448614 0.2207116 -0.1368925 -0.3035938 -0.26838547 [2,] 1.448385 0.1306079 0.1248614 1.1392884 0.6968925 -0.1764062 0.02838547 [,8] [,9] [,10] [,11] [,12] [1,] -0.1690452 0.05934025 0.06802076 0.06401038 -0.5767 [2,] 0.2690452 0.20065975 0.49197924 0.27598962 0.5767 $out [1] 1.79 0.25 -2.27 1.47 -0.22 $group [1] 1 1 2 3 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.25, 1.25, 1.3, 1.46000000000001, 1.46000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xln81476383817.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,] 94.41 97.42 98.800 100.790 100.980 NA [2,] 95.07 98.14 99.785 101.040 101.360 NA [3,] 95.35 98.36 99.985 101.155 101.575 NA [4,] 95.86 98.67 100.510 101.330 101.995 NA [5,] 96.24 98.99 100.860 101.450 102.240 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 94.98968 98.11826 99.65432 101.0227 101.2854 NA [2,] 95.71032 98.60174 100.31568 101.2873 101.8646 NA $out [1] 96.94 99.96 $group [1] 2 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(94.41, 95.07, 95.35, 95.86, 96.24, 97.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7eyfr1476383817.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,] 98.542 99.770 98.9600 [2,] 99.132 99.785 99.5050 [3,] 99.251 99.930 99.7775 [4,] 99.551 100.350 99.8925 [5,] 99.890 100.860 100.1150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.05989 99.6723 99.60076 [2,] 99.44211 100.1877 99.95424 $out [1] 98.80 98.87 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.542, 99.132, 99.251, 99.551, 99.89, 99.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fdkk1476383817.ps tmp/1fdkk1476383817.png",intern=TRUE)) character(0) > try(system("convert tmp/2yegt1476383817.ps tmp/2yegt1476383817.png",intern=TRUE)) character(0) > try(system("convert tmp/3s5h21476383817.ps tmp/3s5h21476383817.png",intern=TRUE)) character(0) > try(system("convert tmp/401mt1476383817.ps tmp/401mt1476383817.png",intern=TRUE)) character(0) > try(system("convert tmp/5qpmf1476383817.ps tmp/5qpmf1476383817.png",intern=TRUE)) character(0) > try(system("convert tmp/6xln81476383817.ps tmp/6xln81476383817.png",intern=TRUE)) character(0) > try(system("convert tmp/7eyfr1476383817.ps tmp/7eyfr1476383817.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.439 0.152 2.637