R version 3.0.3 (2014-03-06) -- "Warm Puppy" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(74.74,74.80,74.46,74.03,74.45,74.74,74.74,74.78,74.25,74.14,74.41,74.51,74.51,74.64,74.52,74.51,74.39,74.11,74.11,74.20,73.84,73.89,74.31,73.56,73.56,73.99,73.63,73.51,73.60,73.03,73.03,72.61,72.30,72.56,72.76,72.92,72.92,72.93,73.13,73.31,73.34,74.31,74.31,74.65,74.78,74.73,74.71,74.63,74.63,74.95,75.17,75.49,74.54,75.59,75.59,76.06,76.06,76.39,76.39,76.93,76.93,77.39,77.65,78.04,77.66,77.31,77.31,77.33,78.01,78.31,78.61,78.94,78.94,79.84,78.76,78.62,78.36,78.53,78.53,78.76,78.76,79.37,79.83,79.89) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (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,] 74.74 74.51 73.56 72.92 74.63 76.93 78.94 NA [2,] 74.80 74.64 73.99 72.93 74.95 77.39 79.84 NA [3,] 74.46 74.52 73.63 73.13 75.17 77.65 78.76 NA [4,] 74.03 74.51 73.51 73.31 75.49 78.04 78.62 NA [5,] 74.45 74.39 73.60 73.34 74.54 77.66 78.36 NA [6,] 74.74 74.11 73.03 74.31 75.59 77.31 78.53 NA [7,] 74.74 74.11 73.03 74.31 75.59 77.31 78.53 NA [8,] 74.78 74.20 72.61 74.65 76.06 77.33 78.76 NA [9,] 74.25 73.84 72.30 74.78 76.06 78.01 78.76 NA [10,] 74.14 73.89 72.56 74.73 76.39 78.31 79.37 NA [11,] 74.41 74.31 72.76 74.71 76.39 78.61 79.83 NA [12,] 74.51 73.56 72.92 74.63 76.93 78.94 79.89 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.06 0.13 0.43 0.01 0.32 0.46 0.90 NA [2,] -0.34 -0.12 -0.36 0.20 0.22 0.26 -1.08 NA [3,] -0.43 -0.01 -0.12 0.18 0.32 0.39 -0.14 NA [4,] 0.42 -0.12 0.09 0.03 -0.95 -0.38 -0.26 NA [5,] 0.29 -0.28 -0.57 0.97 1.05 -0.35 0.17 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.04 0.09 -0.42 0.34 0.47 0.02 0.23 NA [8,] -0.53 -0.36 -0.31 0.13 0.00 0.68 0.00 NA [9,] -0.11 0.05 0.26 -0.05 0.33 0.30 0.61 NA [10,] 0.27 0.42 0.20 -0.02 0.00 0.30 0.46 NA [11,] 0.10 -0.75 0.16 -0.08 0.54 0.33 0.06 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.00 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/17jdw1394641381.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/2nr6p1394641381.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/3gj3f1394641381.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/4nnei1394641381.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,] 72.920 72.930 73.130 73.310 73.340 73.03 73.03 72.610 72.300 72.560 72.76 [2,] 74.035 74.315 74.045 73.770 73.995 74.21 74.21 74.425 74.045 74.015 74.36 [3,] 74.630 74.800 74.520 74.510 74.450 74.74 74.74 74.780 74.780 74.730 74.71 [4,] 75.835 76.170 76.410 76.765 76.100 76.45 76.45 76.695 77.035 77.350 77.50 [5,] 76.930 77.390 78.760 78.620 78.360 78.53 78.53 78.760 78.760 79.370 79.83 [,12] [1,] 72.920 [2,] 74.035 [3,] 74.630 [4,] 77.935 [5,] 79.890 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.55507 73.69222 73.10766 72.72143 73.19293 73.40231 73.40231 73.42439 [2,] 75.70493 75.90778 75.93234 76.29857 75.70707 76.07769 76.07769 76.13561 [,9] [,10] [,11] [,12] [1,] 72.99442 72.73839 72.83484 72.30098 [2,] 76.56558 76.72161 76.58516 76.95902 $out [1] 78.94 79.84 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(72.92, 74.035, 74.63, 75.835, 76.93, 72.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55m4q1394641381.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.010 -1.08 -0.43 -0.38 -0.570 0 0.020 -0.530 -0.110 -0.02 -0.080 0 [2,] 0.095 -0.35 -0.13 -0.32 -0.315 0 0.030 -0.335 0.000 0.10 -0.010 0 [3,] 0.320 -0.12 -0.01 -0.12 0.170 0 0.090 0.000 0.260 0.27 0.100 0 [4,] 0.445 0.21 0.25 0.06 0.630 0 0.285 0.065 0.315 0.36 0.245 0 [5,] 0.900 0.26 0.39 0.42 1.050 0 0.470 0.130 0.610 0.46 0.540 0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1109856 -0.454423 -0.2369299 -0.3469299 -0.3943388 0 -0.06228189 [2,] 0.5290144 0.214423 0.2169299 0.1069299 0.7343388 0 0.24228189 [,8] [,9] [,10] [,11] [,12] [1,] -0.2388735 0.07188708 0.1147322 -0.05228189 0 [2,] 0.2388735 0.44811292 0.4252678 0.25228189 0 $out [1] -0.95 -0.42 0.68 -0.75 $group [1] 4 7 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0100000000000051, 0.0949999999999989, 0.320000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61wcd1394641381.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,] 74.030 73.560 72.300 72.92 74.540 76.930 78.360 NA [2,] 74.330 74.000 72.685 73.22 75.060 77.320 78.575 NA [3,] 74.485 74.255 73.030 74.31 75.590 77.655 78.760 NA [4,] 74.740 74.510 73.580 74.68 76.225 78.175 79.600 NA [5,] 74.800 74.640 73.990 74.78 76.930 78.940 79.890 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 74.298 74.02239 72.62178 73.64408 75.05864 77.26503 78.29249 NA [2,] 74.672 74.48761 73.43822 74.97592 76.12136 78.04497 79.22751 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(74.03, 74.33, 74.485, 74.74, 74.8, 73.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78h4x1394641381.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,] 75.17571 74.450 74.93500 [2,] 75.34500 74.575 75.23500 [3,] 75.40143 74.720 75.33000 [4,] 75.56643 74.760 75.62125 [5,] 75.86000 74.800 75.98500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 75.30043 74.63562 75.15383 [2,] 75.50242 74.80438 75.50617 $out [1] 75.91143 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(75.1757142857143, 75.345, 75.4014285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17jdw1394641381.ps tmp/17jdw1394641381.png",intern=TRUE)) character(0) > try(system("convert tmp/2nr6p1394641381.ps tmp/2nr6p1394641381.png",intern=TRUE)) character(0) > try(system("convert tmp/3gj3f1394641381.ps tmp/3gj3f1394641381.png",intern=TRUE)) character(0) > try(system("convert tmp/4nnei1394641381.ps tmp/4nnei1394641381.png",intern=TRUE)) character(0) > try(system("convert tmp/55m4q1394641381.ps tmp/55m4q1394641381.png",intern=TRUE)) character(0) > try(system("convert tmp/61wcd1394641381.ps tmp/61wcd1394641381.png",intern=TRUE)) character(0) > try(system("convert tmp/78h4x1394641381.ps tmp/78h4x1394641381.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.939 0.888 5.902