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(96.07,95,93.27,91.94,91.62,91.01,90.62,97.72,99.09,99.72,100.22,99.15,101.16,101.8,103.31,101.19,99.09,95.91,94.56,95.76,100.36,102.67,103.58,100.89,103.46,104.86,104.88,104.46,103.83,101,99.36,96.71,95.23,95.62,95.8,94.79,95.39,94.9,94.84,94.68,94.17,94.1,93.84,94.2,97.76,98.26,99.63,98.75,100.15,99.63,99.72,98.87,98.4,97.99,98.46,98.73,98.66,98.14,98.39,97.78) > 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,] 96.07 101.16 103.46 95.39 100.15 NA [2,] 95.00 101.80 104.86 94.90 99.63 NA [3,] 93.27 103.31 104.88 94.84 99.72 NA [4,] 91.94 101.19 104.46 94.68 98.87 NA [5,] 91.62 99.09 103.83 94.17 98.40 NA [6,] 91.01 95.91 101.00 94.10 97.99 NA [7,] 90.62 94.56 99.36 93.84 98.46 NA [8,] 97.72 95.76 96.71 94.20 98.73 NA [9,] 99.09 100.36 95.23 97.76 98.66 NA [10,] 99.72 102.67 95.62 98.26 98.14 NA [11,] 100.22 103.58 95.80 99.63 98.39 NA [12,] 99.15 100.89 94.79 98.75 97.78 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.07 0.64 1.40 -0.49 -0.52 NA [2,] -1.73 1.51 0.02 -0.06 0.09 NA [3,] -1.33 -2.12 -0.42 -0.16 -0.85 NA [4,] -0.32 -2.10 -0.63 -0.51 -0.47 NA [5,] -0.61 -3.18 -2.83 -0.07 -0.41 NA [6,] -0.39 -1.35 -1.64 -0.26 0.47 NA [7,] 7.10 1.20 -2.65 0.36 0.27 NA [8,] 1.37 4.60 -1.48 3.56 -0.07 NA [9,] 0.63 2.31 0.39 0.50 -0.52 NA [10,] 0.50 0.91 0.18 1.37 0.25 NA [11,] -1.07 -2.69 -1.01 -0.88 -0.61 NA [12,] 2.01 2.57 0.60 1.40 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/1ch8n1476879124.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/2xyrr1476879124.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/3yloe1476879124.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/48kup1476879124.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] [1,] 95.39 94.90 93.27 91.94 91.62 91.01 90.62 94.20 97.76 98.14 95.80 [2,] 96.07 95.00 94.84 94.68 94.17 94.10 93.84 95.76 97.76 98.14 98.39 [3,] 100.15 99.63 99.72 98.87 98.40 95.91 94.56 96.71 98.66 98.26 99.63 [4,] 101.16 101.80 103.31 101.19 99.09 97.99 98.46 97.72 99.09 99.72 100.22 [5,] 103.46 104.86 104.88 104.46 103.83 101.00 99.36 98.73 100.36 99.72 100.22 [,12] [1,] 97.78 [2,] 97.78 [3,] 98.75 [4,] 99.15 [5,] 100.89 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.55342 94.82514 93.73512 94.27005 94.92354 93.16134 91.29552 [2,] 103.74658 104.43486 105.70488 103.46995 101.87646 98.65866 97.82448 [,8] [,9] [,10] [,11] [,12] [1,] 95.32507 97.72023 97.14358 98.33693 97.78196 [2,] 98.09493 99.59977 99.37642 100.92307 99.71804 $out [1] 95.23 102.67 95.62 103.58 94.79 $group [1] 9 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(95.39, 96.07, 100.15, 101.16, 103.46, 94.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rrqf1476879124.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.07 -0.06 -2.12 -0.63 -3.18 -1.64 0.27 -1.48 0.39 0.18 -1.07 0.600 [2,] -0.52 -0.06 -1.33 -0.63 -2.83 -1.35 0.27 -0.07 0.39 0.25 -1.07 1.000 [3,] -0.49 0.02 -0.85 -0.51 -0.61 -0.39 0.36 1.37 0.50 0.50 -1.01 1.705 [4,] 0.64 0.09 -0.42 -0.47 -0.41 -0.26 1.20 3.56 0.63 0.91 -0.88 2.290 [5,] 1.40 0.09 -0.16 -0.32 -0.07 0.47 1.20 4.60 0.63 1.37 -0.61 2.570 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.3096531 -0.08598962 -1.4930037 -0.6230556 -2.319966 -1.1601913 [2,] 0.3296531 0.12598962 -0.2069963 -0.3969444 1.099966 0.3801913 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.2971357 -1.194949 0.3304166 0.03364566 -1.1442535 0.6859 [2,] 1.0171357 3.934949 0.6695834 0.96635434 -0.8757465 2.7241 $out [1] -1.73 1.51 -2.10 7.10 -2.65 2.31 -0.52 -2.69 $group [1] 2 2 4 7 7 9 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.06999999999999, -0.52000000000001, -0.489999999999995, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69u9u1476879124.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,] 90.620 94.560 94.790 93.840 97.780 NA [2,] 91.780 97.500 95.710 94.185 98.265 NA [3,] 95.535 101.025 100.180 94.870 98.560 NA [4,] 99.120 102.235 104.145 98.010 99.250 NA [5,] 100.220 103.580 104.880 99.630 100.150 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.18718 98.86533 96.33274 93.12539 98.11073 NA [2,] 98.88282 103.18467 104.02726 96.61461 99.00927 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(90.62, 91.78, 95.535, 99.12, 100.22, 94.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mmn11476879124.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.368 94.560 96.0450 [2,] 97.023 97.485 96.6850 [3,] 98.250 98.705 98.4125 [4,] 99.221 99.630 98.7725 [5,] 99.524 100.150 99.3050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.24748 97.72665 97.46038 [2,] 99.25252 99.68335 99.36462 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.368, 97.023, 98.25, 99.221, 99.524, 94.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ch8n1476879124.ps tmp/1ch8n1476879124.png",intern=TRUE)) character(0) > try(system("convert tmp/2xyrr1476879124.ps tmp/2xyrr1476879124.png",intern=TRUE)) character(0) > try(system("convert tmp/3yloe1476879124.ps tmp/3yloe1476879124.png",intern=TRUE)) character(0) > try(system("convert tmp/48kup1476879124.ps tmp/48kup1476879124.png",intern=TRUE)) character(0) > try(system("convert tmp/5rrqf1476879124.ps tmp/5rrqf1476879124.png",intern=TRUE)) character(0) > try(system("convert tmp/69u9u1476879124.ps tmp/69u9u1476879124.png",intern=TRUE)) character(0) > try(system("convert tmp/7mmn11476879124.ps tmp/7mmn11476879124.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.562 0.209 2.815