R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(78.46,78.59,81.37,83.61,84.65,84.56,83.85,84.08,85.41,85.75,86.38,88.87,90.37,92.21,95.75,97.29,98.29,99.51,99.04,98.9,100.74,100.3,101.68,101.3,103.13,104.17,105.98,106.25,104.01,101.68,101.93,104.41,105.51,104.71,103.14,102.66,102.68,101.89,101.37,101.16,99.34,99.35,99.88,99.31,99.91,98.39,98.02,98.7,98.01,98.42,98.2,93.5,93.17,93.42,93.13,92.31,92.09,92.62,91.43,89.38,86.21,86.65,88.62,87.3,88.33,88.67,88.23,88.85,90.38,89.65,89.2,87.87) > 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,] 78.46 90.37 103.13 102.68 98.01 86.21 NA [2,] 78.59 92.21 104.17 101.89 98.42 86.65 NA [3,] 81.37 95.75 105.98 101.37 98.20 88.62 NA [4,] 83.61 97.29 106.25 101.16 93.50 87.30 NA [5,] 84.65 98.29 104.01 99.34 93.17 88.33 NA [6,] 84.56 99.51 101.68 99.35 93.42 88.67 NA [7,] 83.85 99.04 101.93 99.88 93.13 88.23 NA [8,] 84.08 98.90 104.41 99.31 92.31 88.85 NA [9,] 85.41 100.74 105.51 99.91 92.09 90.38 NA [10,] 85.75 100.30 104.71 98.39 92.62 89.65 NA [11,] 86.38 101.68 103.14 98.02 91.43 89.20 NA [12,] 88.87 101.30 102.66 98.70 89.38 87.87 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.13 1.84 1.04 -0.79 0.41 0.44 NA [2,] 2.78 3.54 1.81 -0.52 -0.22 1.97 NA [3,] 2.24 1.54 0.27 -0.21 -4.70 -1.32 NA [4,] 1.04 1.00 -2.24 -1.82 -0.33 1.03 NA [5,] -0.09 1.22 -2.33 0.01 0.25 0.34 NA [6,] -0.71 -0.47 0.25 0.53 -0.29 -0.44 NA [7,] 0.23 -0.14 2.48 -0.57 -0.82 0.62 NA [8,] 1.33 1.84 1.10 0.60 -0.22 1.53 NA [9,] 0.34 -0.44 -0.80 -1.52 0.53 -0.73 NA [10,] 0.63 1.38 -1.57 -0.37 -1.19 -0.45 NA [11,] 2.49 -0.38 -0.48 0.68 -2.05 -1.33 NA [12,] 1.50 1.83 0.02 -0.69 -3.17 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/1iha41489419333.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/2nmsc1489419333.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/3clh21489419333.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/4btwk1489419333.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] [1,] 78.46 78.590 81.370 83.610 84.65 84.560 83.850 84.080 85.41 [2,] 86.21 86.650 88.620 87.300 88.33 88.670 88.230 88.850 90.38 [3,] 94.19 95.315 96.975 95.395 95.73 96.385 96.085 95.605 96.00 [4,] 102.68 101.890 101.370 101.160 99.34 99.510 99.880 99.310 100.74 [5,] 103.13 104.170 105.980 106.250 104.01 101.680 101.930 104.410 105.51 [,10] [,11] [,12] [1,] 85.750 86.380 87.87 [2,] 89.650 89.200 88.87 [3,] 95.505 94.725 94.04 [4,] 100.300 101.680 101.30 [5,] 104.710 103.140 102.66 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 83.56632 85.48471 88.75084 86.45485 88.62819 89.39285 88.57037 [2,] 104.81368 105.14529 105.19916 104.33515 102.83181 103.37715 103.59963 [,8] [,9] [,10] [,11] [,12] [1,] 88.85796 89.31747 88.63541 86.675 86.02225 [2,] 102.35204 102.68253 102.37459 102.775 102.05775 $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(78.46, 86.21, 94.19, 102.68, 103.13, 78.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ftdo1489419333.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] [1,] -0.790 -0.52 -4.70 -2.240 -0.09 -0.710 -0.820 -0.220 -1.520 -1.57 -2.05 [2,] 0.130 -0.22 -1.32 -1.820 -0.09 -0.470 -0.570 0.600 -0.800 -1.19 -1.33 [3,] 0.425 1.89 0.03 0.335 0.13 -0.365 0.045 1.215 -0.585 -0.41 -0.43 [4,] 1.040 2.78 1.54 1.030 0.34 0.250 0.620 1.530 0.340 0.63 0.68 [5,] 1.840 3.54 2.24 1.040 0.34 0.530 0.620 1.840 0.530 1.38 2.49 [,12] [1,] -3.17 [2,] -0.69 [3,] 0.02 [4,] 1.50 [5,] 1.83 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1619794 -0.0450969 -1.814792 -1.503342 -0.1473639 -0.82942326 [2,] 1.0119794 3.8250969 1.874792 2.173342 0.4073639 0.09942326 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.7225884 0.61512 -1.3203368 -1.5839588 -1.7265149 -1.527448 [2,] 0.8125884 1.81488 0.1503368 0.7639588 0.8665149 1.567448 $out [1] 1.22 -2.33 2.48 $group [1] 5 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.790000000000006, 0.13000000000001, 0.425000000000004, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6yjhb1489419333.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,] 78.46 92.21 101.680 98.020 89.380 86.210 NA [2,] 82.49 96.52 102.895 99.005 92.200 87.585 NA [3,] 84.32 98.97 104.090 99.615 93.150 88.475 NA [4,] 85.58 100.52 105.110 101.265 95.755 89.025 NA [5,] 88.87 101.68 106.250 102.680 98.420 90.380 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 82.91063 97.14557 103.0797 98.5842 91.52854 87.81821 NA [2,] 85.72937 100.79443 105.1003 100.6458 94.77146 89.13179 NA $out [1] 90.37 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(78.46, 82.49, 84.32, 85.58, 88.87, 92.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7s2vx1489419333.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,] 93.65500 94.0400 94.30875 [2,] 94.43750 95.0200 94.49125 [3,] 94.72000 95.5550 94.61312 [4,] 95.09500 96.0425 95.18438 [5,] 95.67333 96.9750 95.67000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.42011 95.08863 94.29699 [2,] 95.01989 96.02137 94.92926 $out [1] 93.14333 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.655, 94.4375, 94.72, 95.095, 95.6733333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1iha41489419333.ps tmp/1iha41489419333.png",intern=TRUE)) character(0) > try(system("convert tmp/2nmsc1489419333.ps tmp/2nmsc1489419333.png",intern=TRUE)) character(0) > try(system("convert tmp/3clh21489419333.ps tmp/3clh21489419333.png",intern=TRUE)) character(0) > try(system("convert tmp/4btwk1489419333.ps tmp/4btwk1489419333.png",intern=TRUE)) character(0) > try(system("convert tmp/5ftdo1489419333.ps tmp/5ftdo1489419333.png",intern=TRUE)) character(0) > try(system("convert tmp/6yjhb1489419333.ps tmp/6yjhb1489419333.png",intern=TRUE)) character(0) > try(system("convert tmp/7s2vx1489419333.ps tmp/7s2vx1489419333.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.819 0.216 3.105