R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(107.00,116.14,117.18,102.28,109.43,114.28,117.39,116.66,114.29,114.18,114.12,122.62,115.70,127.91,119.55,115.08,116.63,121.38,123.41,120.70,119.40,116.83,116.40,121.67,116.54,129.61,119.93,117.64,121.01,124.20,125.23,123.24,121.58,120.89,117.77,110.91,124.23,127.70,129.45,120.13,122.02,126.59,126.34,125.15,125.02,124.40,127.55,126.63,130.18,136.95,136.81,129.59,133.37,140.02,139.67,139.99,134.57,134.41,134.99,135.70) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 107.00 115.70 116.54 124.23 130.18 NA [2,] 116.14 127.91 129.61 127.70 136.95 NA [3,] 117.18 119.55 119.93 129.45 136.81 NA [4,] 102.28 115.08 117.64 120.13 129.59 NA [5,] 109.43 116.63 121.01 122.02 133.37 NA [6,] 114.28 121.38 124.20 126.59 140.02 NA [7,] 117.39 123.41 125.23 126.34 139.67 NA [8,] 116.66 120.70 123.24 125.15 139.99 NA [9,] 114.29 119.40 121.58 125.02 134.57 NA [10,] 114.18 116.83 120.89 124.40 134.41 NA [11,] 114.12 116.40 117.77 127.55 134.99 NA [12,] 122.62 121.67 110.91 126.63 135.70 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 9.14 12.21 13.07 3.47 6.77 NA [2,] 1.04 -8.36 -9.68 1.75 -0.14 NA [3,] -14.90 -4.47 -2.29 -9.32 -7.22 NA [4,] 7.15 1.55 3.37 1.89 3.78 NA [5,] 4.85 4.75 3.19 4.57 6.65 NA [6,] 3.11 2.03 1.03 -0.25 -0.35 NA [7,] -0.73 -2.71 -1.99 -1.19 0.32 NA [8,] -2.37 -1.30 -1.66 -0.13 -5.42 NA [9,] -0.11 -2.57 -0.69 -0.62 -0.16 NA [10,] -0.06 -0.43 -3.12 3.15 0.58 NA [11,] 8.50 5.27 -6.86 -0.92 0.71 NA [12,] -6.92 -5.13 13.32 3.55 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/1o2oy1393493489.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/2gar71393493489.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/3sly61393493489.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/4wljs1393493489.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] [1,] 107.00 127.70 117.18 115.08 109.43 114.28 123.41 116.66 114.29 114.18 [2,] 115.70 127.70 119.55 115.08 116.63 121.38 123.41 120.70 119.40 116.83 [3,] 116.54 127.91 119.93 117.64 121.01 124.20 125.23 123.24 121.58 120.89 [4,] 124.23 129.61 129.45 120.13 122.02 126.59 126.34 125.15 125.02 124.40 [5,] 130.18 129.61 136.81 120.13 122.02 126.59 126.34 125.15 125.02 134.41 [,11] [,12] [1,] 114.12 121.67 [2,] 116.40 121.67 [3,] 117.77 122.62 [4,] 127.55 126.63 [5,] 134.99 126.63 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.5127 126.5604 112.9347 114.0717 117.2014 120.5186 123.1597 120.0956 [2,] 122.5673 129.2596 126.9253 121.2083 124.8186 127.8814 127.3003 126.3844 [,9] [,10] [,11] [,12] [1,] 117.6089 115.5411 109.8914 119.1153 [2,] 125.5511 126.2389 125.6486 126.1247 $out [1] 116.14 136.95 102.28 129.59 133.37 140.02 117.39 139.67 139.99 134.57 [11] 110.91 135.70 $group [1] 2 2 4 4 5 6 7 7 8 9 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(107, 115.7, 116.54, 124.23, 130.18, 127.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53v6x1393493489.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,] 3.47 -9.68 -14.90 1.55 4.57 -0.35 -2.71 -2.37 -0.69 -0.43 -6.86 -6.920 [2,] 6.77 -8.36 -9.32 1.89 4.57 -0.25 -1.99 -2.37 -0.69 -0.43 -0.92 -6.025 [3,] 9.14 -0.14 -7.22 3.37 4.75 1.03 -1.19 -1.66 -0.62 -0.06 0.71 -0.790 [4,] 12.21 1.04 -4.47 3.78 4.85 2.03 -0.73 -1.30 -0.16 0.58 5.27 8.435 [5,] 13.07 1.75 -2.29 3.78 4.85 3.11 0.32 -0.13 -0.11 0.58 8.50 13.320 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 5.29611 -6.782016 -10.646998 2.034531 4.552153 -0.5810423 -2.0803128 [2,] 12.98389 6.502016 -3.793002 4.705469 4.947847 2.6410423 -0.2996872 [,8] [,9] [,10] [,11] [,12] [1,] -2.4160593 -0.9944967 -0.7736635 -3.663838 -12.2134 [2,] -0.9039407 -0.2455033 0.6536635 5.083838 10.6334 $out [1] 7.15 3.19 6.65 -5.42 -2.57 -3.12 3.15 $group [1] 4 5 5 8 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3.47, 6.76999999999998, 9.14, 12.21, 13.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/690ba1393493489.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] [1,] 107.000 115.080 110.910 122.020 129.590 NA [2,] 111.775 116.515 117.705 124.315 133.890 NA [3,] 114.285 119.475 120.950 125.745 135.345 NA [4,] 116.920 121.525 123.720 127.090 138.310 NA [5,] 122.620 127.910 129.610 129.450 140.020 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 111.9383 117.1899 118.2065 124.4793 133.329 NA [2,] 116.6317 121.7601 123.6935 127.0107 137.361 NA $out [1] 102.28 120.13 $group [1] 1 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(107, 111.775, 114.285, 116.92, 122.62, 115.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ov901393493489.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,] 116.944 116.540 117.6050 [2,] 121.317 118.850 120.2900 [3,] 123.239 121.295 122.5675 [4,] 125.221 123.720 124.3250 [5,] 127.662 127.910 128.6550 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 121.4584 119.0738 120.7271 [2,] 125.0196 123.5162 124.4079 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(116.944, 121.317, 123.239, 125.221, 127.662, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o2oy1393493489.ps tmp/1o2oy1393493489.png",intern=TRUE)) character(0) > try(system("convert tmp/2gar71393493489.ps tmp/2gar71393493489.png",intern=TRUE)) character(0) > try(system("convert tmp/3sly61393493489.ps tmp/3sly61393493489.png",intern=TRUE)) character(0) > try(system("convert tmp/4wljs1393493489.ps tmp/4wljs1393493489.png",intern=TRUE)) character(0) > try(system("convert tmp/53v6x1393493489.ps tmp/53v6x1393493489.png",intern=TRUE)) character(0) > try(system("convert tmp/690ba1393493489.ps tmp/690ba1393493489.png",intern=TRUE)) character(0) > try(system("convert tmp/7ov901393493489.ps tmp/7ov901393493489.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.998 1.042 6.063