R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(33.7,34.59,35.1,35.87,37.15,37.61,37.97,38.94,39.18,39.49,39.86,40.02,40.2,40.85,41.45,41.7,41.92,41.97,42.31,42.61,42.82,43.07,43.51,43.57,43.86,44.49,45.99,48.22,49.46,50.39,50.4,50.59,51.32,51.86,52.47,52.73,52.73,53.59,54.11,54.8,55.72,56.06,56.66,57.05,57.31,57.89,58.32,58.72,59.02,59.54,61.49,62.26,63.49,64.36,65.93,66.82,68.85,71.27,72.27,73.4,73.58,74.84,75.74,77.81,78.74,79.06,79.48,81.19,85.11,86.64,88.48,89.2) > 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] 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,] 33.70 40.20 43.86 52.73 59.02 73.58 NA [2,] 34.59 40.85 44.49 53.59 59.54 74.84 NA [3,] 35.10 41.45 45.99 54.11 61.49 75.74 NA [4,] 35.87 41.70 48.22 54.80 62.26 77.81 NA [5,] 37.15 41.92 49.46 55.72 63.49 78.74 NA [6,] 37.61 41.97 50.39 56.06 64.36 79.06 NA [7,] 37.97 42.31 50.40 56.66 65.93 79.48 NA [8,] 38.94 42.61 50.59 57.05 66.82 81.19 NA [9,] 39.18 42.82 51.32 57.31 68.85 85.11 NA [10,] 39.49 43.07 51.86 57.89 71.27 86.64 NA [11,] 39.86 43.51 52.47 58.32 72.27 88.48 NA [12,] 40.02 43.57 52.73 58.72 73.40 89.20 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.89 0.65 0.63 0.86 0.52 1.26 NA [2,] 0.51 0.60 1.50 0.52 1.95 0.90 NA [3,] 0.77 0.25 2.23 0.69 0.77 2.07 NA [4,] 1.28 0.22 1.24 0.92 1.23 0.93 NA [5,] 0.46 0.05 0.93 0.34 0.87 0.32 NA [6,] 0.36 0.34 0.01 0.60 1.57 0.42 NA [7,] 0.97 0.30 0.19 0.39 0.89 1.71 NA [8,] 0.24 0.21 0.73 0.26 2.03 3.92 NA [9,] 0.31 0.25 0.54 0.58 2.42 1.53 NA [10,] 0.37 0.44 0.61 0.43 1.00 1.84 NA [11,] 0.16 0.06 0.26 0.40 1.13 0.72 NA [12,] 0.18 0.29 0.00 0.30 0.18 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/1y4rt1363095281.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/2ff1a1363095281.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/3bco81363095281.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/45yew1363095281.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,] 33.700 34.59 35.10 35.87 37.15 37.610 37.97 38.94 39.180 39.490 39.860 [2,] 40.200 40.85 41.45 41.70 41.92 41.970 42.31 42.61 42.820 43.070 43.510 [3,] 48.295 49.04 50.05 51.51 52.59 53.225 53.53 53.82 54.315 54.875 55.395 [4,] 59.020 59.54 61.49 62.26 63.49 64.360 65.93 66.82 68.850 71.270 72.270 [5,] 73.580 74.84 75.74 77.81 78.74 79.060 79.48 81.19 85.110 86.640 88.480 [,12] [1,] 40.020 [2,] 43.570 [3,] 55.725 [4,] 73.400 [5,] 89.200 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 36.15549 36.98435 37.12355 38.24814 38.67665 38.78273 38.29434 38.20377 [2,] 60.43451 61.09565 62.97645 64.77186 66.50335 67.66727 68.76566 69.43623 [,9] [,10] [,11] [,12] [1,] 37.52481 36.68509 36.84387 36.48369 [2,] 71.10519 73.06491 73.94613 74.96631 $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(33.7, 40.2, 48.295, 59.02, 73.58, 34.59, 40.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zuye1363095281.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.520 0.51 0.25 0.92 0.05 0.01 0.19 0.210 0.25 0.370 0.06 0.18 [2,] 0.630 0.52 0.69 0.92 0.32 0.34 0.30 0.240 0.31 0.430 0.16 0.18 [3,] 0.755 0.75 0.77 1.08 0.40 0.39 0.64 0.495 0.56 0.525 0.33 0.18 [4,] 0.890 1.50 2.07 1.24 0.87 0.60 0.97 2.030 1.53 1.000 0.72 0.29 [5,] 1.260 1.95 2.23 1.28 0.93 0.60 1.71 3.920 2.42 1.840 1.13 0.30 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.5872916 0.1178683 -0.1201446 0.8735897 0.04523224 0.2222916 0.2078284 [2,] 0.9227084 1.3821317 1.6601446 1.2864103 0.75476776 0.5577084 1.0721716 [,8] [,9] [,10] [,11] [,12] [1,] -0.6596078 -0.2269394 0.1573316 -0.03121809 0.1022743 [2,] 1.6496078 1.3469394 0.8926684 0.69121809 0.2577257 $out [1] 0.22 1.57 0.00 $group [1] 4 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.519999999999996, 0.630000000000003, 0.755000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ufnd1363095281.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,] 33.700 40.200 43.860 52.730 59.020 73.580 NA [2,] 35.485 41.575 47.105 54.455 61.875 76.775 NA [3,] 37.790 42.140 50.395 56.360 65.145 79.270 NA [4,] 39.335 42.945 51.590 57.600 70.060 85.875 NA [5,] 40.020 43.570 52.730 58.720 73.400 89.200 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 36.03399 41.51513 48.34936 54.92554 61.41177 75.11943 NA [2,] 39.54601 42.76487 52.44064 57.79446 68.87823 83.42057 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(33.7, 35.485, 37.79, 39.335, 40.02, 40.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mm8z1363095281.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,] 50.51500 48.2950 49.28125 [2,] 52.87833 50.7800 51.48875 [3,] 55.18333 53.3775 53.57625 [4,] 57.90083 54.5950 56.02562 [5,] 59.60667 55.7250 57.79500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 52.89254 51.63745 51.50695 [2,] 57.47413 55.11755 55.64555 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(50.515, 52.8783333333333, 55.1833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y4rt1363095281.ps tmp/1y4rt1363095281.png",intern=TRUE)) character(0) > try(system("convert tmp/2ff1a1363095281.ps tmp/2ff1a1363095281.png",intern=TRUE)) character(0) > try(system("convert tmp/3bco81363095281.ps tmp/3bco81363095281.png",intern=TRUE)) character(0) > try(system("convert tmp/45yew1363095281.ps tmp/45yew1363095281.png",intern=TRUE)) character(0) > try(system("convert tmp/5zuye1363095281.ps tmp/5zuye1363095281.png",intern=TRUE)) character(0) > try(system("convert tmp/6ufnd1363095281.ps tmp/6ufnd1363095281.png",intern=TRUE)) character(0) > try(system("convert tmp/7mm8z1363095281.ps tmp/7mm8z1363095281.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.972 0.587 4.548