R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(109.12,109.12,109.73,112.59,112.59,112.29,113.8,114.16,112.29,112.29,110.99,110.99,110.99,110.99,111.98,114.26,114.26,114.44,115.47,115.41,114.63,116.48,115.8,115.18,115.18,115.18,115.18,116.38,122.41,122.47,123.09,123.09,123.09,123.09,121.77,121.52,121.52,121.52,121.52,124.73,125.23,124.62,128.94,129.34,127.17,128.08,124.54,121.21,120.85,119.02,119.13,119.84,125.53,124.16,127.32,127.22,122.57,125.45,125.45,127.32,128.79,128.99,129.8,130.33,131.19,132.02,136.97,139.45,128.31,130.73,129.83,125.46,130.23,130.23,132.65,136.34,139.12,133.94,143.09,142.71,136.09,134.57,134.65,134.35) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 109.12 110.99 115.18 121.52 120.85 128.79 130.23 NA [2,] 109.12 110.99 115.18 121.52 119.02 128.99 130.23 NA [3,] 109.73 111.98 115.18 121.52 119.13 129.80 132.65 NA [4,] 112.59 114.26 116.38 124.73 119.84 130.33 136.34 NA [5,] 112.59 114.26 122.41 125.23 125.53 131.19 139.12 NA [6,] 112.29 114.44 122.47 124.62 124.16 132.02 133.94 NA [7,] 113.80 115.47 123.09 128.94 127.32 136.97 143.09 NA [8,] 114.16 115.41 123.09 129.34 127.22 139.45 142.71 NA [9,] 112.29 114.63 123.09 127.17 122.57 128.31 136.09 NA [10,] 112.29 116.48 123.09 128.08 125.45 130.73 134.57 NA [11,] 110.99 115.80 121.77 124.54 125.45 129.83 134.65 NA [12,] 110.99 115.18 121.52 121.21 127.32 125.46 134.35 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.00 0.00 0.00 0.00 -1.83 0.20 0.00 NA [2,] 0.61 0.99 0.00 0.00 0.11 0.81 2.42 NA [3,] 2.86 2.28 1.20 3.21 0.71 0.53 3.69 NA [4,] 0.00 0.00 6.03 0.50 5.69 0.86 2.78 NA [5,] -0.30 0.18 0.06 -0.61 -1.37 0.83 -5.18 NA [6,] 1.51 1.03 0.62 4.32 3.16 4.95 9.15 NA [7,] 0.36 -0.06 0.00 0.40 -0.10 2.48 -0.38 NA [8,] -1.87 -0.78 0.00 -2.17 -4.65 -11.14 -6.62 NA [9,] 0.00 1.85 0.00 0.91 2.88 2.42 -1.52 NA [10,] -1.30 -0.68 -1.32 -3.54 0.00 -0.90 0.08 NA [11,] 0.00 -0.62 -0.25 -3.33 1.87 -4.37 -0.30 NA [12,] 0.00 0.00 0.00 -0.36 1.47 4.77 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/13tjz1457950319.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/2uhb91457950319.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/3nynn1457950319.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/4onc21457950319.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,] 109.120 109.120 109.73 112.59 112.590 112.290 113.800 114.160 112.29 [2,] 113.085 113.085 113.58 115.32 118.335 118.455 119.280 119.250 118.60 [3,] 120.850 119.020 119.13 119.84 125.230 124.160 127.320 127.220 123.09 [4,] 125.155 125.255 125.66 127.53 128.360 128.320 132.955 134.395 127.74 [5,] 130.230 130.230 132.65 136.34 139.120 133.940 143.090 142.710 136.09 [,10] [,11] [,12] [1,] 112.290 110.990 110.990 [2,] 119.785 118.785 118.195 [3,] 125.450 124.540 121.520 [4,] 129.405 127.640 126.390 [5,] 134.570 134.650 134.350 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 113.642 111.7523 111.916 112.5484 119.2432 118.2688 119.1535 118.1757 [2,] 128.058 126.2877 126.344 127.1316 131.2168 130.0512 135.4865 136.2643 [,9] [,10] [,11] [,12] [1,] 117.6317 119.7051 119.2519 116.6261 [2,] 128.5483 131.1949 129.8281 126.4139 $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(109.12, 113.085, 120.85, 125.155, 130.23, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g8271457950319.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,] 0 0.000 0.530 0.000 -1.37 0.620 -0.38 -11.140 -1.520 -1.32 -4.370 -0.36 [2,] 0 0.055 0.955 0.250 -0.99 1.270 -0.08 -5.635 0.000 -1.31 -1.975 0.00 [3,] 0 0.610 2.280 0.860 -0.30 3.160 0.00 -2.170 0.910 -0.90 -0.300 0.00 [4,] 0 0.900 3.035 4.235 0.12 4.635 0.38 -1.325 2.135 -0.34 -0.125 1.47 [5,] 0 0.990 3.690 6.030 0.83 9.150 0.40 0.000 2.880 0.08 1.870 1.47 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 0.1053796 1.037858 -1.519778 -0.9628741 1.150476 -0.2747046 [2,] 0 1.1146204 3.522142 3.239778 0.3628741 5.169524 0.2747046 [,8] [,9] [,10] [,11] [,12] [1,] -4.7438625 -0.3649876 -1.4792684 -1.4047902 -0.9481975 [2,] 0.4038625 2.1849876 -0.3207316 0.8047902 0.9481975 $out [1] -1.83 0.20 2.42 -5.18 2.48 -3.54 4.77 $group [1] 1 1 2 5 7 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0.0549999999999997, 0.609999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64ec31457950320.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] [,8] [1,] 109.12 110.990 115.18 121.210 119.020 125.460 130.230 NA [2,] 110.36 113.120 115.78 121.520 120.345 128.890 133.295 NA [3,] 112.29 114.535 122.09 124.675 124.805 130.080 134.610 NA [4,] 112.59 115.440 123.09 127.625 126.375 131.605 137.730 NA [5,] 114.16 116.480 123.09 129.340 127.320 132.020 143.090 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 111.2729 113.4768 118.7559 121.8905 122.0547 128.8417 132.5872 NA [2,] 113.3071 115.5932 125.4241 127.4595 127.5553 131.3183 136.6328 NA $out [1] 136.97 139.45 $group [1] 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(109.12, 110.36, 112.29, 112.59, 114.16, 110.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qttt1457950320.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,] 119.2929 119.020 119.1200 [2,] 121.0329 120.345 120.5225 [3,] 123.3550 123.625 123.1912 [4,] 124.3586 125.340 123.9912 [5,] 127.3400 127.320 126.8225 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 121.8381 121.3467 121.6091 [2,] 124.8719 125.9033 124.7734 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(119.292857142857, 121.032857142857, 123.355, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13tjz1457950319.ps tmp/13tjz1457950319.png",intern=TRUE)) character(0) > try(system("convert tmp/2uhb91457950319.ps tmp/2uhb91457950319.png",intern=TRUE)) character(0) > try(system("convert tmp/3nynn1457950319.ps tmp/3nynn1457950319.png",intern=TRUE)) character(0) > try(system("convert tmp/4onc21457950319.ps tmp/4onc21457950319.png",intern=TRUE)) character(0) > try(system("convert tmp/5g8271457950319.ps tmp/5g8271457950319.png",intern=TRUE)) character(0) > try(system("convert tmp/64ec31457950320.ps tmp/64ec31457950320.png",intern=TRUE)) character(0) > try(system("convert tmp/7qttt1457950320.ps tmp/7qttt1457950320.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.725 0.459 3.219