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(134.93,134.37,132.98,130.1,128.24,127.52,126.94,127.38,130.95,128.65,127.37,127.04,125.95,124.06,121.55,119.82,119.19,118.77,118.31,119.47,119.79,117.46,115.74,114.97,112.83,111.44,110.6,109.67,107.96,107.56,116.12,114.38,113.96,113.95,114.99,113.64,112.53,110.59,110.1,109.38,110.43,114.67,114.48,114.76,113.27,111.56,109.89,108.04,107.53,106.11,104.11,103,104.74,104.14,101.98,100.91,100.02,98.49,97.38,95.86,93.99,94.09,93.44,93.61,98.31,103.97,104.12,107.63,105.22,104.59,101.54,99.47) > 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,] 134.93 125.95 112.83 112.53 107.53 93.99 NA [2,] 134.37 124.06 111.44 110.59 106.11 94.09 NA [3,] 132.98 121.55 110.60 110.10 104.11 93.44 NA [4,] 130.10 119.82 109.67 109.38 103.00 93.61 NA [5,] 128.24 119.19 107.96 110.43 104.74 98.31 NA [6,] 127.52 118.77 107.56 114.67 104.14 103.97 NA [7,] 126.94 118.31 116.12 114.48 101.98 104.12 NA [8,] 127.38 119.47 114.38 114.76 100.91 107.63 NA [9,] 130.95 119.79 113.96 113.27 100.02 105.22 NA [10,] 128.65 117.46 113.95 111.56 98.49 104.59 NA [11,] 127.37 115.74 114.99 109.89 97.38 101.54 NA [12,] 127.04 114.97 113.64 108.04 95.86 99.47 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.56 -1.89 -1.39 -1.94 -1.42 0.10 NA [2,] -1.39 -2.51 -0.84 -0.49 -2.00 -0.65 NA [3,] -2.88 -1.73 -0.93 -0.72 -1.11 0.17 NA [4,] -1.86 -0.63 -1.71 1.05 1.74 4.70 NA [5,] -0.72 -0.42 -0.40 4.24 -0.60 5.66 NA [6,] -0.58 -0.46 8.56 -0.19 -2.16 0.15 NA [7,] 0.44 1.16 -1.74 0.28 -1.07 3.51 NA [8,] 3.57 0.32 -0.42 -1.49 -0.89 -2.41 NA [9,] -2.30 -2.33 -0.01 -1.71 -1.53 -0.63 NA [10,] -1.28 -1.72 1.04 -1.67 -1.11 -3.05 NA [11,] -0.33 -0.77 -1.35 -1.85 -1.52 -2.07 NA [12,] -1.09 -2.14 -1.11 -0.51 -1.87 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/13tfb1476370596.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/217yp1476370596.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/3n2s11476370596.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/4fpp91476370596.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,] 93.99 94.090 93.44 93.610 98.310 103.970 101.98 100.91 100.020 [2,] 107.53 106.110 104.11 103.000 104.740 104.140 104.12 107.63 105.220 [3,] 112.68 111.015 110.35 109.525 109.195 111.115 115.30 114.57 113.615 [4,] 125.95 124.060 121.55 119.820 119.190 118.770 118.31 119.47 119.790 [5,] 134.93 134.370 132.98 130.100 128.240 127.520 126.94 127.38 130.950 [,10] [,11] [,12] [1,] 98.490 97.38 95.86 [2,] 104.590 101.54 99.47 [3,] 112.755 112.44 110.84 [4,] 117.460 115.74 114.97 [5,] 128.650 127.37 127.04 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.7985 99.43667 99.10064 98.67556 99.87428 101.6782 106.147 106.9328 [2,] 124.5615 122.59333 121.59936 120.37444 118.51572 120.5518 124.453 122.2072 [,9] [,10] [,11] [,12] [1,] 104.2169 104.4534 103.2805 100.842 [2,] 123.0131 121.0566 121.5995 120.838 $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(93.99, 107.53, 112.68, 125.95, 134.93, 94.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5aypy1476370596.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,] -1.940 -2.510 -2.88 -1.86 -0.72 -0.580 -1.74 -2.410 -2.33 -1.720 -2.070 [2,] -1.890 -2.000 -1.73 -1.71 -0.60 -0.580 -1.07 -1.490 -2.30 -1.720 -1.850 [3,] -1.405 -1.115 -1.02 0.21 -0.41 -0.325 0.36 -0.655 -1.62 -1.475 -1.435 [4,] -0.560 -0.650 -0.72 1.74 4.24 0.150 1.16 0.320 -0.63 -1.110 -0.770 [5,] 0.100 -0.490 0.17 4.70 5.66 0.150 3.51 0.320 -0.01 -1.110 -0.330 [,12] [1,] -2.14 [2,] -1.87 [3,] -1.11 [4,] -1.09 [5,] -0.51 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.262893 -1.9857936 -1.6714826 -2.015361 -3.531956 -0.7958736 -1.078422 [2,] -0.547107 -0.2442064 -0.3685174 2.435361 2.711956 0.1458736 1.798422 [,8] [,9] [,10] [,11] [,12] [1,] -1.8225085 -2.6972039 -1.86847 -2.1316349 -1.661146 [2,] 0.5125085 -0.5427961 -1.08153 -0.7383651 -0.558854 $out [1] 8.56 -2.16 3.57 1.04 -3.05 $group [1] 6 6 8 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.94, -1.89, -1.405, -0.560000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nqme1476370596.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,] 126.940 114.970 107.560 108.040 95.860 93.440 NA [2,] 127.375 117.885 110.135 109.995 99.255 94.040 NA [3,] 128.445 119.330 113.235 111.075 102.490 100.505 NA [4,] 131.965 120.685 114.170 113.875 104.440 104.355 NA [5,] 134.930 124.060 116.120 114.760 107.530 107.630 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 126.3515 118.0529 111.3946 109.3053 100.1251 95.80026 NA [2,] 130.5385 120.6071 115.0754 112.8447 104.8549 105.20974 NA $out [1] 125.95 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(126.94, 127.375, 128.445, 131.965, 134.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7i7dm1476370596.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,] 109.8367 109.1950 108.1250 [2,] 111.3150 110.5950 111.1056 [3,] 112.6108 111.7775 111.8337 [4,] 113.7633 113.1850 113.2937 [5,] 114.6267 115.3000 115.7250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.4941 110.5962 110.8357 [2,] 113.7275 112.9588 112.8318 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(109.836666666667, 111.315, 112.610833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13tfb1476370596.ps tmp/13tfb1476370596.png",intern=TRUE)) character(0) > try(system("convert tmp/217yp1476370596.ps tmp/217yp1476370596.png",intern=TRUE)) character(0) > try(system("convert tmp/3n2s11476370596.ps tmp/3n2s11476370596.png",intern=TRUE)) character(0) > try(system("convert tmp/4fpp91476370596.ps tmp/4fpp91476370596.png",intern=TRUE)) character(0) > try(system("convert tmp/5aypy1476370596.ps tmp/5aypy1476370596.png",intern=TRUE)) character(0) > try(system("convert tmp/6nqme1476370596.ps tmp/6nqme1476370596.png",intern=TRUE)) character(0) > try(system("convert tmp/7i7dm1476370596.ps tmp/7i7dm1476370596.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.499 0.242 2.784